8000 Merge branch '3.4' into 4.0 · symfony/symfony@72041c8 · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit 72041c8

Browse files
Merge branch '3.4' into 4.0
* 3.4: (22 commits) [DI] Add tests for EnvVarProcessor [Bridge\PhpUnit] Fix #26430 Cannot autoload listeners Make sure we always render errors. Eventhough labels are disabled Make sure form errors is valid HTML [HttpKernel] Allow generators in registerBundle [TwigBundle] document TwigRenderer BC break in UPGRADE-3.4 Extra line to bootstrap 3 horizontal layout [Serializer] Remove const override Update Client.php [PhpUnitBridge] Ability to use different composer.json file [DomCrawler] FormField: remove an useless return statement [Config] ReflectionClassResource check abstract ServiceSubscriberInterface and EventSubscriberInterface Display the Welcome Page when there is no homepage defined fix regression when extending the Container class without a constructor fix the updating of timestamp in the MemcachedSessionHandler [SecurityBundle] Make extra character non mandatory in regex [Config] Add characters to the regex bumped Symfony version to 3.4.7 updated VERSION for 3.4.6 updated CHANGELOG for 3.4.6 ...
2 parents f606653 + 7ae5292 commit 72041c8

31 files changed

+436
-62
lines changed

src/Symfony/Bridge/PhpUnit/CoverageListener.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV6', 'Symfony\Brid
1818
} else {
1919
class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV7', 'Symfony\Bridge\PhpUnit\CoverageListener');
2020
}
21+
22+
if (false) {
23+
class CoverageListener
24+
{
25+
}
26+
}

src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV6', 'Symfony\
1818
} else {
1919
class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener');
2020
}
21+
22+
if (false) {
23+
class SymfonyTestsListener
24+
{
25+
}
26+
}

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ if (PHP_VERSION_ID >= 70200) {
2626
$PHPUNIT_VERSION = '4.8';
2727
}
2828

29+
if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') {
30+
putenv('COMPOSER=composer.json');
31+
$_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json';
32+
}
33+
2934
$root = __DIR__;
30-
while (!file_exists($root.'/composer.json') || file_exists($root.'/DeprecationErrorHandler.php')) {
35+
while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) {
3136
if ($root === dirname($root)) {
3237
break;
3338
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ col-sm-10
6262
{{- form_errors(form) -}}
6363
</div>{#--#}
6464
</div>
65-
{%- endblock checkbox_row %}
65+
{%- endblock checkbox_row %}

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,13 @@
203203
{% set label = name|humanize %}
204204
{%- endif -%}
205205
{%- endif -%}
206-
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{{- form_errors(form) -}}</{{ element|default('label') }}>
206+
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}</{{ element|default('label') }}>
207+
{%- else -%}
208+
{%- if errors|length > 0 -%}
209+
<div id="{{ id }}_errors" class="mb-2">
210+
{{- form_errors(form) -}}
211+
</div>
212+
{%- endif -%}
207213
{%- endif -%}
208214
{%- endblock form_label %}
209215

@@ -261,12 +267,12 @@
261267

262268
{% block form_errors -%}
263269
{%- if errors|length > 0 -%}
264-
<div class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
265-
<ul class="list-unstyled mb-0">
266-
{%- for error in errors -%}
267-
<li><span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span></li>
268-
{%- endfor -%}
269-
</ul>
270-
</div>
270+
<span class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
271+
{%- for error in errors -%}
272+
<span class="mb-0 d-block">
273+
<span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span>
274+
</span>
275+
{%- endfor -%}
276+
</span>
271277
{%- endif %}
272278
{%- endblock form_errors %}

src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,14 @@
317317
</td>
318318
<td>
319319
{% if decision.attributes|length == 1 %}
320-
{{ decision.attributes|first }}
320+
{% set attribute = decision.attributes|first %}
321+
{% if attribute.expression is defined %}
322+
Expression: <pre><code>{{ attribute.expression }}</code></pre>
323+
{% elseif attribute.type == 'string' %}
324+
{{ attribute }}
325+
{% else %}
326+
{{ profiler_dump(attribute) }}
327+
{% endif %}
321328
{% else %}
322329
{{ profiler_dump(decision.attributes) }}
323330
{% endif %}

src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testEncodePasswordArgon2i()
8686
$this->assertContains('Password encoding succeeded', $output);
8787

8888
$encoder = new Argon2iPasswordEncoder();
89-
preg_match('# Encoded password\s+(\$argon2id\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
89+
preg_match('# Encoded password\s+(\$argon2id?\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
9090
$hash = $matches[1];
9191
$this->assertTrue($encoder->isPasswordValid($hash, 'password', null));
9292
}

src/Symfony/Component/BrowserKit/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function isFollowingRedirects()
7878
}
7979

8080
/**
81-
* Sets the maximum number of requests that crawler can follow.
81+
* Sets the maximum number of redirects that crawler can follow.
8282
*
8383
* @param int $maxRedirects
8484
*/
@@ -89,7 +89,7 @@ public function setMaxRedirects($maxRedirects)
8989
}
9090

9191
/**
92-
* Returns the maximum number of requests that crawler can follow.
92+
* Returns the maximum number of redirects that crawler can follow.
9393
*
9494
* @return int
9595
*/

src/Symfony/Component/Config/Resource/ReflectionClassResource.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,16 @@ private function generateSignature(\ReflectionClass $class)
148148
yield print_r($defaults, true);
149149
}
150150

151-
if ($class->isSubclassOf(EventSubscriberInterface::class)) {
151+
if ($class->isAbstract() || $class->isInterface() || $class->isTrait()) {
152+
return;
153+
}
154+
155+
if (interface_exists(EventSubscriberInterface::class, false) && $class->isSubclassOf(EventSubscriberInterface::class)) {
152156
yield EventSubscriberInterface::class;
153157
yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true);
154158
}
155159

156-
if ($class->isSubclassOf(ServiceSubscriberInterface::class)) {
160+
if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) {
157161
yield ServiceSubscriberInterface::class;
158162
yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true);
159163
}

src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testLoadFile()
5555
XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'));
5656
$this->fail();
5757
} catch (\InvalidArgumentException $e) {
58-
$this->assertRegExp('/The XML file "[\w:\/\\\.-]+" is not valid\./', $e->getMessage());
58+
$this->assertRegExp('/The XML file "[\w:\/\\\.~+-]+" is not valid\./', $e->getMessage());
5959
}
6060

6161
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')));

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,9 +920,13 @@ public function __construct()
920920

921921
if (Container::class !== $baseClassWithNamespace) {
922922
$r = $this->container->getReflectionClass($baseClassWithNamespace, false);
923-
924-
if (null !== $r && (null !== $constructor = $r->getConstructor()) && 0 === $constructor->getNumberOfRequiredParameters()) {
925-
$code .= " parent::__construct();\n\n";
923+
if (null !== $r
924+
&& (null !== $constructor = $r->getConstructor())
925+
&& 0 === $constructor->getNumberOfRequiredParameters()
926+
&& Container::class !== $constructor->getDeclaringClass()->name
927+
) {
928+
$code .= " parent::__construct();\n";
929+
$code .= " \$this->parameterBag = null;\n\n";
926930
}
927931
}
928932

0 commit comments

Comments
 (0)
0