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 05f71d3

Browse filesBrowse files
committed
Merge branch '4.4' into 5.0
* 4.4: fix unix root dir issue sync validator translation files with master [HttpFoundation] fix not sending Content-Type header for 204 responses [ErrorHandler] silence warning when zend.assertions=-1 fix anchor [Console] Handle zero row count in appendRow() for Table fix links to releases page (formerly known as "roadmap") [Console] Don't load same-namespace alternatives on exact match found
2 parents fb14669 + 7a6e3c0 commit 05f71d3
Copy full SHA for 05f71d3

File tree

Expand file treeCollapse file tree

15 files changed

+110
-19
lines changed
Filter options
Expand file treeCollapse file tree

15 files changed

+110
-19
lines changed

‎.github/PULL_REQUEST_TEMPLATE.md

Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Replace this notice by a short README for your feature/bugfix. This will help people
1212
understand your PR and can be used as a start for the documentation.
1313
14-
Additionally (see https://symfony.com/roadmap):
14+
Additionally (see https://symfony.com/releases):
1515
- Always add tests and ensure they pass.
1616
- Never break backward compatibility (see https://symfony.com/bc).
1717
- Bug fixes must be submitted against the lowest maintained branch where they apply

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<td class="font-normal">{{ collector.symfonyeom }}</td>
154154
<td class="font-normal">{{ collector.symfonyeol }}</td>
155155
<td class="font-normal">
156-
<a href="https://symfony.com/roadmap?version={{ collector.symfonyminorversion }}#checker">View roadmap</a>
156+
<a href="https://symfony.com/releases/{{ collector.symfonyminorversion }}#release-checker">View roadmap</a>
157157
</td>
158158
</tr>
159159
</tbody>

‎src/Symfony/Component/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Application.php
+17-3Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,15 @@ public function find(string $name)
647647
// filter out aliases for commands which are already on the list
648648
if (\count($commands) > 1) {
649649
$commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
650-
$commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
650+
651+
if (isset($commandList[$name])) {
652+
return $this->get($name);
653+
}
654+
655+
foreach ($commands as $k => $nameOrAlias) {
656+
if ($nameOrAlias === $name) {
657+
return $this->get($nameOrAlias);
658+
}
651659
if (!$commandList[$nameOrAlias] instanceof Command) {
652660
$commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
653661
}
@@ -656,8 +664,14 @@ public function find(string $name)
656664

657665
$aliases[$nameOrAlias] = $commandName;
658666

659-
return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
660-
}));
667+
if ($commandName === $nameOrAlias || !\in_array($commandName, $commands)) {
668+
continue;
669+
}
670+
671+
unset($commands[$k]);
672+
}
673+
674+
$commands = array_unique($commands);
661675
}
662676

663677
if (\count($commands) > 1) {

‎src/Symfony/Component/Console/Helper/Table.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/Table.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,9 @@ private function calculateRowCount(): int
589589
++$numberOfRows; // Add row for header separator
590590
}
591591

592-
++$numberOfRows; // Add row for footer separator
592+
if (\count($this->rows) > 0) {
593+
++$numberOfRows; // Add row for footer separator
594+
}
593595

594596
return $numberOfRows;
595597
}

‎src/Symfony/Component/Console/Tests/ApplicationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/ApplicationTest.php
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,31 @@ public function testAllExcludesDisabledLazyCommand()
16921692
$this->assertArrayNotHasKey('disabled', $application->all());
16931693
}
16941694

1695+
public function testFindAlternativesDoesNotLoadSameNamespaceCommandsOnExactMatch()
1696+
{
1697+
$application = new Application();
1698+
$application->setAutoExit(false);
1699+
1700+
$loaded = [];
1701+
1702+
$application->setCommandLoader(new FactoryCommandLoader([
1703+
'foo:bar' => function () use (&$loaded) {
1704+
$loaded['foo:bar'] = true;
1705+
1706+
return (new Command('foo:bar'))->setCode(function () {});
1707+
},
1708+
'foo' => function () use (&$loaded) {
1709+
$loaded['foo'] = true;
1710+
1711+
return (new Command('foo'))->setCode(function () {});
1712+
},
1713+
]));
1714+
1715+
$application->run(new ArrayInput(['command' => 'foo']), new NullOutput());
1716+
1717+
$this->assertSame(['foo' => true], $loaded);
1718+
}
1719+
16951720
protected function getDispatcher($skipCommand = false)
16961721
{
16971722
$dispatcher = new EventDispatcher();

‎src/Symfony/Component/Console/Tests/Helper/TableTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Helper/TableTest.php
+32Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,38 @@ public function testAppendRowWithoutSectionOutput()
951951
$table->appendRow(['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25']);
952952
}
953953

954+
public function testSectionOutputHandlesZeroRowsAfterRender()
955+
{
956+
$sections = [];
957+
$stream = $this->getOutputStream(true);
958+
$output = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
959+
$output->writeln('My Table');
960+
$table = new Table($output);
961+
$table
962+
->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
963+
->setRows([]);
964+
965+
$table->render();
966+
967+
$table->appendRow(['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25']);
968+
969+
$expected =
970+
<<<TABLE
971+
My Table
972+
+------+-------+--------+-------+
973+
|\033[32m ISBN \033[39m|\033[32m Title \033[39m|\033[32m Author \033[39m|\033[32m Price \033[39m|
974+
+------+-------+--------+-------+
975+
\x1b[3A\x1b[0J+---------------+----------------------+-----------------+--------+
976+
|\033[32m ISBN \033[39m|\033[32m Title \033[39m|\033[32m Author \033[39m|\033[32m Price \033[39m|
977+
+---------------+----------------------+-----------------+--------+
978+
| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | 139.25 |
979+
+---------------+----------------------+-----------------+--------+
980+
981+
TABLE;
982+
983+
$this->assertEquals($expected, $this->getOutputContent($output));
984+
}
985+
954986
public function testIsNotDefinedStyleException()
955987
{
956988
$this->expectException('Symfony\Component\Console\Exception\InvalidArgumentException');

‎src/Symfony/Component/ErrorHandler/Debug.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Debug.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function enable(): ErrorHandler
2929
ini_set('display_errors', 1);
3030
}
3131

32-
ini_set('zend.assertions', 1);
32+
@ini_set('zend.assertions', 1);
3333
ini_set('assert.active', 1);
3434
ini_set('assert.warning', 0);
3535
ini_set('assert.exception', 1);

‎src/Symfony/Component/Finder/Finder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Finder.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,10 @@ private function searchInDirectory(string $dir): \Iterator
782782
*/
783783
private function normalizeDir(string $dir): string
784784
{
785+
if ('/' === $dir) {
786+
return $dir;
787+
}
788+
785789
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
786790

787791
if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) {

‎src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ public function current()
7070
}
7171
$subPathname .= $this->getFilename();
7272

73-
return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
73+
if ('/' !== $basePath = $this->rootPath) {
74+
$basePath .= $this->directorySeparator;
75+
}
76+
77+
return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname);
7478
}
7579

7680
/**

‎src/Symfony/Component/HttpFoundation/Response.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Response.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,12 @@ public function prepare(Request $request)
258258
$this->setContent(null);
259259
$headers->remove('Content-Type');
260260
$headers->remove('Content-Length');
261+
// prevent PHP from sending the Content-Type header based on default_mimetype
262+
ini_set('default_mimetype', '');
261263
} else {
262264
// Content-type based on the Request
263265
if (!$headers->has('Content-Type')) {
264-
$format = $request->getPreferredFormat();
266+
$format = $request->getPreferredFormat(null);
265267
if (null !== $format && $mimeType = $request->getMimeType($format)) {
266268
$headers->set('Content-Type', $mimeType);
267269
}

‎src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,18 +461,10 @@ public function testSetVary()
461461

462462
public function testDefaultContentType()
463463
{
464-
$headerMock = $this->getMockBuilder('Symfony\Component\HttpFoundation\ResponseHeaderBag')->setMethods(['set'])->getMock();
465-
$headerMock->expects($this->at(0))
466-
->method('set')
467-
->with('Content-Type', 'text/html');
468-
$headerMock->expects($this->at(1))
469-
->method('set')
470-
->with('Content-Type', 'text/html; charset=UTF-8');
471-
472464
$response = new Response('foo');
473-
$response->headers = $headerMock;
474-
475465
$response->prepare(new Request());
466+
467+
$this->assertSame('text/html; charset=UTF-8', $response->headers->get('Content-Type'));
476468
}
477469

478470
public function testContentTypeCharset()

‎src/Symfony/Component/Validator/Resources/translations/validators.de.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.de.xlf
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>Dieser Wert sollte zwischen {{ min }} und {{ max }} sein.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>Dieser Wert ist kein gültiger Hostname.</target>
372+
</trans-unit>
369373
</body>
370374
</file>
371375
</xliff>

‎src/Symfony/Component/Validator/Resources/translations/validators.en.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.en.xlf
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>This value should be between {{ min }} and {{ max }}.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>This value is not a valid hostname.</target>
372+
</trans-unit>
369373
</body>
370374
</file>
371375
</xliff>

‎src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>Cette valeur doit être comprise entre {{ min }} et {{ max }}.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>Cette valeur n'est pas un nom d'hôte valide.</target>
372+
</trans-unit>
369373
</body>
370374
</file>
371375
</xliff>

‎src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
367367
<target>Значение должно быть между {{ min }} и {{ max }}.</target>
368368
</trans-unit>
369+
<trans-unit id="95">
370+
<source>This value is not a valid hostname.</source>
371+
<target>Значение не является корректным именем хоста.</target>
372+
</trans-unit>
369373
</body>
370374
</file>
371375
</xliff>

0 commit comments

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