beyondcode / beyondcode/invoker-community

Laravel application provides a DBAL EventSubscriber class, which prevents Invoker from working due to a type error

Open
#244 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
76
Forks
1
PR merge metrics
No merged PRs in 30d

Description

1. Service Provider provides instance of `PostgisSchemaColumnDefinitionEventSubscriber` like so:
```
$dbPlatform = $connection
->getDoctrineSchemaManager()
->getDatabasePlatform();

$dbPlatform->getEventManager()->addEventSubscriber(new PostgisSchemaColumnDefinitionEventSubscriber);
```

2. `PostgisSchemaColumnDefinitionEventSubscriber` implements `Doctrine\Common\EventSubscriber`
3. Inovker does not recognize `Doctrine\Common\EventSubscriber` as the same interface (instance of) as `_HumbugBoxcd54a32bc978\Doctrine\Common\EventSubscriber` (because it is not the same interface, as it is in a different namespace due to being in the `humbug\box` phar)
4. Invoker displays message below when attempting any action.

Can this be fixed in invoker?

Any suggestions to work around?

------
**OS**: darwin
**Invoker Version**: 2.8.0
**Laravel Version**: 8.59.0
**Local project**: true
**PHP Binary**: /usr/local/bin/php
**Route**: /project/index?class=App%5CImage&time=1631075207106&project=local-nsoVEWcmLKuEaNZm5vaZ8T

**Error**:
```
TypeError

Argument 1 passed to _HumbugBoxcd54a32bc978\Doctrine\Common\EventManager::addEventSubscriber() must be an instance of _HumbugBoxcd54a32bc978\Doctrine\Common\EventSubscriber, instance of AngelSourceLabs\LaravelSpatial\Doctrine\Event\Listeners\PostgisSchemaColumnDefinitionEventSubscriber given, called in /Users/brion/development/penguin/vendor/angel-source-labs/laravel-spatial/src/SpatialServiceProvider.php on line 94

at phar:/Applications/Development/Invoker.app/Contents/Resources/invoker.phar/vendor/doctrine/event-manager/lib/Doctrine/Common/EventManager.php:41
37▕ foreach ((array) $events as $event) {
38▕ unset($this->_listeners[$event][$hash]);
39▕ }
40▕ }
➜ 41▕ public function addEventSubscriber(\_HumbugBoxcd54a32bc978\Doctrine\Common\EventSubscriber $subscriber)
42▕ {
43▕ $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber);
44▕ }
45▕ public function removeEventSubscriber(\_HumbugBoxcd54a32bc978\Doctrine\Common\EventSubscriber $subscriber)

+14 vendor frames 
15 phar:/Applications/Development/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:50
Illuminate\Database\Eloquent\Model::query()

16 phar:/Applications/Development/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:36
_HumbugBoxcd54a32bc978\Invoker\Actions\IndexResourceAction::buildQuery()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.