https://www.mediawiki.org/wiki/Manual:Coding_conventions#Line_continuation says
The method operator should always be put at the beginning of the next line.
$this->getMockBuilder( Message::class )->setMethods( [ 'fetchMessage' ] ) ->disableOriginalConstructor() ->getMock();
Example: I came across the following in the Wikispeech extension
$config = MediaWikiServices::getInstance()-> getConfigFactory()-> makeConfig( 'wikispeech' );
While this works, the coding convention should be enforced by a sniff.
A basic code search (https://codesearch.wmflabs.org/search/?q=-%3E%24&i=nope&files=%5C.php%24&repos=) reveals 64 violations in core