Skip to content
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

Uncaught Error: Typed property Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken::$context must not be accessed before initialization #1411

Closed
mrsamse opened this issue Apr 19, 2024 · 3 comments

Comments

@mrsamse
Copy link

mrsamse commented Apr 19, 2024

Yesterday I updated my php version to 8.3.6 and now I get the following error message:

Uncaught Error: Typed property Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken::$context must not be accessed before initialization in /vendor/qossmic/deptrac/src/Core/Dependency/Emitter/ClassDependencyEmitter.php

OS version: macOS Sonoma 14.4.1

deptrac version: 2.0.0.beta

PHP version: 8.3.6

If I switch back to php version 8.2.18 it works fine.

@mrsamse
Copy link
Author

mrsamse commented Apr 19, 2024

Side note: I also get a lot of deprecated errors:

Deprecated: Creation of dynamic property Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken::$type is deprecated in /vendor/qossmic/deptrac/src/Core/Ast/Parser/Cache/AstFileReferenceFileCache.php

@mrsamse mrsamse changed the title Uncaught Error: Typed property Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken::$context Uncaught Error: Typed property Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken::$context must not be accessed before initialization Apr 19, 2024
@xabbuh
Copy link
Member

xabbuh commented Apr 19, 2024

Does the error go away if you purge the Deptrac cache? I guess it is related to the unserialization here: 5da9063#diff-5bc528256de0b49467ca4973847c042aac17273c894a2993cd88df523a538f11

@mrsamse
Copy link
Author

mrsamse commented Apr 19, 2024

@xabbuh Yes, it works with php 8.3.6, if I execute the command vendor/bin/deptrac --clear-cache

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants