Skip to content

Commit 5c74f11

Browse files
Merge branch '3.4'
* 3.4: Ensure DeprecationErrorHandler::collectDeprecations() is triggered Config: mark builder property deprecated fix CachePoolPrunerPass to use correct command service id [TwigBridge] Re-add Bootstrap 3 Checkbox Layout [FrameworkBundle] Allow to disable assets via framework:assets xml configuration fixed $_ENV/$_SERVER precedence in test framework [HttpFoundation] Fix FileBag issue with associative arrays [DI] Throw when a service name or an alias contains dynamic values (prevent an infinite loop) [HttpFoundation] Fix caching of session-enabled pages [Guard] remove invalid deprecation notice fix the phpdoc that is not really inherited from response Minor docblock cleanup Remove redundant sprintf arguments.
2 parents beee423 + c7e59b3 commit 5c74f11

File tree

33 files changed

+148
-54
lines changed

33 files changed

+148
-54
lines changed

UPGRADE-3.4.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
UPGRADE FROM 3.3 to 3.4
22
=======================
33

4+
Config
5+
------
6+
7+
* Using protected builder property of TreeBuilder is deprecated and property will be removed in 4.0.
8+
49
DependencyInjection
510
-------------------
611

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@
3737
*/
3838
class DoctrineTokenProvider implements TokenProviderInterface
3939
{
40-
/**
41-
* Doctrine DBAL database connection
42-
* F.ex. service id: doctrine.dbal.default_connection.
43-
*
44-
* @var Connection
45-
*/
4640
private $conn;
4741

4842
public function __construct(Connection $conn)

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ public function endTest($test, $time)
253253
if ($this->runsInSeparateProcess) {
254254
$deprecations = file_get_contents($this->runsInSeparateProcess);
255255
unlink($this->runsInSeparateProcess);
256+
putenv('SYMFONY_DEPRECATIONS_SERIALIZE');
256257
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
257258
if ($deprecation[0]) {
258259
trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false))), E_USER_DEPRECATED);

src/Symfony/Bridge/PhpUnit/bootstrap.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
use Doctrine\Common\Annotations\AnnotationRegistry;
1313
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1414

15+
// Detect if we need to serialize deprecations to a file.
16+
if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
17+
DeprecationErrorHandler::collectDeprecations($file);
18+
19+
return;
20+
}
21+
1522
// Detect if we're loaded by an actual run of phpunit
1623
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) {
17-
if ($ser = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
18-
DeprecationErrorHandler::collectDeprecations($ser);
19-
}
20-
2124
return;
2225
}
2326

src/Symfony/Bridge/Twig/Extension/CodeExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public function abbrMethod($method)
7070
list($class, $method) = explode('::', $method, 2);
7171
$result = sprintf('%s::%s()', $this->abbrClass($class), $method);
7272
} elseif ('Closure' === $method) {
73-
$result = sprintf('<abbr title="%s">%s</abbr>', $method, $method);
73+
$result = sprintf('<abbr title="%s">%1$s</abbr>', $method);
7474
} else {
75-
$result = sprintf('<abbr title="%s">%s</abbr>()', $method, $method);
75+
$result = sprintf('<abbr title="%s">%1$s</abbr>()', $method);
7676
}
7777

7878
return $result;

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,15 @@
123123
{%- endblock datetime_row %}
124124

125125
{% block checkbox_row -%}
126+
{% spaceless %}
126127
<div class="form-group{% if not valid %} has-error{% endif %}">
127-
{{- form_widget(form) -}}
128-
{{- form_errors(form) -}}
128+
<div class="{{ block('form_label_class') }}"></div>
129+
<div class="{{ block('form_group_class') }}">
130+
{{- form_widget(form) -}}
131+
{{- form_errors(form) -}}
132+
</div>
129133
</div>
134+
{% endspaceless %}
130135
{%- endblock checkbox_row %}
131136

132137
{% block radio_row -%}

src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ public function testCompile()
102102

103103
protected function getVariableGetter($name)
104104
{
105-
return sprintf('($context["%s"] ?? null)', $name, $name);
105+
return sprintf('($context["%s"] ?? null)', $name);
106106
}
107107
}

src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,6 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes()
271271

272272
protected function getVariableGetter($name)
273273
{
274-
return sprintf('($context["%s"] ?? null)', $name, $name);
274+
return sprintf('($context["%s"] ?? null)', $name);
275275
}
276276
}

src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public function testCompileStrict()
4444

4545
protected function getVariableGetterWithoutStrictCheck($name)
4646
{
47-
return sprintf('($context["%s"] ?? null)', $name, $name);
47+
return sprintf('($context["%s"] ?? null)', $name);
4848
}
4949

5050
protected function getVariableGetterWithStrictCheck($name)
5151
{
5252
if (Environment::MAJOR_VERSION >= 2) {
53-
return sprintf('(isset($context["%s"]) || array_key_exists("%s", $context) ? $context["%s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%s" does not exist.\', 0, $this->getSourceContext()); })())', $name, $name, $name, $name);
53+
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name);
5454
}
5555

56-
return sprintf('($context["%s"] ?? $this->getContext($context, "%s"))', $name, $name, $name);
56+
return sprintf('($context["%s"] ?? $this->getContext($context, "%1$s"))', $name);
5757
}
5858
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPrunerPass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

14+
use Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand;
1415
use Symfony\Component\Cache\PruneableInterface;
1516
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -26,7 +27,7 @@ class CachePoolPrunerPass implements CompilerPassInterface
2627
private $cacheCommandServiceId;
2728
private $cachePoolTag;
2829

29-
public function __construct($cacheCommandServiceId = 'cache.command.pool_pruner', $cachePoolTag = 'cache.pool')
30+
public function __construct($cacheCommandServiceId = CachePoolPruneCommand::class, $cachePoolTag = 'cache.pool')
3031
{
3132
$this->cacheCommandServiceId = $cacheCommandServiceId;
3233
$this->cachePoolTag = $cachePoolTag;

0 commit comments

Comments
 (0)