Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b6928d

Browse filesBrowse files
committed
bug #22657 [DI] Fix Cannot declare class ...\DefinitionDecorator, because the name is already in use (ogizanagi)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Fix Cannot declare class ...\DefinitionDecorator, because the name is already in use | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21369 | License | MIT | Doc PR | N/A The `return` trick doesn't seem to work, and php is still trying to declare the `DefinitionDecorator` class, which causes the "Cannot declare class ...\DefinitionDecorator, because the name is already in use" error because of the `class_alias` previously declared in `ChildDefinition.php`. This never happens as soon as the `ChildDefinition` class is used first, as the alias will take hand, but their are some situations, like in some unit test cases it can happen apparently, because `DefinitionDecorator` is used first. Commits ------- 530849e [DI] Fix Cannot declare class ...\DefinitionDecorator, because the name is already in use
2 parents e5bb8fa + 530849e commit 5b6928d
Copy full SHA for 5b6928d

File tree

1 file changed

+11
-11
lines changed
Filter options

1 file changed

+11
-11
lines changed

‎src/Symfony/Component/DependencyInjection/DefinitionDecorator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/DefinitionDecorator.php
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515

1616
class_exists(ChildDefinition::class);
1717

18-
return;
19-
20-
/**
21-
* This definition decorates another definition.
22-
*
23-
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
24-
*
25-
* @deprecated The DefinitionDecorator class is deprecated since version 3.3 and will be removed in 4.0. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.
26-
*/
27-
class DefinitionDecorator extends Definition
28-
{
18+
if (false) {
19+
/**
20+
* This definition decorates another definition.
21+
*
22+
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
23+
*
24+
* @deprecated The DefinitionDecorator class is deprecated since version 3.3 and will be removed in 4.0. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.
25+
*/
26+
class DefinitionDecorator extends Definition
27+
{
28+
}
2929
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.