8000 Merge branch '2.8' · symfony/symfony@5183c88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5183c88

Browse files
Merge branch '2.8'
* 2.8: Always enable clock-mock for HttpFoundation [ClassLoader] Fix parsing namespace when token_get_all() is missing Bug #16343 [Router] Too many Routes ? Fixes the stack traces of the deprecation logs fix unused variable warning [Translation][Form] Do not translate form labels and placeholders when 'translation_domain' is false add composer exclude-from-classmap for new 2.8 components [Yaml] sync changelog and upgrade files [Debug] Ensure class declarations are loaded only once Minor design tweaks for the Logs and Doctrine profiler panels Conflicts: UPGRADE-2.8.md
2 parents cd0ffc9 + da43309 commit 5183c88

File tree

22 files changed

+285
-23
lines changed

22 files changed

+285
-23
lines changed

UPGRADE-3.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,11 @@ UPGRADE FROM 2.x to 3.0
13331333

13341334
### Yaml
13351335

1336+
* Using a colon in an unquoted mapping value leads to a `ParseException`.
1337+
* Starting an unquoted string with `@`, `` ` ``, `|`, or `>` leads to a `ParseException`.
1338+
* Deprecated non-escaped \ in double-quoted strings when parsing Yaml
1339+
("Foo\Var" is not valid whereas "Foo\\Var" is)
1340+
13361341
* The ability to pass file names to `Yaml::parse()` has been removed.
13371342

13381343
Before:

phpunit.xml.dist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,14 @@
4747
</exclude>
4848
</whitelist>
4949
</filter>
50+
51+
<listeners>
52+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
53+
<arguments>
54+
<array>
55+
<element><string>Symfony\Component\HttpFoundation</string></element>
56+
</array>
57+
</arguments>
58+
</listener>
59+
</listeners>
5060
</phpunit>

src/Symfony/Bridge/PhpUnit/ClockMock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function microtime($asFloat = false)
6666
return self::$now;
6767
}
6868

69-
return sprintf("%0.6f %d\n", $now - (int) $now, (int) self::$now);
69+
return sprintf("%0.6f %d\n", self::$now - (int) self::$now, (int) self::$now);
7070
}
7171

7272
public static function register($class)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
{%- endif -%}
5858
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
5959
{%- if placeholder is not none -%}
60-
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? placeholder|trans({}, translation_domain) }}</option>
60+
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain)) }}</option>
6161
{%- endif -%}
6262
{%- if preferred_choices|length > 0 -%}
6363
{% set options = preferred_choices %}
@@ -192,7 +192,7 @@
192192
{% set label = name|humanize %}
193193
{%- endif -%}
194194
{%- endif -%}
195-
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ label|trans({}, translation_domain) }}</button>
195+
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</button>
196196
{%- endblock button_widget -%}
197197

198198
{%- block submit_widget -%}
@@ -320,7 +320,7 @@
320320
{%- for attrname, attrvalue in attr -%}
321321
{{- " " -}}
322322
{%- if attrname in ['placeholder', 'title'] -%}
323-
{{- attrname }}="{{ attrvalue|trans({}, translation_domain) }}"
323+
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
324324
{%- elseif attrvalue is same as(true) -%}
325325
{{- attrname }}="{{ attrname }}"
326326
{%- elseif attrvalue is not same as(false) -%}
@@ -334,7 +334,7 @@
334334
{%- for attrname, attrvalue in attr -%}
335335
{{- " " -}}
336336
{%- if attrname in ['placeholder', 'title'] -%}
337-
{{- attrname }}="{{ attrvalue|trans({}, translation_domain) }}"
337+
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
338338
{%- elseif attrvalue is same as(true) -%}
339339
{{- attrname }}="{{ attrname }}"
340340
{%- elseif attrvalue is not same as(false) -%}
@@ -348,7 +348,7 @@
348348
{%- for attrname, attrvalue in attr -%}
349349
{{- " " -}}
350350
{%- if attrname in ['placeholder', 'title'] -%}
351-
{{- attrname }}="{{ attrvalue|trans({}, translation_domain) }}"
351+
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
352352
{%- elseif attrvalue is same as(true) -%}
353353
{{- attrname }}="{{ attrname }}"
354354
{%- elseif attrvalue is not same as(false) -%}
@@ -361,7 +361,7 @@
361361
{%- for attrname, attrvalue in attr -%}
362362
{{- " " -}}
363363
{%- if attrname in ['placeholder', 'title'] -%}
364-
{{- attrname }}="{{ attrvalue|trans({}, translation_domain) }}"
364+
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
365365
{%- elseif attrvalue is same as(true) -%}
366366
{{- attrname }}="{{ attrname }}"
367367
{%- elseif attrvalue is not same as(false) -%}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
{%- endif -%}
151151
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple" data-customforms="disabled"{% endif %}>
152152
{% if placeholder is not none -%}
153-
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder|trans({}, translation_domain) }}</option>
153+
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain) }}</option>
154154
{%- endif %}
155155
{%- if preferred_choices|length > 0 -%}
156156
{% set options = preferred_choices %}
@@ -253,7 +253,7 @@
253253
{% endif %}
254254
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
255255
{{ widget|raw }}
256-
{{ label|trans({}, translation_domain) }}
256+
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
257257
</label>
258258
{%- endblock checkbox_radio_label %}
259259

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>" <?php if ($disabled): ?>disabled="disabled" <?php endif ?>
22
<?php foreach ($attr as $k => $v): ?>
33
<?php if (in_array($v, array('placeholder', 'title'), true)): ?>
4-
<?php printf('%s="%s" ', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
4+
<?php printf('%s="%s" ', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
55
<?php elseif ($v === true): ?>
66
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
77
<?php elseif ($v !== false): ?>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php if (!$label) { $label = isset($label_format)
22
? strtr($label_format, array('%name%' => $name, '%id%' => $id))
33
: $view['form']->humanize($name); } ?>
4-
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></button>
4+
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, array(), $translation_domain) : $label) ?></button>

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
)) ?>
88
<?php if ($multiple): ?> multiple="multiple"<?php endif ?>
99
>
10-
<?php if (null !== $placeholder): ?><option value=""<?php if ($required and empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo '' != $placeholder ? $view->escape($view['translator']->trans($placeholder, array(), $translation_domain)) : '' ?></option><?php endif; ?>
10+
<?php if (null !== $placeholder): ?><option value=""<?php if ($required and empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo '' != $placeholder ? $view->escape(false !== $translation_domain ? $view['translator']->trans($placeholder, array(), $translation_domain) : $placeholder) : '' ?></option><?php endif; ?>
1111
<?php if (count($preferred_choices) > 0): ?>
1212
<?php echo $view['form']->block($form, 'choice_widget_options', array('choices' => $preferred_choices)) ?>
1313
<?php if (count($choices) > 0 && null !== $separator): ?>

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?php if ($required): ?> required="required"<?php endif ?>
33
<?php foreach ($attr as $k => $v): ?>
44
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
5-
<?php printf(' %s="%s"', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
5+
<?php printf(' %s="%s"', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
66
<?php elseif ($v === true): ?>
77
<?php printf(' %s="%s"', $view->escape($k), $view->escape($k)) ?>
88
<?php elseif ($v !== false): ?>

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php if (!empty($id)): ?>id="<?php echo $view->escape($id) ?>" <?php endif ?>
22
<?php foreach ($attr as $k => $v): ?>
33
<?php if (in_array($v, array('placeholder', 'title'), true)): ?>
4-
<?php printf('%s="%s" ', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
4+
<?php printf('%s="%s" ', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
55
<?php elseif ($v === true): ?>
66
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
77
<?php elseif ($v !== false): ?>

0 commit comments

Comments
 (0)
0