Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f8430e

Browse files
Merge branch '3.4'
* 3.4: [TwigBridge] Fix namespaced classes bumped Symfony version to 3.3.2 updated VERSION for 3.3.1 updated CHANGELOG for 3.3.1 [DependencyInjection] Fix named args support in ChildDefinition [Cache] Fallback to positional when keyed results are broken [HttpFoundation][FrameworkBundle] Revert "trusted proxies" BC break [Cache] MemcachedAdapter not working with TagAwareAdapter Remove closure-proxy leftovers fix used class name in deprecation message [DependencyInjection] Use more clear message when unused environment variables detected [Form][Profiler] Fixes form collector triggering deprecations mitigate BC break with empty trusted_proxies [Profiler] Never wrap in code excerpts [Form][FrameworkBundle] Remove non-existing arg for data_collector.form explain that a role can be an instance of Role [Cache] fix Redis scheme detection Implement ServiceSubscriberInterface in optional cache warmers Deprecate passing a concrete service in optional cache warmers mix attr options between type-guess options and user options
2 parents ddfd861 + b0ede2c commit 6f8430e

32 files changed

+166
-105
lines changed

CHANGELOG-3.3.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,36 @@ in 3.3 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.3.0...v3.3.1
99

10+
* 3.3.1 (2017-06-05)
11+
12+
* bug #23067 [HttpFoundation][FrameworkBundle] Revert "trusted proxies" BC break (nicolas-grekas)
13+
* bug #23065 [Cache] Fallback to positional when keyed results are broken (nicolas-grekas)
14+
* bug #22981 [DependencyInjection] Fix named args support in ChildDefinition (dunglas)
15+
* bug #23050 [Form][Profiler] Fixes form collector triggering deprecations (ogizanagi)
16+
* bug #22971 [Profiler] Fix code excerpt wrapping (ogizanagi)
17+
* bug #23049 [FrameworkBundle] mitigate BC break with empty trusted_proxies (xabbuh)
18+
* bug #23045 [Cache] fix Redis scheme detection (xabbuh)
19+
* bug #23013 Parse the _controller format in sub-requests (weaverryan)
20+
* bug #23015 [PhpUnitBridge] Fix detection of PHPUnit 5 (enumag)
21+
* bug #23041 [Config] Always protected ClassExistenceResource against bad parents (nicolas-grekas)
22+
* bug #22988 [PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string (dunglas)
23+
* bug #23014 Fix optional cache warmers are always instantiated whereas they should be lazy-loaded (romainneutron)
24+
* feature #23022 [Di] Remove closure-proxy arguments (nicolas-grekas)
25+
* bug #23024 [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null) (nicolas-grekas)
26+
* bug #23008 [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument (nicolas-grekas)
27+
* bug #23018 [FrameworkBundle] Fix CacheCollectorPass priority (chalasr)
28+
* bug #23009 [Routing] Allow GET requests to be redirected. Fixes #23004 (frankdejonge)
29+
* bug #22996 [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 (romainneutron)
30+
* bug #22965 [Cache] Ignore missing annotations.php (ro0NL)
31+
* bug #22993 [DI] Autowiring exception thrown when inlined service is removed (weaverryan)
32+
* bug #22999 Better DI type deprecation message (weaverryan)
33+
* bug #22985 [Config] Allow empty globs (nicolas-grekas)
34+
* bug #22961 [HttpKernel] Support unknown format in LoggerDataCollector (iltar)
35+
* bug #22991 [DI] Don't throw Autowire exception for removed service with private __construct (weaverryan)
36+
* bug #22968 [Profiler] Fix text selection & click on file links on exception pages (ogizanagi)
37+
* bug #22994 Harden the debugging of Twig filters and functions (stof)
38+
* bug #22960 [Cache] Fix decoration of TagAware adapters in dev (chalasr)
39+
1040
* 3.3.0 (2017-05-29)
1141

1242
* bug #22940 [Config] Fallback to regular import when glob fails (nicolas-grekas)

src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
use Symfony\Bridge\Twig\Node\TransNode;
1515
use Symfony\Bridge\Twig\Node\TransDefaultDomainNode;
1616
use Twig\Environment;
17+
use Twig\Node\BlockNode;
1718
use Twig\Node\Expression\ArrayExpression;
1819
use Twig\Node\Expression\AssignNameExpression;
1920
use Twig\Node\Expression\ConstantExpression;
2021
use Twig\Node\Expression\FilterExpression;
2122
use Twig\Node\Expression\NameExpression;
2223
use Twig\Node\ModuleNode;
2324
use Twig\Node\Node;
25+
use Twig\Node\SetNode;
2426
use Twig\NodeVisitor\AbstractNodeVisitor;
2527

2628
/**
@@ -48,7 +50,7 @@ public function __construct()
4850
*/
4951
protected function doEnterNode(Node $node, Environment $env)
5052
{
51-
if ($node instanceof Node_Block || $node instanceof ModuleNode) {
53+
if ($node instanceof BlockNode || $node instanceof ModuleNode) {
5254
$this->scope = $this->scope->enter();
5355
}
5456

@@ -62,7 +64,7 @@ protected function doEnterNode(Node $node, Environment $env)
6264
$name = new AssignNameExpression($var, $node->getTemplateLine());
6365
$this->scope->set('domain', new NameExpression($var, $node->getTemplateLine()));
6466

65-
return new Node_Set(false, new Node(array($name)), new Node(array($node->getNode('expr'))), $node->getTemplateLine());
67+
return new SetNode(false, new Node(array($name)), new Node(array($node->getNode('expr'))), $node->getTemplateLine());
6668
}
6769
}
6870

@@ -104,7 +106,7 @@ protected function doLeaveNode(Node $node, Environment $env)
104106
return false;
105107
}
106108

107-
if ($node instanceof Node_Block || $node instanceof ModuleNode) {
109+
if ($node instanceof BlockNode || $node instanceof ModuleNode) {
108110
$this->scope = $this->scope->leave();
109111
}
110112

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CHANGELOG
2424
* Not defining the `type` option of the `framework.workflows.*` configuration entries is deprecated.
2525
The default value will be `state_machine` in Symfony 4.0.
2626
* Deprecated the `CompilerDebugDumpPass` class
27-
* [BC BREAK] Removed the "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter
27+
* Deprecated the "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter
2828
* Added a new new version strategy option called json_manifest_path
2929
that allows you to use the `JsonManifestVersionStrategy`.
3030
* Added `Symfony\Bundle\FrameworkBundle\Controller\AbstractController`. It provides

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Generates the router matcher and generator classes.
2020
*
2121
* @author Fabien Potencier <[email protected]>
22+
*
23+
* @final since version 3.4, to be given a container instead in 4.0
2224
*/
2325
class RouterCacheWarmer implements CacheWarmerInterface
2426
{

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\CacheWarmer;
1313

14-
use Symfony\Component\DependencyInjection\ContainerInterface;
14+
use Psr\Container\ContainerInterface;
15+
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
1516
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1617
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
1718
use Symfony\Component\Translation\TranslatorInterface;
@@ -21,26 +22,15 @@
2122
*
2223
* @author Xavier Leune <[email protected]>
2324
*/
24-
class TranslationsCacheWarmer implements CacheWarmerInterface
25+
class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2526
{
2627
private $container;
2728
private $translator;
2829

29-
/**
30-
* TranslationsCacheWarmer constructor.
31-
*
32-
* @param ContainerInterface|TranslatorInterface $container
33-
*/
34-
public function __construct($container)
30+
public function __construct(ContainerInterface $container)
3531
{
3632
// 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-
}
33+
$this->container = $container;
4434
}
4535

4636
/**
@@ -64,4 +54,14 @@ public function isOptional()
6454
{
6555
return true;
6656
}
57+
58+
/**
59+
* {@inheritdoc}
60+
*/
61+
public static function getSubscribedServices()
62+
{
63+
return array(
64+
'translator' => TranslatorInterface::class,
65+
);
66+
}
6767
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,4 @@ protected function sortServiceIds(array $serviceIds)
307307

308308
return $serviceIds;
309309
}
310-
311-
protected function formatClosure(\Closure $closure)
312-
{
313-
$r = new \ReflectionFunction($closure);
314-
315-
return 'closure';
316-
}
317310
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ private function getCallableData($callable, array $options = array())
366366
}
367367

368368
if ($callable instanceof \Closure) {
369-
$data['type'] = $this->formatClosure($callable);
369+
$data['type'] = 'closure';
370370

371371
return $data;
372372
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ protected function describeCallable($callable, array $options = array())
345345
}
346346

347347
if ($callable instanceof \Closure) {
348-
$formatted = $this->formatClosure($callable);
349-
$string .= "\n- Type: `$formatted`";
348+
$string .= "\n- Type: `closure`";
350349

351350
return $this->write($string."\n");
352351
}

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,7 @@ private function formatCallable($callable)
470470
}
471471

472472
if ($callable instanceof \Closure) {
473-
$formatted = $this->formatClosure($callable);
474-
475-
if ('closure' === $formatted) {
476-
return '\Closure()';
477-
}
478-
479-
return $formatted.'()';
473+
return '\Closure()';
480474
}
481475

482476
if (method_exists($callable, '__invoke')) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ private function getCallableDocument($callable)
593593
}
594594

595595
if ($callable instanceof \Closure) {
596-
$callableXML->setAttribute('type', $this->formatClosure($callable));
596+
$callableXML->setAttribute('type', 'closure');
597597

598598
return $dom;
599599
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@
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="service_container" />
126+
<tag name="container.service_subscriber" id="translator" />
127127
<tag name="kernel.cache_warmer" />
128+
<argument type="service" id="Psr\Container\ContainerInterface" />
128129
</service>
129130

130131
<service id="translator_listener" class="Symfony\Component\HttpKernel\EventListener\TranslatorListener" public="true">

src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\CacheWarmer;
1313

14-
use Symfony\Component\DependencyInjection\ContainerInterface;
14+
use Psr\Container\ContainerInterface;
15+
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
1516
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1617
use Twig\Environment;
1718
use Twig\Error\Error;
@@ -21,29 +22,16 @@
2122
*
2223
* @author Fabien Potencier <[email protected]>
2324
*/
24-
class TemplateCacheWarmer implements CacheWarmerInterface
25+
class TemplateCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2526
{
2627
private $container;
2728
private $twig;
2829
private $iterator;
2930

30-
/**
31-
* TemplateCacheWarmer constructor.
32-
*
33-
* @param ContainerInterface|Environment $container
34-
* @param \Traversable $iterator
35-
*/
36-
public function __construct($container, \Traversable $iterator)
31+
public function __construct(ContainerInterface $container, \Traversable $iterator)
3732
{
3833
// As this cache warmer is optional, dependencies should be lazy-loaded, that's why a container should be injected.
39-
if ($container instanceof ContainerInterface) {
40-
$this->container = $container;
41-
} elseif ($container instanceof Environment) {
42-
$this->twig = $container;
43-
} else {
44-
throw new \InvalidArgumentException(sprintf('%s only accepts instance of Symfony\Component\DependencyInjection\ContainerInterface or Environment as first argument.', __CLASS__));
45-
}
46-
34+
$this->container = $container;
4735
$this->iterator = $iterator;
4836
}
4937

@@ -73,4 +61,14 @@ public function isOptional()
7361
{
7462
return true;
7563
}
64+
65+
/**
66+
* {@inheritdoc}
67+
*/
68+
public static function getSubscribedServices()
69+
{
70+
return array(
71+
'twig' => Environment::class,
72+
);
73+
}
7674
}

src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545

4646
<service id="twig.template_cache_warmer" class="Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheWarmer">
4747
<tag name="kernel.cache_warmer" />
48-
<argument type="service" id="service_container" />
48+
<tag name="container.service_subscriber" id="twig" />
49+
<argument type="service" id="Psr\Container\ContainerInterface" />
4950
<argument type="service" id="twig.template_iterator" />
5051
</service>
5152

src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ header .container { display: flex; justify-content: space-between; }
9595
.trace-head .icon svg { height: 24px; width: 24px; }
9696

9797
.trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }
98-
98+
.trace-details { table-layout: fixed; }
9999
.trace-line { position: relative; padding-left: 36px; }
100100
.trace-line.sf-toggle:hover { background: #F5F5F5; }
101101
.trace-line a { color: #222; }
@@ -108,12 +108,12 @@ header .container { display: flex; justify-content: space-between; }
108108
.trace-method { color: #B0413E; color: #222; font-weight: bold; color: #B0413E; }
109109
.trace-arguments { color: #222; color: #999; font-weight: normal; color: #795da3; color: #777; padding-left: 2px; }
110110

111-
.trace-code { background: #FFF; font-size: 12px; margin: 10px 0 2px; padding: 10px; }
112-
.trace-code ol { margin: 0; }
113-
.trace-code li { color: #969896; margin: 0; padding-left: 10px; }
114-
.trace-code li + li { margin-top: 10px; }
115-
.trace-code li.selected { background: #F8EEC7; padding: 3px 0 3px 10px; }
116-
.trace-code li code { color: #222; }
111+
.trace-code { background: #FFF; font-size: 12px; margin: 10px 0 2px; padding: 10px; overflow-x: auto; }
112+
.trace-code ol { margin: 0; float: left; }
113+
.trace-code li { color: #969896; margin: 0; padding-left: 10px; float: left; width: 100%; }
114+
.trace-code li + li { margin-top: 5px; }
115+
.trace-code li.selected { background: #F8EEC7; padding: 3px 0 3px 10px; margin-top: 2px; }
116+
.trace-code li code { color: #222; white-space: nowrap; }
117117

118118
.trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; }
119119

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,21 +525,21 @@
525525
<th class="font-normal" scope="row">Model Format</th>
526526
<td>
527527
{% if data.default_data.model is defined %}
528-
{{ profiler_dump(data.default_data.model) }}
528+
{{ profiler_dump(data.default_data.seek('model')) }}
529529
{% else %}
530530
<em class="font-normal text-muted">same as normalized format</em>
531531
{% endif %}
532532
</td>
533533
</tr>
534534
<tr>
535535
<th class="font-normal" scope="row">Normalized Format</th>
536-
<td>{{ profiler_dump(data.default_data.norm) }}</td>
536+
<td>{{ profiler_dump(data.default_data.seek('norm')) }}</td>
537537
</tr>
538538
<tr>
539539
<th class="font-normal" scope="row">View Format</th>
540540
<td>
541541
{% if data.default_data.view is defined %}
542-
{{ profiler_dump(data.default_data.view) }}
542+
{{ profiler_dump(data.default_data.seek('view')) }}
543543
{% else %}
544544
<em class="font-normal text-muted">same as normalized format</em>
545545
{% endif %}
@@ -571,21 +571,21 @@
571571
<th class="font-normal" scope="row">View Format</th>
572572
<td>
573573
{% if data.submitted_data.view is defined %}
574-
{{ profiler_dump(data.submitted_data.view) }}
574+
{{ profiler_dump(data.submitted_data.seek('view')) }}
575575
{% else %}
576576
<em class="font-normal text-muted">same as normalized format</em>
577577
{% endif %}
578578
</td>
579579
</tr>
580580
<tr>
581581
<th class="font-normal" scope="row">Normalized Format</th>
582-
<td>{{ profiler_dump(data.submitted_data.norm) }}</td>
582+
<td>{{ profiler_dump(data.submitted_data.seek('norm')) }}</td>
583583
</tr>
584584
<tr>
585585
<th class="font-normal" scope="row">Model Format</th>
586586
<td>
587587
{% if data.submitted_data.model is defined %}
588-
{{ profiler_dump(data.submitted_data.model) }}
588+
{{ profiler_dump(data.submitted_data.seek('model')) }}
589589
{% else %}
590590
<em class="font-normal text-muted">same as normalized format</em>
591591
{% endif %}
@@ -630,7 +630,7 @@
630630
{% if resolved_option_value == option_value %}
631631
<em class="font-normal text-muted">same as passed value</em>
632632
{% else %}
633-
{{ profiler_dump(data.resolved_options[option]) }}
633+
{{ profiler_dump(data.resolved_options.seek(option)) }}
634634
{% endif %}
635635
</td>
636636
</tr>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ private function generateItems($items, &$keys)
266266

267267
try {
268268
foreach ($items as $id => $value) {
269+
if (!isset($keys[$id])) {
270+
$id = key($keys);
271+
}
269272
$key = $keys[$id];
270273
unset($keys[$id]);
271274
yield $key => $f($key, $value, true);

0 commit comments

Comments
 (0)