Mais sinon, tu n'as qu'à essayer
public function getAnObject ( ) {
return $something ? new AnObject() : null;
}
public function fluentMe ( ) {
// … some operations
return $this->getAnObject();
} Dans un tel cas, $o->fluentMe()->anOtherMethod() peut retourner une erreur