Skip to content

Fix ConsoleExecuteReturnIntRector if target class not directly extends Command#2202

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
keulinho:fix-command-return-int-rector-for-multi-inheritance
Oct 26, 2019
Merged

Fix ConsoleExecuteReturnIntRector if target class not directly extends Command#2202
TomasVotruba merged 1 commit intorectorphp:masterfrom
keulinho:fix-command-return-int-rector-for-multi-inheritance

Conversation

@keulinho
Copy link
Copy Markdown
Contributor


if (! ($class->extends && $this->isName($class->extends, Command::class))) {
$reflection = new \ReflectionClass($this->getName($class));
if (! $reflection->isSubclassOf(Command::class)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

if (!$this->isObjectType($class, Command::class)) {
    return null;
}

Something like this should be in other rules like this

@TomasVotruba
Copy link
Copy Markdown
Member

My comment is marginal.
Merging as it is to fix the issue.

@TomasVotruba TomasVotruba merged commit 1004357 into rectorphp:master Oct 26, 2019
@TomasVotruba
Copy link
Copy Markdown
Member

Thank you for quick fix!

TomasVotruba added a commit that referenced this pull request Apr 30, 2022
rectorphp/rector-src@f30523f [Code] Rename IfManipulator->createIfExpr() to IfManipulator->createIfStmt() (#2202)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants