Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitf321d35

Browse files
Revert "bug#33092 [DependencyInjection] Improve an exception message (fabpot)"
This reverts commit2f2d1aa, reversingchanges made to07cf927.
1 parenta944f29 commitf321d35

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

‎src/Symfony/Component/DependencyInjection/Compiler/ResolveClassPass.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@ public function process(ContainerBuilder $container)
2929
if ($definition->isSynthetic() ||null !==$definition->getClass()) {
3030
continue;
3131
}
32-
if (preg_match('/^\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/',$id)) {
32+
if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/',$id)) {
3333
if ($definitioninstanceof ChildDefinition && !class_exists($id)) {
3434
thrownewInvalidArgumentException(sprintf('Service definition "%s" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.',$id));
3535
}
36-
if ('\\' ===$id[0]) {
37-
thrownewInvalidArgumentException(sprintf('Service definition "%s" has no class, and its name looks like a FQCN but it starts with a backslash; remove the leading backslash.',$id));
38-
}
3936
$definition->setClass($id);
4037
}
4138
}

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveClassPassTest.php‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
useSymfony\Component\DependencyInjection\ChildDefinition;
1616
useSymfony\Component\DependencyInjection\Compiler\ResolveClassPass;
1717
useSymfony\Component\DependencyInjection\ContainerBuilder;
18-
useSymfony\Component\DependencyInjection\Exception\InvalidArgumentException;
1918
useSymfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
2019

2120
class ResolveClassPassTestextends TestCase
@@ -59,17 +58,6 @@ public function provideInvalidClassId()
5958
yield ['\DateTime'];
6059
}
6160

62-
publicfunctiontestWontResolveClassFromClassIdWithLeadingBackslash()
63-
{
64-
$this->expectException(InvalidArgumentException::class);
65-
$this->expectExceptionMessage('Service definition "\App\Some\Service" has no class, and its name looks like a FQCN but it starts with a backslash; remove the leading backslash.');
66-
67-
$container =newContainerBuilder();
68-
$container->register('\App\Some\Service');
69-
70-
(newResolveClassPass())->process($container);
71-
}
72-
7361
publicfunctiontestNonFqcnChildDefinition()
7462
{
7563
$container =newContainerBuilder();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp