Run Rector on your code to see what it can do for you:
<?php interface FooInterface {}
class Imp implements DoX { - public function run(): A|B + /** + * @return \A|\B + */ + public function run() { return new A(); } }
Applied Rules:
Not a change you expect?
rector.php