Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Resolve modules using PHP 5.5 ::class #5

Closed
wants to merge 4 commits into from
Closed

Resolve modules using PHP 5.5 ::class #5

wants to merge 4 commits into from

Conversation

Maks3w
Copy link
Member

@Maks3w Maks3w commented Sep 14, 2015

This is a proposal for use PHP 5.5 ::class feature for module names. [modules => [FooModule::class]]

Current behavior of append "\Module" at the end of the string could be deprecated.

1 test is failing due a restriction in ModuleAutoloader for only autoload FQCN ended by "\Module"

@danizord
Copy link

👍

@weierophinney
Copy link
Member

@Maks3w Do you have a corresponding PR on zend-loader for the changes necessary to the ModuleAutoloader? We could release that in a bugfix, and then add a version constraint to composer.json in this patch.

weierophinney added a commit that referenced this pull request Jul 11, 2017
- Needed to autoload the `ListenerTestModule` namespace.
- Needed to import that same namespace into the test case.
weierophinney added a commit that referenced this pull request Jul 11, 2017
weierophinney added a commit that referenced this pull request Jul 11, 2017
@weierophinney
Copy link
Member

Thanks, @Maks3w; merged to develop for release with 2.8.0.

weierophinney added a commit to weierophinney/zend-modulemanager that referenced this pull request Nov 1, 2017
…module

Per zendframework#5, non-namespaced classes can create issues within applications if
they conflict with a module. In particular, `Generator` is one (as the
class is non-instantiable via `new`), but this can also happen in legacy
applications where a new module may exist under the same name as a
defined class.

This patch adds tests to ensure that the resolver prefers `Module`
classes if they exist, and never loads known uninstantiable classes that
always exist (specifically, `Generator`).
@sufiyanpk7 sufiyanpk7 mentioned this pull request Jun 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants