Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Attempted to call an undefined method named "boot" #19

Closed
enumag opened this issue Oct 23, 2018 · 1 comment
Closed

Attempted to call an undefined method named "boot" #19

enumag opened this issue Oct 23, 2018 · 1 comment
Labels
kind/bug/possible Something probably isn't working

Comments

@enumag
Copy link
Contributor

enumag commented Oct 23, 2018

swoole:
    http_server:
        # ...
        services:
            debug_handler: true
            entity_manager_handler: true

debug_handler: true causes Attempted to call an undefined method named "boot" of class "K911\Swoole\Bridge\Symfony\HttpKernel\DebugHttpKernelRequestHandler".

Similarly entity_manager_handler: true causes Attempted to call an undefined method named "boot" of class "K911\Swoole\Bridge\Doctrine\ORM\EntityManagerHandler".

@enumag
Copy link
Contributor Author

enumag commented Oct 23, 2018

The reason is that both of these services have ->setDecoratedService(RequestHandlerInterface::class) but RequestHandlerInterface service is in fact HttpKernelRequestHandler which implements BootableInterface. This triggers autoconfiguration and both DebugHttpKernelRequestHandler and EntityManagerHandler incorrectly receive the swoole_bundle.bootable_service tag.

@k911 k911 added the kind/bug/possible Something probably isn't working label Oct 23, 2018
k911 added a commit that referenced this issue Oct 24, 2018
- Don't depend only on symfony service tag `swoole_bundle.bootable_service` to determine whether service is bootable, check interface too, to avoid problems with decorated services
- Move most logic of boot manager to happen at compile time

Fixes #19
k911 added a commit that referenced this issue Oct 24, 2018
- Don't depend only on symfony service tag `swoole_bundle.bootable_service` to determine whether service is bootable, check interface too, to avoid problems with decorated services
- Move most logic of boot manager to happen at compile time

Fixes #19
k911 added a commit that referenced this issue Oct 24, 2018
- Don't depend only on symfony service tag `swoole_bundle.bootable_service` to determine whether service is bootable, check interface too, to avoid problems with decorated services
- Move most logic of boot manager to happen at compile time

Fixes #19
@k911 k911 closed this as completed in #21 Oct 24, 2018
k911 added a commit that referenced this issue Oct 24, 2018
- Don't depend only on symfony service tag `swoole_bundle.bootable_service` to determine whether service is bootable, check interface too, to avoid problems with decorated services
- Move most logic of boot manager to happen at compile time

Fixes #19
k911 added a commit that referenced this issue Oct 24, 2018
- Service decorators `K911\Swoole\Server\RequestHandler\RequestHandlerInterface` were
autoconfigured with `swoole_bundle.bootable_service` tag, due to base
service being bootable
- Move most logic of boot manager to happen at compile time

Fixes #19
k911 pushed a commit that referenced this issue Oct 24, 2018
##  (2018-10-24)

* fix(boot-manager): Don't boot not bootable objects ([8ad97a2](8ad97a2)), closes [#19](#19)
* fix(xdebug-handler): Replace with custom solution ([0dc13f0](0dc13f0)), closes [#13](#13)
* chore(deps): Upgrade dependencies ([afc0bfc](afc0bfc))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug/possible Something probably isn't working
Projects
None yet
Development

No branches or pull requests

2 participants