We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It is unsupported to pass a callable to invoke() that is missing the object context:
invoke()
creator/lib/InvokableClosure.php
Lines 21 to 25 in 6da60f9
Creator should resolve the object (if it's non-static) and then call the invokable instead of throwing an exception.
Example test case that should pass:
class Foo { function __construct($bar) { $this->bar = $bar; } } class BarTransformer { function transform ($bar) { return strtoupper($bar); } } class AnyClass { static function bax (Foo $foo, BarTransformer $barTransformer) { return $barTransformer->transform($foo->bar); } function __construct(Foo $foo) { $this->foo = $foo; } function bar (BarTransformer $barTransformer) { return $barTransformer->transform($this->foo->bar); } } $creator = new Creator(); $creator->registerClassResource(new Foo('hello world')); echo $creator->invoke(['AnyClass', 'bax']); echo $creator->invoke(['AnyClass', 'bar']);
Should output
HELLO WORLD
twice, the first invocation should not register a class resource as the method is only called statically.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It is unsupported to pass a callable to
invoke()
that is missing the object context:creator/lib/InvokableClosure.php
Lines 21 to 25 in 6da60f9
Creator should resolve the object (if it's non-static) and then call the invokable instead of throwing an exception.
Example test case that should pass:
Should output
twice, the first invocation should not register a class resource as the method is only called statically.
The text was updated successfully, but these errors were encountered: