-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Aspect breaks when certain class' constructor injects classes #8
Comments
Hi! Unfortunately, from your comment it isn't clear how to detect what is the root cause for this strange behaviour. Only possible glitch if you try to use advised service in the aspect. There is an issue for Symfony: goaop/goaop-symfony-bundle#15 about circular references. Maybe this case is also applied to the Laravel itself. Regarding your question about cache invalidation - it triggered automatically in the dev mode when file is changed. However, if some method is declared in parent classes and you advise it in children classes, then children classes won't be automatically updated and can lead to manual cleaning of the cache.
|
I see, thanks for the response. I managed to work around this by using |
So, is it working now for you? |
Yup, with the workaround. |
Ok, let's keep this open, maybe I will be able to reproduce it somehow and prepare a fix for that. |
thanks! 👍 |
I have this function in
AuditAspect
It's supposed to intercept
public function create(array $data)
inclass PositionRepository extends Repository
(Repository
extendsOptimus\Genie\Repository
)In
AuditService
's constructor, I have the followingThe
repositoryCreate()
function fail to be executed when a*Repository->create()
function is executed.Removing
Position $positionService
in the constructor parameter and$this->positionService = $positionService
in the constructor body (and deleting the_transformation.cache
file) will makerepositoryCreate()
work again.Not sure if this would help, but here are the cache files
With the lines in
AuditService
constructorWithout the lines:
Also, unrelated question: How is the
_transformation.cache
file (re)generated? Sometimes when I add new code, anOutOfBoundsException
will be thrown:Value aspect.Infrastructure\Aspects\AuditAspect is not defined in the container in /var/www/laravel/vendor/goaop/framework/src/Core/Container.php:84
the only way to fix this is to delete the cache file.
The text was updated successfully, but these errors were encountered: