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 068f8d1

Browse filesBrowse files
Merge branch '3.3' into 3.4
* 3.3: Fix optional cache warmers are always instantiated whereas they should be lazy-loaded add some \ on PHP_VERSION_ID for 2.8 [Di] Remove closure-proxy arguments [PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string
2 parents d7ec7e8 + 4ad0dbf commit 068f8d1
Copy full SHA for 068f8d1

File tree

75 files changed

+125
-785
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

75 files changed

+125
-785
lines changed

‎UPGRADE-3.3.md

Copy file name to clipboardExpand all lines: UPGRADE-3.3.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ EventDispatcher
127127
---------------
128128

129129
* The `ContainerAwareEventDispatcher` class has been deprecated.
130-
Use `EventDispatcher` with closure-proxy injection instead.
130+
Use `EventDispatcher` with closure factories instead.
131131

132132
Finder
133133
------

‎UPGRADE-4.0.md

Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ EventDispatcher
134134
---------------
135135

136136
* The `ContainerAwareEventDispatcher` class has been removed.
137-
Use `EventDispatcher` with closure-proxy injection instead.
137+
Use `EventDispatcher` with closure factories instead.
138138

139139
ExpressionLanguage
140140
------------------

‎src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ private function getPhpType($doctrineType)
174174
{
175175
switch ($doctrineType) {
176176
case DBALType::SMALLINT:
177-
case DBALType::BIGINT:
178177
case DBALType::INTEGER:
179178
return Type::BUILTIN_TYPE_INT;
180179

181180
case DBALType::FLOAT:
182181
return Type::BUILTIN_TYPE_FLOAT;
183182

183+
case DBALType::BIGINT:
184184
case DBALType::STRING:
185185
case DBALType::TEXT:
186186
case DBALType::GUID:
@@ -196,9 +196,6 @@ private function getPhpType($doctrineType)
196196

197197
case DBALType::OBJECT:
198198
return Type::BUILTIN_TYPE_OBJECT;
199-
200-
default:
201-
return;
202199
}
203200
}
204201
}

‎src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function testGetProperties()
5555
'bool',
5656
'binary',
5757
'customFoo',
58+
'bigint',
5859
'foo',
5960
'bar',
6061
'indexedBar',
@@ -76,6 +77,7 @@ public function typesProvider()
7677
return array(
7778
array('id', array(new Type(Type::BUILTIN_TYPE_INT))),
7879
array('guid', array(new Type(Type::BUILTIN_TYPE_STRING))),
80+
array('bigint', array(new Type(Type::BUILTIN_TYPE_STRING))),
7981
array('float', array(new Type(Type::BUILTIN_TYPE_FLOAT))),
8082
array('decimal', array(new Type(Type::BUILTIN_TYPE_STRING))),
8183
array('bool', array(new Type(Type::BUILTIN_TYPE_BOOL))),

‎src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures;
1313

14+
use Doctrine\ORM\Mapping as ORM;
1415
use Doctrine\ORM\Mapping\Column;
1516
use Doctrine\ORM\Mapping\Entity;
1617
use Doctrine\ORM\Mapping\Id;
@@ -90,5 +91,10 @@ class DoctrineDummy
9091
*/
9192
private $customFoo;
9293

94+
/**
95+
* @Column(type="bigint")
96+
*/
97+
private $bigint;
98+
9399
public $notMapped;
94100
}

‎src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getHtmlCallGraph()
9696
public function getProfile()
9797
{
9898
if (null === $this->profile) {
99-
if (PHP_VERSION_ID >= 70000) {
99+
if (\PHP_VERSION_ID >= 70000) {
100100
$this->profile = unserialize($this->data['profile'], array('allowed_classes' => array('Twig_Profiler_Profile', 'Twig\Profiler\Profile')));
101101
} else {
102102
$this->profile = unserialize($this->data['profile']);

‎src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testOneVar()
8686

8787
EOTXT;
8888

89-
if (PHP_VERSION_ID >= 70000) {
89+
if (\PHP_VERSION_ID >= 70000) {
9090
$expected = preg_replace('/%(.*?)%/', '($context["$1"] ?? null)', $expected);
9191
} else {
9292
$expected = preg_replace('/%(.*?)%/', '(isset($context["$1"]) ? $context["$1"] : null)', $expected);

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ClassCacheCacheWarmer implements CacheWarmerInterface
2727

2828
public function __construct(array $declaredClasses = null)
2929
{
30-
if (PHP_VERSION_ID >= 70000) {
30+
if (\PHP_VERSION_ID >= 70000) {
3131
@trigger_error('The '.__CLASS__.' class is deprecated since version 3.3 and will be removed in 4.0.', E_USER_DEPRECATED);
3232
}
3333

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php
+20-2Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\CacheWarmer;
1313

14+
use Symfony\Component\DependencyInjection\ContainerInterface;
1415
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1516
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
1617
use Symfony\Component\Translation\TranslatorInterface;
@@ -22,18 +23,35 @@
2223
*/
2324
class TranslationsCacheWarmer implements CacheWarmerInterface
2425
{
26+
private $container;
2527
private $translator;
2628

27-
public function __construct(TranslatorInterface $translator)
29+
/**
30+
* TranslationsCacheWarmer constructor.
31+
*
32+
* @param ContainerInterface|TranslatorInterface $container
33+
*/
34+
public function __construct($container)
2835
{
29-
$this->translator = $translator;
36+
// As this cache warmer is optional, dependencies should be lazy-loaded, that's why a container should be injected.
37+
if ($container instanceof ContainerInterface) {
38+
$this->container = $container;
39+
} elseif ($container instanceof TranslatorInterface) {
40+
$this->translator = $container;
41+
} else {
42+
throw new \InvalidArgumentException(sprintf('%s only accepts instance of Symfony\Component\DependencyInjection\ContainerInterface or Symfony\Component\Translation\TranslatorInterface as first argument.', __CLASS__));
43+
}
3044
}
3145

3246
/**
3347
* {@inheritdoc}
3448
*/
3549
public function warmUp($cacheDir)
3650
{
51+
if (null === $this->translator) {
52+
$this->translator = $this->container->get('translator');
53+
}
54+
3755
if ($this->translator instanceof WarmableInterface) {
3856
$this->translator->warmUp($cacheDir);
3957
}

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ protected function formatClosure(\Closure $closure)
312312
{
313313
$r = new \ReflectionFunction($closure);
314314

315-
if (preg_match('#^/\*\* @closure-proxy ([^: ]++)::([^: ]++) \*/$#', $r->getDocComment(), $m)) {
316-
return sprintf('%s::%s', $m[1], $m[2]);
317-
}
318-
319315
return 'closure';
320316
}
321317
}

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Console\Helper\Table;
1515
use Symfony\Component\Console\Style\SymfonyStyle;
1616
use Symfony\Component\DependencyInjection\Alias;
17-
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
1817
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1918
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
2019
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -344,9 +343,6 @@ protected function describeContainerDefinition(Definition $definition, array $op
344343
$argumentsInformation[] = sprintf('Service(%s)', (string) $argument);
345344
} elseif ($argument instanceof IteratorArgument) {
346345
$argumentsInformation[] = sprintf('Iterator (%d element(s))', count($argument->getValues()));
347-
} elseif ($argument instanceof ClosureProxyArgument) {
348-
list($reference, $method) = $argument->getValues();
349-
$argumentsInformation[] = sprintf('ClosureProxy(Service(%s)::%s())', $reference, $method);
350346
} elseif ($argument instanceof Definition) {
351347
$argumentsInformation[] = 'Inlined Service';
352348
} else {

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
1313

1414
use Symfony\Component\DependencyInjection\Alias;
15-
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
1615
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1716
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
1817
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -444,11 +443,6 @@ private function getArgumentNodes(array $arguments, \DOMDocument $dom)
444443
foreach ($this->getArgumentNodes($argument->getValues(), $dom) as $childArgumentXML) {
445444
$argumentXML->appendChild($childArgumentXML);
446445
}
447-
} elseif ($argument instanceof ClosureProxyArgument) {
448-
list($reference, $method) = $argument->getValues();
449-
$argumentXML->setAttribute('type', 'closure-proxy');
450-
$argumentXML->setAttribute('id', (string) $reference);
451-
$argumentXML->setAttribute('method', $method);
452446
} elseif ($argument instanceof Definition) {
453447
$argumentXML->appendChild($dom->importNode($this->getContainerDefinitionDocument($argument, null, false, true)->childNodes->item(0), true));
454448
} elseif (is_array($argument)) {

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function load(array $configs, ContainerBuilder $container)
105105
$definition->setArguments(array());
106106
}
107107

108-
if (PHP_VERSION_ID < 70000) {
108+
if (\PHP_VERSION_ID < 70000) {
109109
$definition = $container->getDefinition('kernel.class_cache.cache_warmer');
110110
$definition->addTag('kernel.cache_warmer');
111111
// Ignore deprecation for PHP versions below 7.0
@@ -298,7 +298,7 @@ public function load(array $configs, ContainerBuilder $container)
298298
$container->registerForAutoconfiguration(ObjectInitializerInterface::class)
299299
->addTag('validator.initializer');
300300

301-
if (PHP_VERSION_ID < 70000) {
301+
if (\PHP_VERSION_ID < 70000) {
302302
$this->addClassesToCompile(array(
303303
'Symfony\\Component\\Config\\ConfigCache',
304304
'Symfony\\Component\\Config\\FileLocator',
@@ -683,7 +683,7 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
683683
$container->setParameter('request_listener.http_port', $config['http_port']);
684684
$container->setParameter('request_listener.https_port', $config['https_port']);
685685

686-
if (PHP_VERSION_ID < 70000) {
686+
if (\PHP_VERSION_ID < 70000) {
687687
$this->addClassesToCompile(array(
688688
'Symfony\\Component\\Routing\\Generator\\UrlGenerator',
689689
'Symfony\\Component\\Routing\\RequestContext',
@@ -734,7 +734,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
734734

735735
$container->setParameter('session.save_path', $config['save_path']);
736736

737-
if (PHP_VERSION_ID < 70000) {
737+
if (\PHP_VERSION_ID < 70000) {
738738
$this->addClassesToCompile(array(
739739
'Symfony\\Component\\HttpKernel\\EventListener\\SessionListener',
740740
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage',
@@ -819,7 +819,7 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
819819
$container->setDefinition('templating.loader', $loaderCache);
820820
}
821821

822-
if (PHP_VERSION_ID < 70000) {
822+
if (\PHP_VERSION_ID < 70000) {
823823
$this->addClassesToCompile(array(
824824
'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables',
825825
'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference',
@@ -859,7 +859,7 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
859859
$container->setAlias('debug.templating.engine.php', 'templating.engine.php');
860860
}
861861

862-
if (PHP_VERSION_ID < 70000) {
862+
if (\PHP_VERSION_ID < 70000) {
863863
$this->addClassesToCompile(array(
864864
'Symfony\\Component\\Templating\\Storage\\FileStorage',
865865
'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine',
@@ -1200,7 +1200,7 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
12001200
$definition = $container->findDefinition('annotations.cache_warmer');
12011201
$definition->addTag('kernel.cache_warmer');
12021202

1203-
if (PHP_VERSION_ID < 70000) {
1203+
if (\PHP_VERSION_ID < 70000) {
12041204
$this->addClassesToCompile(array(
12051205
'Symfony\Component\Cache\Adapter\PhpArrayAdapter',
12061206
'Symfony\Component\Cache\DoctrineProvider',
@@ -1457,7 +1457,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
14571457
}
14581458
}
14591459

1460-
if (PHP_VERSION_ID < 70000) {
1460+
if (\PHP_VERSION_ID < 70000) {
14611461
$this->addClassesToCompile(array(
14621462
'Symfony\Component\Cache\Adapter\ApcuAdapter',
14631463
'Symfony\Component\Cache\Adapter\FilesystemAdapter',

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<service id="translation.writer" class="Symfony\Component\Translation\Writer\TranslationWriter" public="true" />
124124

125125
<service id="translation.warmer" class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TranslationsCacheWarmer">
126-
<argument type="service" id="translator" />
126+
<argument type="service" id="service_container" />
127127
<tag name="kernel.cache_warmer" />
128128
</service>
129129

‎src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;
1313

1414
use Symfony\Component\DependencyInjection\Alias;
15-
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
1615
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1716
use Symfony\Component\DependencyInjection\ContainerBuilder;
1817
use Symfony\Component\DependencyInjection\Definition;
@@ -119,7 +118,6 @@ public static function getContainerDefinitions()
119118
new Reference('definition_1'),
120119
new Reference('definition_2'),
121120
)))
122-
->addArgument(new ClosureProxyArgument('definition1', 'get'))
123121
->setFactory(array('Full\\Qualified\\FactoryClass', 'get')),
124122
'definition_2' => $definition2
125123
->setPublic(false)

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@
6060
"type": "service",
6161
"id": "definition_2"
6262
}
63-
],
64-
[
65-
{
66-
"type": "service",
67-
"id": "definition1"
68-
},
69-
"get"
7063
]
7164
],
7265
"file": null,

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<argument type="service" id="definition_1"/>
2323
<argument type="service" id="definition_2"/>
2424
</argument>
25-
<argument type="closure-proxy" id="definition1" method="get"/>
2625
</definition>
2726
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
2827
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@
5858
"type": "service",
5959
"id": "definition_2"
6060
}
61-
],
62-
[
63-
{
64-
"type": "service",
65-
"id": "definition1"
66-
},
67-
"get"
6861
]
6962
],
7063
"file": null,
+21-22Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
---------------- -------------------------------------------
2-
 Option   Value 
3-
---------------- -------------------------------------------
4-
Service ID -
5-
Class Full\Qualified\Class1
6-
Tags -
7-
Public yes
8-
Synthetic no
9-
Lazy yes
10-
Shared yes
11-
Abstract yes
12-
Autowired no
13-
Autoconfigured no
14-
Factory Class Full\Qualified\FactoryClass
15-
Factory Method get
16-
 Arguments Service(definition2) 
17-
 %parameter% 
18-
 Inlined Service 
19-
 Array (3 element(s)) 
20-
 Iterator (2 element(s)) 
21-
 ClosureProxy(Service(definition1)::get())
22-
---------------- -------------------------------------------
1+
---------------- -----------------------------
2+
 Option   Value 
3+
---------------- -----------------------------
4+
Service ID -
5+
Class Full\Qualified\Class1
6+
Tags -
7+
Public yes
8+
Synthetic no
9+
Lazy yes
10+
Shared yes
11+
Abstract yes
12+
Autowired no
13+
Autoconfigured no
14+
Factory Class Full\Qualified\FactoryClass
15+
Factory Method get
16+
 Arguments Service(definition2) 
17+
 %parameter% 
18+
 Inlined Service 
19+
 Array (3 element(s)) 
20+
 Iterator (2 element(s))
21+
---------------- -----------------------------
2322

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.xml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020
<argument type="service" id="definition_1"/>
2121
<argument type="service" id="definition_2"/>
2222
</argument>
23-
<argument type="closure-proxy" id="definition1" method="get"/>
2423
</definition>

0 commit comments

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