framework icon indicating copy to clipboard operation
framework copied to clipboard

Uncaught Error: Typed property Go\Aop\Framework\AbstractInterceptor::$adviceOrder must not be accessed before initialization in /var/www/html/app/vendor/goaop/framework/src/Aop/Framework/AbstractInterceptor.php

Open gibrankasif opened this issue 2 years ago • 1 comments

Hi recently I updated the library from v2.3.5 to v3.0.0, while taking note of the breaking changes in the ChangeLog, I came to experience an error that doesn't seem to trace to any of the breaking changes mentioned. Here's the exact error which comes up: PHP message: PHP Fatal error: Uncaught Error: Typed property Go\Aop\Framework\AbstractInterceptor::$adviceOrder must not be accessed before initialization in /var/www/html/app/vendor/goaop/framework/src/Aop/Framework/AbstractInterceptor.php:119 Stack trace: #0 /var/www/html/app/vendor/goaop/framework/src/Aop/Framework/AbstractJoinpoint.php(95): Go\Aop\Framework\AbstractInterceptor->getAdviceOrder() #1 [internal function]: Go\Aop\Framework\AbstractJoinpoint::Go\Aop\Framework\{closure}() #2 /var/www/html/app/vendor/goaop/framework/src/Aop/Framework/AbstractJoinpoint.php(100): uasort() #3 /var/www/html/app/vendor/goaop/framework/src/Aop/Framework/AbstractJoinpoint.php(116): Go\Aop\Framework\AbstractJoinpoint::sortAdvices() #4 /var/www/html/app/vendor/goaop/framework/src/Instrument/Transformer/WeavingTransformer.php(142): Go\Aop\Framework\AbstractJoinpoint::flatAndSortAdvices() #5 /var/www/html/app/vendor/goaop/framework/src/Instrument/Transformer/WeavingTransformer.php(106): Go\Instrument\Transforme

Any clue if there is another breaking change that needs to be looked out for?

gibrankasif avatar Apr 14 '22 19:04 gibrankasif

I got a similar issue:

Error: Typed property Go\Aop\Framework\AbstractMethodInvocation::$instance must not be accessed before initialization in vendor/goaop/framework/src/Aop/Framework/AbstractMethodInvocation.php:77

This could be resolved by changing AbstractMethodInvocation.php:30 from

protected ?object $instance;

to

protected ?object $instance = null;

daniel-sc avatar Jun 10 '23 11:06 daniel-sc