Issue on parsing closure callback
and1truong opened this issue · comments
Hong Truong commented
Issue on for PHP-DI/Slim-Bridge/ users when compiling the container, PHP-DI/Slim-Bridge#63, because this code https://github.com/PHP-DI/Slim-Bridge/blob/2.0.0/src/config.php#L61-L72
'foundHandler.invoker' => function (ContainerInterface $c) {
$resolvers = [
new AssociativeArrayResolver,
…
];
return new Invoker(new ResolverChain($resolvers), $c);
},
For object created without ()
, namespace was ignored:
Expecting:
new \Invoker\ParameterResolver\AssociativeArrayResolver\AssociativeArrayResolver
actual:
new AssociativeArrayResolver
Graham Campbell commented
What version of this package?
Hong Truong commented
@GrahamCampbell, you can test on master.
Hong Truong commented
The test case:
class ClosureTest extends \PHPUnit\Framework\TestCase
{
public function test()
{
$wrapper = new SerializableClosure(
function () {
return new ClosureContext; // new object without `()`
}
);
$code = $wrapper->getReflector()->getCode();
$this->assertContains('Opis\Closure\ClosureContext', $code);
}
}
Hong Truong commented
@sorinsarca may you tag the master?