Skip to content

Commit 649e2cd

Browse files
committed
Merge branch '3.2' into 3.3
* 3.2: [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 [Security] validate empty passwords again [DI] Remove irrelevant comment from container [TwigBridge] cleaner implementation of the TwigRenderer
2 parents 80efd8f + d3ca508 commit 649e2cd

File tree

16 files changed

+135
-23
lines changed

16 files changed

+135
-23
lines changed

src/Symfony/Bridge/Twig/Form/TwigRenderer.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,26 @@
2020
*/
2121
class TwigRenderer extends FormRenderer implements TwigRendererInterface
2222
{
23-
/**
24-
* @var TwigRendererEngineInterface
25-
*/
26-
private $engine;
27-
2823
public function __construct(TwigRendererEngineInterface $engine, CsrfTokenManagerInterface $csrfTokenManager = null)
2924
{
3025
parent::__construct($engine, $csrfTokenManager);
26+
}
3127

32-
$this->engine = $engine;
28+
/**
29+
* Returns the engine used by this renderer.
30+
*
31+
* @return TwigRendererEngineInterface The renderer engine
32+
*/
33+
public function getEngine()
34+
{
35+
return parent::getEngine();
3336
}
3437

3538
/**
3639
* {@inheritdoc}
3740
*/
3841
public function setEnvironment(Environment $environment)
3942
{
40-
$this->engine->setEnvironment($environment);
43+
$this->getEngine()->setEnvironment($environment);
4144
}
4245
}

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
3232
private $createCacheItem;
3333
private $mergeByLifetime;
3434

35+
/**
36+
* @var int|null The maximum length to enforce for identifiers or null when no limit applies
37+
*/
38+
protected $maxIdLength;
39+
40+
/**
41+
* @param string $namespace
42+
* @param int $defaultLifetime
43+
*/
3544
protected function __construct($namespace = '', $defaultLifetime = 0)
3645
{
3746
$this->namespace = '' === $namespace ? '' : $this->getId($namespace).':';
@@ -74,6 +83,15 @@ function ($deferred, $namespace, &$expiredIds) {
7483
);
7584
}
7685

86+
/**
87+
* @param string $namespace
88+
* @param int $defaultLifetime
89+
* @param string $version
90+
* @param string $directory
91+
* @param LoggerInterface|null $logger
92+
*
93+
* @return AdapterInterface
94+
*/
7795
public static function createSystemCache($namespace, $defaultLifetime, $version, $directory, LoggerInterface $logger = null)
7896
{
7997
if (null === self::$apcuSupported) {

src/Symfony/Component/Cache/Adapter/ApcuAdapter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ class ApcuAdapter extends AbstractAdapter
1717
{
1818
use ApcuTrait;
1919

20+
/**
21+
* @param string $namespace
22+
* @param int $defaultLifetime
23+
* @param string|null $version
24+
*
25+
* @throws CacheException if APCu is not enabled
26+
*/
2027
public function __construct($namespace = '', $defaultLifetime = 0, $version = null)
2128
{
2229
$this->init($namespace, $defaultLifetime, $version);

src/Symfony/Component/Cache/Adapter/DoctrineAdapter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ class DoctrineAdapter extends AbstractAdapter
1818
{
1919
use DoctrineTrait;
2020

21+
/**
22+
* @param CacheProvider $provider
23+
* @param string $namespace
24+
* @param int $defaultLifetime
25+
*/
2126
public function __construct(CacheProvider $provider, $namespace = '', $defaultLifetime = 0)
2227
{
2328
parent::__construct('', $defaultLifetime);

src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class FilesystemAdapter extends AbstractAdapter
1717
{
1818
use FilesystemTrait;
1919

20+
/**
21+
* @param string $namespace
22+
* @param int $defaultLifetime
23+
* @param string|null $directory
24+
*/
2025
public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
2126
{
2227
parent::__construct('', $defaultLifetime);

src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ class PhpFilesAdapter extends AbstractAdapter
1818
{
1919
use PhpFilesTrait;
2020

21+
/**
22+
* @param string $namespace
23+
* @param int $defaultLifetime
24+
* @param string|null $directory
25+
*
26+
* @throws CacheException if OPcache is not enabled
27+
*/
2128
public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
2229
{
2330
if (!static::isSupported()) {

src/Symfony/Component/Cache/Adapter/ProxyAdapter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ class ProxyAdapter implements AdapterInterface
2626
private $createCacheItem;
2727
private $poolHash;
2828

29+
/**
30+
* @param CacheItemPoolInterface $pool
31+
* @param string $namespace
32+
* @param int $defaultLifetime
33+
*/
2934
public function __construct(CacheItemPoolInterface $pool, $namespace = '', $defaultLifetime = 0)
3035
{
3136
$this->pool = $pool;

src/Symfony/Component/DependencyInjection/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

src/Symfony/Component/DependencyInjection/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
*

src/Symfony/Component/DependencyInjection/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

0 commit comments

Comments
 (0)