This seems to be another formatting oddity of certain IDEs. Nonetheless to conform to code standards, perhaps we could have an additional formatting rule for the PHP Formatter to keep return type colons and nullable question marks together rather than placing the question mark next to the nullable return type?
Instead of:
function myAction() : ?MyObject
If enabled, the rule would keep the colon and question mark together like:
function myAction() :? MyObject
This would be similar to this existing rule:
Thanks!