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
Simplify conditions #630
Simplify conditions #630
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.
👍 some nice changes! I've added a comment inline.
} | ||
$value = $parameter->isOptional() && ! $this->definitionResolver->isResolvable($value) | ||
? $this->getParameterDefaultValue($parameter, $method) | ||
: $this->definitionResolver->resolve($value); |
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.
While the rest are great improvements I don't feel this one is more readable with the change, could you revert this?
Done, @mnapoli, I reversed the change in the file |
@@ -71,7 +71,6 @@ public function resolveParameters( | |||
|
|||
// Nested definitions | |||
if ($value instanceof Definition) { | |||
// If the container cannot produce the entry, we can use the default parameter value |
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 just notice this removal: why remove the comment?
@mnapoli I removed the comments by mistake, now I revert the remove of comment |
Thanks |
This PR is intended to simplify conditions, either by applying an early return or apply ternary operations in
if
andelse
conditions