goaop/goaop-laravel-bridge

Dependency incompatibility

i3anaan opened this issue · 2 comments

After running into an issue getting Annotations to correctly triggered I updated all our project's dependencies, after updating the dependencies (no issues there) I got the following error:

[2017-07-24 12:11:36] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /var/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:117
Stack trace:
#0 /var/www/vendor/goaop/framework/src/Instrument/ClassLoading/AopComposerLoader.php(114): Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(Object(Closure))
#1 /var/www/vendor/goaop/framework/src/Core/AspectKernel.php(123): Go\Instrument\ClassLoading\AopComposerLoader::init(Array, Object(Go\Core\GoAspectContainer))
#2 /var/www/vendor/goaop/goaop-laravel-bridge/src/GoAopServiceProvider.php(53): Go\Core\AspectKernel->init(Array)
#3 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): Go\Laravel\GoAopBridge\GoAopServiceProvider->Go\Laravel\GoAopBridge\{closure}(Object(Illuminate\Foundation\Application), Array)
#4 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#5 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('Go\\Core\\AspectK...')
#6 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('Go\\Core\\AspectK...')
#7 /var/www/vendor/goaop/goaop-laravel-bridge/src/GoAopServiceProvider.php(60): Illuminate\Foundation\Application->make('Go\\Core\\AspectK...')
#8 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): Go\Laravel\GoAopBridge\GoAopServiceProvider->Go\Laravel\GoAopBridge\{closure}(Object(Illuminate\Foundation\Application), Array)
#9 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#10 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('Go\\Core\\AspectC...')
#11 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('Go\\Core\\AspectC...')
#12 /var/www/vendor/goaop/goaop-laravel-bridge/src/GoAopServiceProvider.php(32): Illuminate\Foundation\Application->make('Go\\Core\\AspectC...')
#13 [internal function]: Go\Laravel\GoAopBridge\GoAopServiceProvider->boot()
#14 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#15 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#16 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#17 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#18 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(788): Illuminate\Container\Container->call(Array)
#19 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(771): Illuminate\Foundation\Application->bootProvider(Object(Go\Laravel\GoAopBridge\GoAopServiceProvider))
#20 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Go\Laravel\GoAopBridge\GoAopServiceProvider), 3)
#21 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(772): array_walk(Array, Object(Closure))
#22 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#23 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(208): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#24 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(162): Illuminate\Foundation\Application->bootstrapWith(Array)
#25 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(146): Illuminate\Foundation\Http\Kernel->bootstrap()
#26 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#27 /var/www/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#28 {main}

composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1",
        "ext-intl": "^1.1",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "^1.0",
        "illuminate/pipeline": "5.4.*",
        "illuminate/container": "5.4.*",
        "illuminate/support": "5.4.*",
        "barryvdh/laravel-cors": "^0.8.1",
        "webpatser/laravel-uuid": "2.*",
        "maatwebsite/excel": "~2.1.0",
        "doctrine/dbal": "^2.5",
        "intervention/image": "^2.3",
        "laravel/socialite": "^3.0",
        "google/apiclient": "^2.0",
        "socialiteproviders/manager": "^3.0",
        "socialiteproviders/microsoft-live": "^3.0",
        "socialiteproviders/microsoft-azure": "^3.0",
        "socialiteproviders/microsoft-graph": "^2.0@dev",
        "guzzlehttp/guzzle": "^6.0",
        "pusher/pusher-php-server": "^2.0",
        "goaop/framework": "^2",
        "goaop/goaop-laravel-bridge": "^1"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.7",
        "symfony/css-selector": "^3.1",
        "symfony/dom-crawler": "^3.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/",
            "Tests\\": "tests/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

Relevant parts composer.lock:

{
            "name": "goaop/framework",
            "version": "2.1.2",
            "source": {
                "type": "git",
                "url": "https://github.com/goaop/framework.git",
                "reference": "6e2a0fe13c1943db02a67588cfd27692bddaffa5"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/goaop/framework/zipball/6e2a0fe13c1943db02a67588cfd27692bddaffa5",
                "reference": "6e2a0fe13c1943db02a67588cfd27692bddaffa5",
                "shasum": ""
            },
            "require": {
                "doctrine/annotations": "~1.0",
                "goaop/parser-reflection": "~1.2",
                "jakubledl/dissect": "~1.0",
                "php": ">=5.6.0"
            },
            "require-dev": {
                "adlawson/vfs": "^0.12",
                "doctrine/orm": "^2.5",
                "phpunit/phpunit": "^4.8",
                "symfony/console": "^2.7|^3.0"
            },
            "suggest": {
                "symfony/console": "Enables the usage of the command-line tool."
            },
            "bin": [
                "bin/aspect"
            ],
            "type": "library",
            "extra": {
                "branch-alias": {
                    "dev-master": "2.0-dev"
                }
            },
            "autoload": {
                "psr-4": {
                    "Go\\": "src/"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Lisachenko Alexander",
                    "homepage": "https://github.com/lisachenko"
                }
            ],
            "description": "Framework for aspect-oriented programming in PHP.",
            "homepage": "http://go.aopphp.com/",
            "keywords": [
                "aop",
                "aspect",
                "library",
                "php"
            ],
            "time": "2017-07-12T11:46:25+00:00"
        },
        {
            "name": "goaop/goaop-laravel-bridge",
            "version": "1.0.1",
            "source": {
                "type": "git",
                "url": "https://github.com/goaop/goaop-laravel-bridge.git",
                "reference": "17142b79ae8b550ebd561235cae4c993f45018b2"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/goaop/goaop-laravel-bridge/zipball/17142b79ae8b550ebd561235cae4c993f45018b2",
                "reference": "17142b79ae8b550ebd561235cae4c993f45018b2",
                "shasum": ""
            },
            "require": {
                "goaop/framework": "^1.0|^2.0",
                "laravel/framework": "^5.0"
            },
            "type": "library",
            "autoload": {
                "psr-4": {
                    "Go\\Laravel\\GoAopBridge\\": "./src"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Lisachenko Alexander",
                    "email": "lisachenko.it@gmail.com"
                }
            ],
            "description": "Integration bridge for Go! AOP framework",
            "keywords": [
                "Bridge",
                "aop",
                "aspect",
                "laravel",
                "php"
            ],
            "time": "2016-05-14T12:58:04+00:00"
        },

After more investigation this seems to be related to some version of doctrine/x.
Diff in composer.lock can be found here: AEGEE/oms-neo-core@perm-aop...perm-aop-broken

Hope this helps :)

Hi, this need some kind of research. If you could provide reproducible example it will speed up fixing this issue.