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 96a43e6

Browse filesBrowse files
author
Joe Bennett
committed
Merge remote-tracking branch 'origin/master' into 27345-lock-mongodb
2 parents 987548d + 1a3d445 commit 96a43e6
Copy full SHA for 96a43e6

File tree

462 files changed

+906
-567
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

462 files changed

+906
-567
lines changed

‎UPGRADE-4.2.md

Copy file name to clipboardExpand all lines: UPGRADE-4.2.md
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ Cache
66

77
* Deprecated `CacheItem::getPreviousTags()`, use `CacheItem::getMetadata()` instead.
88

9+
Form
10+
----
11+
12+
* Deprecated calling `FormRenderer::searchAndRenderBlock` for fields which were already rendered.
13+
Instead of expecting such calls to return empty strings, check if the field has already been rendered.
14+
15+
Before:
16+
```twig
17+
{% for field in fieldsWithPotentialDuplicates %}
18+
{{ form_widget(field) }}
19+
{% endfor %}
20+
```
21+
22+
After:
23+
```twig
24+
{% for field in fieldsWithPotentialDuplicates if not field.rendered %}
25+
{{ form_widget(field) }}
26+
{% endfor %}
27+
```
28+
29+
Config
30+
------
31+
32+
* Deprecated constructing a `TreeBuilder` without passing root node information.
33+
934
Security
1035
--------
1136

‎UPGRADE-5.0.md

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Cache
99
Config
1010
------
1111

12+
* Dropped support for constructing a `TreeBuilder` without passing root node information.
1213
* Added the `getChildNodeDefinitions()` method to `ParentNodeDefinitionInterface`.
1314
* The `Processor` class has been made final
1415

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
"require": {
1919
"php": "^7.1.3",
2020
"ext-xml": "*",
21-
"doctrine/collections": "~1.0",
22-
"doctrine/event-manager": "~1.0",
23-
"doctrine/persistence": "~1.0",
21+
"doctrine/common": "~2.4@stable",
2422
"fig/link-util": "^1.0",
2523
"twig/twig": "^1.35|^2.4.4",
2624
"psr/cache": "~1.0",
@@ -93,7 +91,6 @@
9391
"doctrine/data-fixtures": "1.0.*",
9492
"doctrine/dbal": "~2.4",
9593
"doctrine/orm": "~2.4,>=2.4.5",
96-
"doctrine/reflection": "~1.0",
9794
"doctrine/doctrine-bundle": "~1.4",
9895
"monolog/monolog": "~1.11",
9996
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",

‎src/Symfony/Bridge/Doctrine/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/composer.json
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.1.3",
20-
"doctrine/collections": "~1.0",
21-
"doctrine/event-manager": "~1.0",
22-
"doctrine/persistence": "~1.0",
20+
"doctrine/common": "~2.4@stable",
2321
"symfony/polyfill-ctype": "~1.8",
2422
"symfony/polyfill-mbstring": "~1.0"
2523
},
@@ -35,12 +33,9 @@
3533
"symfony/expression-language": "~3.4|~4.0",
3634
"symfony/validator": "~3.4|~4.0",
3735
"symfony/translation": "~3.4|~4.0",
38-
"doctrine/annotations": "~1.0",
39-
"doctrine/cache": "~1.6",
4036
"doctrine/data-fixtures": "1.0.*",
4137
"doctrine/dbal": "~2.4",
42-
"doctrine/orm": "^2.4.5",
43-
"doctrine/reflection": "~1.0"
38+
"doctrine/orm": "^2.4.5"
4439
},
4540
"conflict": {
4641
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",

‎src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
{# Support #}
399399

400400
{%- block form_rows -%}
401-
{% for child in form %}
401+
{% for child in form if not child.rendered %}
402402
{{- form_row(child) -}}
403403
{% endfor %}
404404
{%- endblock form_rows -%}

‎src/Symfony/Bridge/Twig/UndefinedCallableHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/UndefinedCallableHandler.php
+20-3Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Twig;
1313

14+
use Symfony\Bundle\FullStack;
1415
use Twig\Error\SyntaxError;
1516

1617
/**
@@ -56,14 +57,21 @@ class UndefinedCallableHandler
5657
'workflow_marked_places' => 'workflow',
5758
);
5859

60+
private static $fullStackEnable = array(
61+
'form' => 'enable "framework.form"',
62+
'security-core' => 'add the "SecurityBundle"',
63+
'security-http' => 'add the "SecurityBundle"',
64+
'web-link' => 'enable "framework.web_link"',
65+
'workflow' => 'enable "framework.workflows"',
66+
);
67+
5968
public static function onUndefinedFilter($name)
6069
{
6170
if (!isset(self::$filterComponents[$name])) {
6271
return false;
6372
}
6473

65-
// Twig will append the source context to the message, so that it will end up being like "[...] Unknown filter "%s" in foo.html.twig on line 123."
66-
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown filter "%s".', self::$filterComponents[$name], $name));
74+
self::onUndefined($name, 'filter', self::$filterComponents[$name]);
6775
}
6876

6977
public static function onUndefinedFunction($name)
@@ -72,6 +80,15 @@ public static function onUndefinedFunction($name)
7280
return false;
7381
}
7482

75-
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown function "%s".', self::$functionComponents[$name], $name));
83+
self::onUndefined($name, 'function', self::$functionComponents[$name]);
84+
}
85+
86+
private static function onUndefined($name, $type, $component)
87+
{
88+
if (\class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
89+
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::$fullStackEnable[$component], $type, $name));
90+
}
91+
92+
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name));
7693
}
7794
}

‎src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ class Configuration implements ConfigurationInterface
2626
*/
2727
public function getConfigTreeBuilder()
2828
{
29-
$treeBuilder = new TreeBuilder();
30-
$rootNode = $treeBuilder->root('debug');
29+
$treeBuilder = new TreeBuilder('debug');
3130

32-
$rootNode
31+
$treeBuilder->getRootNode()
3332
->children()
3433
->integerNode('max_items')
3534
->info('Max number of displayed items past the first level, -1 means no limit')

‎src/Symfony/Bundle/DebugBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DebugBundle/composer.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
"symfony/var-dumper": "^4.1.1"
2424
},
2525
"require-dev": {
26-
"symfony/config": "~3.4|~4.0",
26+
"symfony/config": "~4.2",
2727
"symfony/dependency-injection": "~3.4|~4.0",
2828
"symfony/web-profiler-bundle": "~3.4|~4.0"
2929
},
3030
"conflict": {
31+
"symfony/config": "<4.2",
3132
"symfony/dependency-injection": "<3.4"
3233
},
3334
"suggest": {

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function __construct(bool $debug)
5454
*/
5555
public function getConfigTreeBuilder()
5656
{
57-
$treeBuilder = new TreeBuilder();
58-
$rootNode = $treeBuilder->root('framework');
57+
$treeBuilder = new TreeBuilder('framework');
58+
$rootNode = $treeBuilder->getRootNode();
5959

6060
$rootNode
6161
->beforeNormalization()
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php foreach ($form as $child) : ?>
2-
<?php echo $view['form']->row($child) ?>
2+
<?php if (!$child->isRendered()): ?>
3+
<?php echo $view['form']->row($child) ?>
4+
<?php endif; ?>
35
<?php endforeach; ?>

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/Configuration.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ public function __construct($customConfig = null)
2525

2626
public function getConfigTreeBuilder()
2727
{
28-
$treeBuilder = new TreeBuilder();
29-
$rootNode = $treeBuilder->root('test');
28+
$treeBuilder = new TreeBuilder('test');
3029

3130
if ($this->customConfig) {
32-
$this->customConfig->addConfiguration($rootNode);
31+
$this->customConfig->addConfiguration($treeBuilder->getRootNode());
3332
}
3433

3534
return $treeBuilder;

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"ext-xml": "*",
2121
"symfony/cache": "~3.4|~4.0",
2222
"symfony/dependency-injection": "^4.1.1",
23-
"symfony/config": "~3.4|~4.0",
23+
"symfony/config": "~4.2",
2424
"symfony/event-dispatcher": "^4.1",
2525
"symfony/http-foundation": "^4.1",
2626
"symfony/http-kernel": "^4.1",

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ class AddSessionDomainConstraintPass implements CompilerPassInterface
2626
*/
2727
public function process(ContainerBuilder $container)
2828
{
29-
if (!$container->hasParameter('session.storage.options')) {
29+
if (!$container->hasParameter('session.storage.options') || !$container->has('security.http_utils')) {
3030
return;
3131
}
3232

3333
$sessionOptions = $container->getParameter('session.storage.options');
3434
$domainRegexp = empty($sessionOptions['cookie_domain']) ? '%s' : sprintf('(?:%%s|(?:.+\.)?%s)', preg_quote(trim($sessionOptions['cookie_domain'], '.')));
3535
$domainRegexp = (empty($sessionOptions['cookie_secure']) ? 'https?://' : 'https://').$domainRegexp;
3636

37-
// if the service doesn't exist, an exception must be thrown - ignoring would put security at risk
3837
$container->findDefinition('security.http_utils')->addArgument(sprintf('{^%s$}i', $domainRegexp));
3938
}
4039
}

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public function __construct(array $factories, array $userProviderFactories)
4141
*/
4242
public function getConfigTreeBuilder()
4343
{
44-
$tb = new TreeBuilder();
45-
$rootNode = $tb->root('security');
44+
$tb = new TreeBuilder('security');
45+
$rootNode = $tb->getRootNode();
4646

4747
$rootNode
4848
->beforeNormalization()

‎src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php
-13Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,6 @@ public function testNoSession()
9696
$this->assertTrue($utils->createRedirectResponse($request, 'http://pirate.com/foo')->isRedirect('http://pirate.com/foo'));
9797
}
9898

99-
/**
100-
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
101-
* @expectedExceptionMessage You have requested a non-existent service "security.http_utils".
102-
*/
103-
public function testNoHttpUtils()
104-
{
105-
$container = new ContainerBuilder();
106-
$container->setParameter('session.storage.options', array());
107-
108-
$pass = new AddSessionDomainConstraintPass();
109-
$pass->process($container);
110-
}
111-
11299
private function createContainer($sessionStorageOptions)
113100
{
114101
$container = new ContainerBuilder();

‎src/Symfony/Bundle/SecurityBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php": "^7.1.3",
2020
"ext-xml": "*",
21+
"symfony/config": "^4.2",
2122
"symfony/security": "~4.2",
2223
"symfony/dependency-injection": "^3.4.3|^4.0.3",
2324
"symfony/http-kernel": "^4.1"

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public function process(ContainerBuilder $container)
8282
}
8383
}
8484

85+
if ($container->has('web_link.add_link_header_listener')) {
86+
$container->getDefinition('twig.extension.weblink')->addTag('twig.extension');
87+
}
88+
8589
$twigLoader = $container->getDefinition('twig.loader.native_filesystem');
8690
if ($container->has('templating')) {
8791
$loader = $container->getDefinition('twig.loader.filesystem');

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class Configuration implements ConfigurationInterface
2929
*/
3030
public function getConfigTreeBuilder()
3131
{
32-
$treeBuilder = new TreeBuilder();
33-
$rootNode = $treeBuilder->root('twig');
32+
$treeBuilder = new TreeBuilder('twig');
33+
$rootNode = $treeBuilder->getRootNode();
3434

3535
$rootNode
3636
->children()

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
1313

14-
use Symfony\Bridge\Twig\Extension\WebLinkExtension;
1514
use Symfony\Bundle\TwigBundle\Loader\NativeFilesystemLoader;
1615
use Symfony\Component\Config\FileLocator;
1716
use Symfony\Component\Config\Resource\FileExistenceResource;
@@ -20,7 +19,6 @@
2019
use Symfony\Component\DependencyInjection\Reference;
2120
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2221
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
23-
use Symfony\Component\WebLink\HttpHeaderSerializer;
2422
use Twig\Extension\ExtensionInterface;
2523
use Twig\Extension\RuntimeExtensionInterface;
2624
use Twig\Loader\LoaderInterface;
@@ -54,13 +52,6 @@ public function load(array $configs, ContainerBuilder $container)
5452
$container->removeDefinition('twig.translation.extractor');
5553
}
5654

57-
if (class_exists(HttpHeaderSerializer::class)) {
58-
$definition = $container->register('twig.extension.weblink', WebLinkExtension::class);
59-
$definition->setPublic(false);
60-
$definition->addArgument(new Reference('request_stack'));
61-
$definition->addTag('twig.extension');
62-
}
63-
6455
foreach ($configs as $key => $config) {
6556
if (isset($config['globals'])) {
6657
foreach ($config['globals'] as $name => $value) {

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114

115115
<service id="twig.extension.debug" class="Twig\Extension\DebugExtension" />
116116

117+
<service id="twig.extension.weblink" class="Symfony\Bridge\Twig\Extension\WebLinkExtension">
118+
<argument type="service" id="request_stack" />
119+
</service>
120+
117121
<service id="twig.translation.extractor" class="Symfony\Bridge\Twig\Translation\TwigExtractor">
118122
<argument type="service" id="twig" />
119123
<tag name="translation.extractor" alias="twig" />

‎src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig
+13-5Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
<head>
44
<meta charset="{{ _charset }}" />
55
<title>An Error Occurred: {{ status_text }}</title>
6+
<style>
7+
body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; }
8+
.container { margin: 30px; max-width: 600px; }
9+
h1 { color: #dc3545; font-size: 24px; }
10+
h2 { font-size: 18px; }
11+
</style>
612
</head>
713
<body>
8-
<h1>Oops! An Error Occurred</h1>
9-
<h2>The server returned a "{{ status_code }} {{ status_text }}".</h2>
14+
<div class="container">
15+
<h1>Oops! An Error Occurred</h1>
16+
<h2>The server returned a "{{ status_code }} {{ status_text }}".</h2>
1017

11-
<div>
12-
Something is broken. Please let us know what you were doing when this error occurred.
13-
We will fix it as soon as possible. Sorry for any inconvenience caused.
18+
<p>
19+
Something is broken. Please let us know what you were doing when this error occurred.
20+
We will fix it as soon as possible. Sorry for any inconvenience caused.
21+
</p>
1422
</div>
1523
</body>
1624
</html>

‎src/Symfony/Bundle/TwigBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/composer.json
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,31 @@
1717
],
1818
"require": {
1919
"php": "^7.1.3",
20-
"symfony/config": "~3.4|~4.0",
20+
"symfony/config": "~4.2",
2121
"symfony/twig-bridge": "^3.4.3|^4.0.3",
22-
"symfony/http-foundation": "~3.4|~4.0",
23-
"symfony/http-kernel": "~3.4|~4.0",
22+
"symfony/http-foundation": "~4.1",
23+
"symfony/http-kernel": "~4.1",
2424
"symfony/polyfill-ctype": "~1.8",
2525
"twig/twig": "~1.34|~2.4"
2626
},
2727
"require-dev": {
2828
"symfony/asset": "~3.4|~4.0",
2929
"symfony/stopwatch": "~3.4|~4.0",
30-
"symfony/dependency-injection": "~3.4|~4.0",
30+
"symfony/dependency-injection": "~4.1",
3131
"symfony/expression-language": "~3.4|~4.0",
3232
"symfony/finder": "~3.4|~4.0",
3333
"symfony/form": "~3.4|~4.0",
3434
"symfony/routing": "~3.4|~4.0",
3535
"symfony/templating": "~3.4|~4.0",
3636
"symfony/yaml": "~3.4|~4.0",
37-
"symfony/framework-bundle": "~3.4|~4.0",
37+
"symfony/framework-bundle": "~4.1",
3838
"symfony/web-link": "~3.4|~4.0",
3939
"doctrine/annotations": "~1.0",
4040
"doctrine/cache": "~1.0"
4141
},
4242
"conflict": {
43-
"symfony/dependency-injection": "<3.4",
44-
"symfony/event-dispatcher": "<3.4"
43+
"symfony/dependency-injection": "<4.1",
44+
"symfony/framework-bundle": "<4.1"
4545
},
4646
"autoload": {
4747
"psr-4": { "Symfony\\Bundle\\TwigBundle\\": "" },

0 commit comments

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