|
TL;DR Can missing (union) return typehint be added to Foo class not just FooContract by Rector automatically? I was playing around with Rector to try to update our (Drupal) codebase from PHP 7.4 and 8.1 and based on what I saw, Rector could only add union return type to an interface but not to those classes that implements the interface which lead to fatal error. What am I missing? (It looks like having |
Replies: 2 comments 8 replies
|
@TomasVotruba Hi, sorry for the direct ping but can you share some insights about how/if this should work? |
|
So for the record the actual solution is something like: |


So for the record the actual solution is something like:
https://getrector.org/demo/923fc431-82bd-424a-b1a5-1e72bdaf161b
or
https://getrector.org/demo/e820f7df-429f-46eb-9532-32a241802a9e
or
https://getrector.org/demo/c7564af9-c139-4cab-9f94-95ab1716c6a1