-
-
Notifications
You must be signed in to change notification settings - Fork 616
Psalm level 6 2 #1562
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
Psalm level 6 2 #1562
Conversation
| $callable = $callee->getCallable(); | ||
|
|
||
| if ($callee->isAnInstanceMethod()) { | ||
| if ($callee->isAnInstanceMethod() && is_array($callable)) { |
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.
Need to make sure that $callable is an array before using it as an array
| parent::__construct($scopeName, $filterString, $callable, $description); | ||
|
|
||
| if ($this->isAnInstanceMethod()) { | ||
| if (is_array($callable)) { |
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.
Depending on the type of callable that we have we get the class name and method name using one way or another
| private $firstBackgroundEnded = false; | ||
| /** | ||
| * @var Event[] | ||
| * @var array<array{0: Event, 1: string}> |
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.
Wrong doc comment
| * Returns counters for different scenario result codes. | ||
| * | ||
| * @return array<TestResult::*, int> | ||
| * @return array<StepResult::*, int> |
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.
This includes one case that is defined in StepResult, so we use the derived class
acoulton
left a comment
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.
Looks good, just a small question/opportunity to extract some duplicate code if you'd like to do that
|
@carlos-granados it doesn't look like the branch is updated? |
|
@acoulton argh, I committed the code but forgot to push it, done |
Co-authored-by: Andrew Coulton <andrew@ingenerator.com>
acoulton
left a comment
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.
Great :)
|
@stof happy with this now? I would like to merge it to continue with this upgrade. Thanks! |
Applies three new rules for PSalm level 6