8000 Merge branch '4.1' into 4.2 · symfony/symfony@5ee0c04 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ee0c04

Browse files
Merge branch '4.1' into 4.2
* 4.1: [Twig] Replace for-loops with blocks for attributes fixed CS [Tests] Change to willThrowException [Console] fix PHPDoc in Command Update FileLoaderLoadException.php Fix wrong calls to clearstatcache Add Vietnamese translation for validators Allow running PHPUnit with "xdebug.scream" ON [VarDumper] Add descriptors tests [Yaml] detect circular references [DI] fix reporting bindings on overriden services as unused [Routing] minor fix or previous PR
2 parents 9337422 + ed1500f commit 5ee0c04

File tree

50 files changed

+552
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+552
-92
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
{% set label = name|humanize %}
9999
{%- endif -%}
100100
{%- endif -%}
101-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
101+
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
102102
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
103103
</label>
104104
{%- endif -%}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
{%- endif -%}
261261

262262
{{ widget|raw }}
263-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
263+
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
264264
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
265265
{{- form_errors(form) -}}
266266
</label>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
{%- else -%}
353353
{% set form_method = "POST" %}
354354
{%- endif -%}
355-
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
355+
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{{ block('attributes') }}{% if multipart %} enctype="multipart/form-data"{% endif %}>
356356
{%- if form_method != method -%}
357357
<input type="hidden" name="_method" value="{{ method }}" />
358358
{%- endif -%}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
{% set label = name|humanize %}
259259
{%- endif -%}
260260
{% endif %}
261-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
261+
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
262262
{{ widget|raw }}
263263
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
264264
</label>

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testDebugInvalidDirectory()
123123
$kernel->expects($this->once())
124124
->method('getBundle')
125125
->with($this->equalTo('dir'))
126-
->will($this->throwException(new \InvalidArgumentException()));
126+
->willThrowException(new \InvalidArgumentException());
127127

128128
$tester = $this->createCommandTester(array(), array(), $kernel);
129129
$tester->execute(array('locale' => 'en', 'bundle' => 'dir'));

src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testThrowsExceptionWhenTemplateNotFound()
6060
$fileLocator
6161
->expects($this->once())
6262
->method('locate')
63-
->will($this->throwException(new \InvalidArgumentException($errorMessage)))
63+
->willThrowException(new \InvalidArgumentException($errorMessage))
6464
;
6565

6666
$locator = new TemplateLocator($fileLocator);

src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testTwigErrorIfLocatorThrowsInvalid()
6868
$locator
6969
->expects($this->once())
7070
->method('locate')
71-
->will($this->throwException(new \InvalidArgumentException('Unable to find template "NonExistent".')))
71+
->willThrowException(new \InvalidArgumentException('Unable to find template "NonExistent".'))
7272
;
7373

7474
$loader = new FilesystemLoader($locator, $parser);

src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function testThrowingUrlGenerator()
252252
->expects($this->once())
253253
->method('generate')
254254
->with('_profiler', array('token' => 'xxxxxxxx'))
255-
->will($this->throwException(new \Exception('foo')))
255+
->willThrowException(new \Exception('foo'))
256256
;
257257

258258
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
@@ -273,7 +273,7 @@ public function testThrowingErrorCleanup()
273273
->expects($this->once())
274274
->method('generate')
275275
->with('_profiler', array('token' => 'xxxxxxxx'))
276-
->will($this->throwException(new \Exception("This\nmultiline\r\ntabbed text should\tcome out\r on\n \ta single plain\r\nline")))
276+
->willThrowException(new \Exception("This\nmultiline\r\ntabbed text should\tcome out\r on\n \ta single plain\r\nline"))
277277
;
278278

279279
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);

src/Symfony/Component/Config/Exception/FileLoaderLoadException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ public function __construct(string $resource, string $sourceResource = null, int
4444

4545
// show tweaked trace to complete the human readable sentence
4646
if (null === $sourceResource) {
47-
$message .= sprintf('(which is loaded in resource "%s")', $this->varToString($resource));
47+
$message .= sprintf('(which is loaded in resource "%s")', $resource);
4848
} else {
49-
$message .= sprintf('(which is being imported from "%s")', $this->varToString($sourceResource));
49+
$message .= sprintf('(which is being imported from "%s")', $sourceResource);
5050
}
5151
$message .= '.';
5252

5353
// if there's no previous message, present it the default way
5454
} elseif (null === $sourceResource) {
55-
$message .= sprintf('Cannot load resource "%s".', $this->varToString($resource));
55+
$message .= sprintf('Cannot load resource "%s".', $resource);
5656
} else {
57-
$message .= sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource));
57+
$message .= sprintf('Cannot import resource "%s" from "%s".', $resource, $sourceResource);
5858
}
5959

6060
// Is the resource located inside a bundle?

src/Symfony/Component/Console/Command/Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ public function getNativeDefinition()
361361
* Adds an argument.
362362
*
363363
* @param string $name The argument name
364-
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
364+
* @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
365365
* @param string $description A description text
366-
* @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
366+
* @param string|string[]|null $default The default value (for InputArgument::OPTIONAL mode only)
367367
*
368368
* @throws InvalidArgumentException When argument mode is not valid
369369
*
@@ -381,9 +381,9 @@ public function addArgument($name, $mode = null, $description = '', $default = n
381381
*
382382
* @param string $name The option name
383383
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
384-
* @param int|null $mode The option mode: One of the VALUE_* constants
384+
* @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
385385
* @param string $description A description text
386-
* @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE)
386+
* @param string|string[]|int|bool|null $default The default value (must be null for InputOption::VALUE_NONE)
387387
*
388388
* @throws InvalidArgumentException If option mode is invalid or incompatible
389389
*

0 commit comments

Comments
 (0)
0