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

Fixed namespace generation in FactoryCreator utility #133

Merged
merged 2 commits into from
Jun 13, 2022

Conversation

adambalint-srg
Copy link
Contributor

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

In FactoryCreator's createFactory method the namespace of the class has been built with str_replace. This method worked for this kind of classes: Foo\Bar\Service, but the generated namespace was wrong in case of this kind of classes: Foo\Service\Bar\Service, because namespace contains the class name too.

FQCN Generated namespace
Foo\Bar\Service Foo\Bar
Foo\Service\Bar\Service Foo\Bar

With preg_replace it is possible to cut off only the last part of the FQCN.

…amespaces which contains class name

Signed-off-by: Ádám Bálint <adam.balint@srg.hu>
Signed-off-by: Ádám Bálint <adam.balint@srg.hu>
@adambalint-srg adambalint-srg changed the title Fix factory namespace Fixed namespace generation in FactoryCreator Jun 3, 2022
@froschdesign froschdesign added Bug Something isn't working labels Jun 7, 2022
@froschdesign froschdesign modified the milestone: 3.11.3 Jun 7, 2022
@Ocramius Ocramius self-assigned this Jun 13, 2022
@Ocramius Ocramius changed the base branch from 3.11.x to 3.12.x June 13, 2022 16:12
@Ocramius Ocramius changed the base branch from 3.12.x to 3.11.x June 13, 2022 16:12
@Ocramius Ocramius changed the title Fixed namespace generation in FactoryCreator Fixed namespace generation in FactoryCreator utility Jun 13, 2022
@Ocramius Ocramius merged commit 1f22314 into laminas:3.11.x Jun 13, 2022
@Ocramius
Copy link
Member

Thanks @adambalint-srg!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants