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

fix: FileLocator::findQualifiedNameFromPath() behavior #8010

Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Oct 6, 2023

Description

  • With this PR, FileLocator::findQualifiedNameFromPath() returns a FQCN without leading \

FQCN should not start with \.
get_class() of ::class returns FQCN without leading \.
The following code does not work as expected.:

$class = FileLocator::findQualifiedNameFromPath(...);
if ($class === Foo::class) {
    // do something
}

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

FQCN should not start with “\".
::class returns FQCN without leading "\".
@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them breaking change Pull requests that may break existing functionalities 4.5 labels Oct 6, 2023
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion this is a bug and could be directed at develop.

@kenjis
Copy link
Member Author

kenjis commented Oct 13, 2023

However, it is a breaking change and not urgent.
I will backport to 4.4 if there are many opinions that it should be fixed.

@kenjis kenjis merged commit 5210e5e into codeigniter4:4.5 Oct 13, 2023
54 checks passed
@kenjis kenjis deleted the fix-FileLocator-findQualifiedNameFromPath branch October 13, 2023 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants