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

NonNullType has been moved, but Loader is referencing to a old place #487

Closed
phpjob opened this issue Sep 11, 2024 · 1 comment
Closed
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@phpjob
Copy link
Contributor

phpjob commented Sep 11, 2024

Describe the bug

  • We upgraded from version ^2.9.0 to 3.0.0 and got an error in the console.

PHP Warning:  PHP Startup: Failed to open stream: No such file or directory in /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php on line 943
PHP Fatal error:  Uncaught Error: Failed opening required '/home/vendor/azjezz/psl/src/Psl/Type/Internal/NonNullType.php' (include_path='.:/usr/local/lib/php') in /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php:943
Stack trace:
#0 //vendor/azjezz/psl/src/Psl/Internal/Loader.php(954): Psl\Internal\Loader::load('Psl/Type/Intern...')
#1 [internal function]: Psl\Internal\Loader::Psl\Internal\{closure}('Psl\\Type\\NonNul...')
#2 /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php(1011): class_exists('Psl\\Type\\NonNul...')
#3 /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php(936): Psl\Internal\Loader::loadClasses()
#4 /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php(960): Psl\Internal\Loader::Psl\Internal\{closure}()
#5 /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php(932): Psl\Internal\Loader::autoload(Object(Closure))
#6 /home/vendor/azjezz/psl/src/preload.php(9): Psl\Internal\Loader::preload()
#7 /home/config/preload.php(7): require('/home/vend...')
#8 {main}
  thrown in /home/vendor/azjezz/psl/src/Psl/Internal/Loader.php on line 943

In commit https://github.com/azjezz/psl/commits/d68cd6be64a1fe7355fc02669cc6fa6440294799/src/Psl/Type/NonNullType.php
and PR #478 the type has been moved into the global "namespace".
But in the Loader only the namespace was updated, not the path. The loader has still a reference to a non existing file yet -> https://github.com/azjezz/psl/blob/3.0.0/src/Psl/Internal/Loader.php#L711C56-L711C67

A deep look

Expected behavior
NonNullType is loaded from the correct place.

Psl\\Type\\NonNullType' => 'Psl/Type/Internal/NonNullType.php', -> Psl\\Type\\NonNullType' => 'Psl/Type/NonNullType.php',

Environment (please complete the following information):

  • PHP version 8.3
  • Version 3.0.0

Additional context
Add any other context about the problem here.

@phpjob phpjob added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 11, 2024
@veewee
Copy link
Collaborator

veewee commented Sep 12, 2024

Thanks for reporting and fixing!
It's released under https://github.com/azjezz/psl/releases/tag/3.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

3 participants