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

Fixed #16514: `resolveCallableDependencies` is not supported callable object. #16528

Merged
merged 4 commits into from Jul 27, 2018

Conversation

Projects
None yet
3 participants
@wi1dcard
Copy link
Contributor

wi1dcard commented Jul 18, 2018

Q A
Is bugfix? Y
New feature? N
Breaks BC? N
Tests pass? Y
Fixed issues #16514

wi1dcard and others added some commits Jul 18, 2018

@@ -523,6 +523,8 @@ public function resolveCallableDependencies(callable $callback, $params = [])
{
if (is_array($callback)) {
$reflection = new \ReflectionMethod($callback[0], $callback[1]);
} elseif (is_object($callback)) {

This comment has been minimized.

@samdark

samdark Jul 19, 2018

Member

It's not checking if __invoke is present in an object. How about using is_callable instead?

This comment has been minimized.

@wi1dcard

wi1dcard Jul 19, 2018

Contributor

As resolveCallableDependencies declared, argument $callable must be a callable.

I think if the object not presented __invoke method, it will cause a Type hint error.

@wi1dcard

This comment has been minimized.

Copy link
Contributor

wi1dcard commented Jul 21, 2018

@samdark Would you please merge this request?

@samdark samdark merged commit 1246e5f into yiisoft:master Jul 27, 2018

@samdark

This comment has been minimized.

Copy link
Member

samdark commented Jul 27, 2018

Merged. Thank you!

@samdark samdark added this to the 2.0.16 milestone Jul 27, 2018

samdark added a commit that referenced this pull request Sep 7, 2018

@wi1dcard wi1dcard deleted the wi1dcard:16514-resolve-callable-dependencies branch Sep 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment