Skip to content
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

Issue on parsing closure callback #70

Closed
and1truong opened this issue Jul 24, 2020 · 4 comments
Closed

Issue on parsing closure callback #70

and1truong opened this issue Jul 24, 2020 · 4 comments

Comments

@and1truong
Copy link

and1truong commented Jul 24, 2020

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
@GrahamCampbell
Copy link
Contributor

What version of this package?

@and1truong
Copy link
Author

@GrahamCampbell, you can test on master.

@and1truong
Copy link
Author

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);
    }
}

and1truong added a commit to and1truong/closure that referenced this issue Jul 24, 2020
and1truong added a commit to and1truong/closure that referenced this issue Jul 24, 2020
mnapoli added a commit to mnapoli/closure that referenced this issue Aug 1, 2020
@and1truong
Copy link
Author

@sorinsarca may you tag the master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants