Bug #59031

Broken Reflection behavior on class-/filename mismatch

Added by Bastian Waidelich over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Must have
Category:
Reflection
Target version:
-
Start date:
2014-05-22
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

When a PHP class is not named exactly like the corresponding file, weird things happen:
  • If only the case doesn't match (e.g. "someclass" vs "SomeClass") the class is reflected but weird side effects happen during "runtime"
  • If the class name is different (e.g. "SomeClass" vs "SomeRenamedClass") the ReflectionService currently "silently" skips the class

Depending on what class is affected this can lead to a "Cannot redeclare class" error:

#1355480641:
Fatal error: Cannot redeclare class Some\Package\Domain\Model\SomeEntity in Packages/Application/Some.Package/Classes/Some/Package/Domain/Model/RenamedEntity.php on line xx


Files

59031_cli.png (64 KB) 59031_cli.png Bastian Waidelich, 2014-05-22 14:58
59031_web.png (40.7 KB) 59031_web.png Bastian Waidelich, 2014-05-22 14:58
#1

Updated by Bastian Waidelich over 7 years ago

Fix of the ReflectionService leads to following exception:
CLI:

Web:

#2

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/30332

#3

Updated by Gerrit Code Review about 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/30332

#4

Updated by Gerrit Code Review about 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/30332

#5

Updated by Bastian Waidelich almost 7 years ago

  • Status changed from Under Review to Closed

Also available in: Atom PDF