Skip to content
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

[CodeQuality] Add rule to instantly return nulable value, instead of jumping around it #5712

Closed
TomasVotruba opened this issue Feb 28, 2021 · 1 comment · Fixed by #6043
Closed
Assignees
Labels

Comments

@TomasVotruba
Copy link
Member

TomasVotruba commented Feb 28, 2021

 /** @var Property|null $property */
-$property = $this->underscoreCamelCasePropertyRenamer->rename($propertyRename);
+return $this->underscoreCamelCasePropertyRenamer->rename($propertyRename);
-if (! $property instanceof Property) {
-    return null;
-}
-
-return $node;
@samsonasik
Copy link
Member

The example above should return $property in last as we return directly nullable $this->underscoreCamelCasePropertyRenamer->rename($propertyRename) as $property variable.

TomasVotruba added a commit that referenced this issue Mar 11, 2024
rectorphp/rector-src@861a880 [Php82] Skip usage of already RecursiveDirectoryIterator::SKIP_DOTS on FilesystemIteratorSkipDotsRector (#5712)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants