-
Notifications
You must be signed in to change notification settings - Fork 7
[RFR] Inject store arguments in Behat hooks non step methods #24
Conversation
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.
thanks @vincentchalamon, this is very nice work 👍
src/ScenarioStateCall.php
Outdated
$environment; | ||
$hook; | ||
$arguments; | ||
$errorReportingLevel; |
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 don’t quite see the point of those expressions 🤔
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.
Hey, it's still WIP ;)
Unit tests in progress… |
*/ | ||
public function dispatchScopeHooks(HookScope $scope) | ||
{ | ||
$results = array(); |
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.
Use short syntax!
continue; | ||
} | ||
|
||
$paramsKeys = array_map(function($element) { |
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.
What about foreach
vs array_map()
?
return $setup; | ||
} | ||
|
||
$hookCallResults = $this->dispatcher->dispatchScopeHooks(new BeforeScenarioScope($env, $feature, $scenario)); |
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 var is useless.
return $teardown; | ||
} | ||
|
||
$hookCallResults = $this->dispatcher->dispatchScopeHooks(new AfterScenarioScope($env, $feature, $scenario, $result)); |
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 var is useless.
Scrutinizer patches are wrong: http://www.php-fig.org/psr/psr-2/#closures |
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.
Nice :) 👍
@meyerbaptiste, ok for you? |
@Gregcop1, If you have some time to spend, could you verify that the PR fixes your use case? (If not, just trust @vincentchalamon’s work and everything will be fine I’m sure) |
Note. I’m okay with the small BC breaks due to namespace reorganization (the I suggest to ship it to minor version anymay, even if it conflicts with semver. I expect no one will feel the pain since it’s deeply internal subject and the user base is still small ;) |
Fix #23