-
Notifications
You must be signed in to change notification settings - Fork 84
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
Drop triun/longest-common-substring dependency #379
Conversation
phpstan reports
but I don't see a single method which does not declare its return type? |
@@ -37,6 +37,9 @@ parameters: | |||
message: '#Instead of "instanceof/is_a\(\)" use ReflectionProvider service or "\(new ObjectType\(<desired_type\>\)\)\-\>isSuperTypeOf\(<element_type\>\)" for static reflection to work#' | |||
path: src/ValueObjectFactory/ServiceMapFactory.php | |||
|
|||
- '#Cognitive complexity for "Rector\\Symfony\\Rector\\Closure\\MinimalSharedStringSolver\:\:solve\(\)" is (.*?), keep it under 10#' |
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.
I decided to ignore this error, since I don't want to fiddle in this "external" code and introduce bugs since we don't know all the details
if (! is_string($sharedNamespace)) { | ||
return null; | ||
} |
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.
since the MinimalSharedStringSolver
no longer implements the Solver
interface, we were able to declare more specific return types which also means this case - which was never taken, as null
could technically not be returned - can be dropped.
Thank you @staabm |
/** | ||
* Class Solver copied from https://github.com/Triun/PHP-Longest-Common-Substring | ||
*/ | ||
final class MinimalSharedStringSolver |
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.
@staabm This needs a test, as there is lot of tiny coding happening here.
Could you add it?
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.
sure, here you are: #380
closes rectorphp/rector#7832