-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Add the factory keyword #729
Conversation
@ogizanagi would you mind doing a quick review on that one? |
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.
👍 ✨✨
@@ -64,6 +66,24 @@ public function denormalize(FixtureInterface $scope, FlagParserInterface $parser | |||
if ('__construct' === $unparsedPropertyName) { | |||
$constructor = $this->denormalizeConstructor($value, $scope, $parser); | |||
|
|||
if (false === ($constructor instanceof NoMethodCall) && '__construct' !== $constructor->getMethod()) { |
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.
- if (false === ($constructor instanceof NoMethodCall) && '__construct' !== $constructor->getMethod()) {
+ if (!$constructor instanceof NoMethodCall && '__construct' !== $constructor->getMethod()) {
?
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 kinda prefer being explicit instead of using !
, as it's the current convention I would prefer not to change it at that point :)
$this->assertSame($expected, $actual); | ||
} | ||
|
||
public function testDenormalizesConstructorWithTheDecoratedConstructorDenormalizerIfCannotDenormalizeWithTheFactoryDenormalizer() |
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'm breathless and stuttering just by reading this in my head 😆
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.
yeah, I would like to switch to snake case as for php spec, this would already be somewhat more readable... but I don't have the will to update all the tests for that^^
Tackles the
__factory
part of #388.Todo:
__construct
in favour of__factory
__construct
with only 1 named param, it is not clear if the param is an argument key or a constructor name. In__factory
the ambiguity is non existent