Skip to content

Commit 24a3812

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: [FrameworkBundle] Set default public directory on install assets [Security] Fix wrong term in UserProviderInterface [HttpFoundation] Set meta refresh time to 0 in RedirectResponse content disable inlining deprecated services [Cache] add constructor docblocks for clarity [WebServerBundle] allowed public/ root directory to be auto-discovered along side web/ [WebServerBundle] remove duplicate code [SecurityBundle] Clarify deprecation in UserPasswordEncoderCommand::getContainer [Cache] add constructor docblocks for clarity [Security] validate empty passwords again [DI] Remove irrelevant comment from container [TwigBridge] cleaner implementation of the TwigRenderer
2 parents 1309253 + 761e51a commit 24a3812

File tree

5 files changed

+50
-13
lines changed

5 files changed

+50
-13
lines changed

Compiler/InlineServiceDefinitionsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
8282
return true;
8383
}
8484

85-
if ($definition->isPublic() || $definition->isLazy()) {
85+
if ($definition->isDeprecated() || $definition->isPublic() || $definition->isLazy()) {
8686
return false;
8787
}
8888

Container.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@
2828
*
2929
* Parameter and service keys are case insensitive.
3030
*
31-
* A service id can contain lowercased letters, digits, underscores, and dots.
32-
* Underscores are used to separate words, and dots to group services
33-
* under namespaces:
34-
*
35-
* <ul>
36-
* <li>request</li>
37-
* <li>mysql_session_storage</li>
38-
* <li>symfony.mysql_session_storage</li>
39-
* </ul>
40-
*
4131
* A service can also be defined by creating a method named
4232
* getXXXService(), where XXX is the camelized version of the id:
4333
*

Tests/ContainerBuilderTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,27 @@ public function testRegisterForAutoconfiguration()
10821082
// when called multiple times, the same instance is returned
10831083
$this->assertSame($childDefA, $container->registerForAutoconfiguration('AInterface'));
10841084
}
1085+
1086+
/**
1087+
* This test checks the trigger of a deprecation note and should not be removed in major releases.
1088+
*
1089+
* @group legacy
1090+
* @expectedDeprecation The "foo" service is deprecated. You should stop using it, as it will soon be removed.
1091+
*/
1092+
public function testPrivateServiceTriggersDeprecation()
1093+
{
1094+
$container = new ContainerBuilder();
1095+
$container->register('foo', 'stdClass')
1096+
->setPublic(false)
1097+
->setDeprecated(true);
1098+
$container->register('bar', 'stdClass')
1099+
->setPublic(true)
1100+
->setProperty('foo', new Reference('foo'));
1101+
1102+
$container->compile();
1103+
1104+
$container->get('bar');
1105+
}
10851106
}
10861107

10871108
class FooClass

Tests/ContainerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ public function testGetLegacyServiceIds()
165165
public function testSet()
166166
{
167167
$sc = new Container();
168-
$sc->set('foo', $foo = new \stdClass());
169-
$this->assertSame($foo, $sc->get('foo'), '->set() sets a service');
168+
$sc->set('._. \\o/', $foo = new \stdClass());
169+
$this->assertSame($foo, $sc->get('._. \\o/'), '->set() sets a service');
170170
}
171171

172172
public function testSetWithNullResetTheService()

Tests/Dumper/PhpDumperTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,4 +612,30 @@ public function testDumpHandlesLiteralClassWithRootNamespace()
612612

613613
$this->assertInstanceOf('stdClass', $container->get('foo'));
614614
}
615+
616+
/**
617+
* This test checks the trigger of a deprecation note and should not be removed in major releases.
618+
*
619+
* @group legacy
620+
* @expectedDeprecation The "foo" service is deprecated. You should stop using it, as it will soon be removed.
621+
*/
622+
public function testPrivateServiceTriggersDeprecation()
623+
{
624+
$container = new ContainerBuilder();
625+
$container->register('foo', 'stdClass')
626+
->setPublic(false)
627+
->setDeprecated(true);
628+
$container->register('bar', 'stdClass')
629+
->setPublic(true)
630+
->setProperty('foo', new Reference('foo'));
631+
632+
$container->compile();
633+
634+
$dumper = new PhpDumper($container);
635+
eval('?>'.$dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Private_Service_Triggers_Deprecation')));
636+
637+
$container = new \Symfony_DI_PhpDumper_Test_Private_Service_Triggers_Deprecation();
638+
639+
$container->get('bar');
640+
}
615641
}

0 commit comments

Comments
 (0)