-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHPStanStaticTypeMapper] Allow Closure type on ClosureTypeMapper based on PHP versions #4785
Conversation
…ed on PHP versions
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture; | ||
|
||
final class SkipPropertyAssign | ||
{ | ||
private $command; | ||
|
||
public function __construct(\Closure $command) | ||
{ | ||
$this->command = $command; | ||
} | ||
|
||
public function getCommand() | ||
{ | ||
if (!$this->command instanceof \Closure) { | ||
return $this->command; | ||
} | ||
|
||
$this->command = ($this->command)(); | ||
|
||
return $this->command; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomasVotruba I removed this test fixture, because for whatever type assigned in __construct()
, if it replaced in different method, it will always be new type, which I think very rare use case, eg on symfony:
The ClassPropertyAssignToConstructorPromotionRector
don't cover that, as other type when re-assign with other type in other method will have different type as well.
All checks have passed 🎉 @TomasVotruba I think it is ready. |
Thanks, let's merge this 👍 |
No description provided.