Bug #52944
Generating correct proxy classes for classes without a namespace
Status: | Resolved | Start date: | 2013-10-18 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | - | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Git master |
Description
When packages (that are loaded with composer to Libraries) containing classes without a namespace, Flow generates a corrupt proxy class.
class FooClass_Original { } namespace ; // empty namespace causing error // Parse error: syntax error, unexpected ';', expecting T_STRING or T_NS_SEPARATOR or '{' in [filename] class FooClass { // proxy class }
Related issues
Associated revisions
[BUGFIX] Classes without namespace create invalid proxy code
This change makes classes without namespace create proper proxy
class code, by optionally skipping the namespace declaration.
Before such classes would create an empty namespace statement,
which resulted in syntax errors, i.e.::
namespace ;
=> "syntax error, unexpected ';', expecting T_STRING or
T_NS_SEPARATOR or '{' in [filename]"
Change-Id: Ia7130b24ab149f00ac318c809c698db7c20934cb
Fixes: #52944
Releases: master, 2.0
[BUGFIX] Classes without namespace create invalid proxy code
This change makes classes without namespace create proper proxy
class code, by optionally skipping the namespace declaration.
Before such classes would create an empty namespace statement,
which resulted in syntax errors, i.e.::
namespace ;
=> "syntax error, unexpected ';', expecting T_STRING or
T_NS_SEPARATOR or '{' in [filename]"
Change-Id: Ia7130b24ab149f00ac318c809c698db7c20934cb
Fixes: #52944
Releases: master, 2.0
[BUGFIX] Classes without namespace create invalid proxy code
This change makes classes without namespace create proper proxy
class code, by optionally skipping the namespace declaration.
Before such classes would create an empty namespace statement,
which resulted in syntax errors, i.e.::
namespace ;
=> "syntax error, unexpected ';', expecting T_STRING or
T_NS_SEPARATOR or '{' in [filename]"
Change-Id: Ia7130b24ab149f00ac318c809c698db7c20934cb
Fixes: #52944
Releases: master, 2.1, 2.0
History
#1 Updated by Philipp Maier almost 2 years ago
A real example would be this:
https://gist.github.com/hfrahmann/7037897#file-flow-cache-chromephp-php-L15
#2 Updated by Alexander Berl almost 2 years ago
Should be trivial to fix with an if condition. See Object/Proxy/ProxyClass::render() line 195 ff.:
$classCode =
"namespace $namespace;\n" .
#3 Updated by Gerrit Code Review almost 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24904
#4 Updated by Gerrit Code Review almost 2 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24904
#5 Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/24904
#6 Updated by Alexander Berl over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9352bf3f8d582091dc0ba432c50c31b1ae917e25.
#7 Updated by Gerrit Code Review over 1 year ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 2.0 of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/26799
#8 Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 2.1 of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/26871
#9 Updated by Alexander Berl about 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset 649c3fa310aa6dad60e6d4a14b36532ac4772f42.