Skip to content

fix: FileLocator::findQualifiedNameFromPath() behavior#8010

Merged
kenjis merged 3 commits into
codeigniter4:4.5from
kenjis:fix-FileLocator-findQualifiedNameFromPath
Oct 13, 2023
Merged

fix: FileLocator::findQualifiedNameFromPath() behavior#8010
kenjis merged 3 commits into
codeigniter4:4.5from
kenjis:fix-FileLocator-findQualifiedNameFromPath

Conversation

@kenjis

@kenjis kenjis commented Oct 6, 2023

Copy link
Copy Markdown
Member

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

kenjis added 2 commits October 6, 2023 10:30
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

@MGatner MGatner left a comment

Copy link
Copy Markdown
Member

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

kenjis commented Oct 13, 2023

Copy link
Copy Markdown
Member Author

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
@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

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