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 797e83f

Browse filesBrowse files
committed
Merge branch '2.8' into 3.0
* 2.8: Fix computation of PR diffs for component matrix lines [console][table] adjust width of colspanned cell. [BUG] Delete class 'control-group' in bootstrap 3 [2.8] [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper added missing constant in Response Update HTTP statuses list [Console][#18619] Prevent fatal error when calling Command#getHelper() without helperSet added StaticVerionStrategyTest Add SplFileInfo array doc on Finder iterator methods so that IDE will know what it returns [2.3] [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper Updated the link to the list of currency codes [console][table] adjust width of colspanned cell.
2 parents 6aa00aa + bcdf568 commit 797e83f
Copy full SHA for 797e83f

File tree

Expand file treeCollapse file tree

13 files changed

+172
-88
lines changed
Filter options
Expand file treeCollapse file tree

13 files changed

+172
-88
lines changed

‎.travis.php

Copy file name to clipboardExpand all lines: .travis.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<?php
22

33
if (4 > $_SERVER['argc']) {
4-
echo "Usage: commit-range branch dir1 dir2 ... dirN\n";
4+
echo "Usage: branch dir1 dir2 ... dirN\n";
55
exit(1);
66
}
77

88
$dirs = $_SERVER['argv'];
99
array_shift($dirs);
10-
$range = array_shift($dirs);
1110
$branch = array_shift($dirs);
1211

1312
$packages = array();
1413
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
1514

1615
foreach ($dirs as $dir) {
17-
if (!`git diff --name-only $range -- $dir`) {
16+
if (!`git diff --name-only $branch...HEAD -- $dir`) {
1817
continue;
1918
}
2019
echo "$dir\n";

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ before_install:
5757
install:
5858
- if [[ ! $skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
5959
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
60-
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi
60+
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_BRANCH $COMPONENTS; fi
6161
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
6262
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi
6363
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); ./phpunit install; fi

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
+6-8Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,12 @@
9494

9595
{% block choice_widget_expanded -%}
9696
{% if '-inline' in label_attr.class|default('') -%}
97-
<div class="control-group">
98-
{%- for child in form %}
99-
{{- form_widget(child, {
100-
parent_label_class: label_attr.class|default(''),
101-
translation_domain: choice_translation_domain,
102-
}) -}}
103-
{% endfor -%}
104-
</div>
97+
{%- for child in form %}
98+
{{- form_widget(child, {
99+
parent_label_class: label_attr.class|default(''),
100+
translation_domain: choice_translation_domain,
101+
}) -}}
102+
{% endfor -%}
105103
{%- else -%}
106104
<div {{ block('widget_container_attributes') }}>
107105
{%- for child in form %}
+43Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Asset\Tests\VersionStrategy;
13+
14+
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
15+
16+
class StaticVersionStrategyTest extends \PHPUnit_Framework_TestCase
17+
{
18+
public function testGetVersion()
19+
{
20+
$version = 'v1';
21+
$path = 'test-path';
22+
$staticVersionStrategy = new StaticVersionStrategy($version);
23+
$this->assertEquals($version, $staticVersionStrategy->getVersion($path));
24+
}
25+
26+
/**
27+
* @dataProvider getConfigs
28+
*/
29+
public function testApplyVersion($path, $version, $format)
30+
{
31+
$staticVersionStrategy = new StaticVersionStrategy($version, $format);
32+
$formatted = sprintf($format ?: '%s?%s', $path, $version);
33+
$this->assertEquals($formatted, $staticVersionStrategy->applyVersion($path));
34+
}
35+
36+
public function getConfigs()
37+
{
38+
return array(
39+
array('test-path', 'v1', null),
40+
array('test-path', 'v2', '%s?test%s'),
41+
);
42+
}
43+
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,15 @@ public function getUsages()
601601
*
602602
* @return mixed The helper value
603603
*
604+
* @throws LogicException if no HelperSet is defined
604605
* @throws InvalidArgumentException if the helper is not defined
605606
*/
606607
public function getHelper($name)
607608
{
609+
if (null === $this->helperSet) {
610+
throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name));
611+
}
612+
608613
return $this->helperSet->get($name);
609614
}
610615

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/Table.php
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,18 @@ private function calculateColumnsWidth($rows)
569569
continue;
570570
}
571571

572+
foreach ($row as $i => $cell) {
573+
if ($cell instanceof TableCell) {
574+
$textLength = strlen($cell);
575+
if ($textLength > 0) {
576+
$contentColumns = str_split($cell, ceil($textLength / $cell->getColspan()));
577+
foreach ($contentColumns as $position => $content) {
578+
$row[$i + $position] = $content;
579+
}
580+
}
581+
}
582+
}
583+
572584
$lengths[] = $this->getCellWidth($row, $column);
573585
}
574586

@@ -599,10 +611,6 @@ private function getCellWidth(array $row, $column)
599611
if (isset($row[$column])) {
600612
$cell = $row[$column];
601613
$cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
602-
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
603-
// we assume that cell value will be across more than one column.
604-
$cellWidth = $cellWidth / $cell->getColspan();
605-
}
606614

607615
return $cellWidth;
608616
}

‎src/Symfony/Component/Console/Tests/Command/CommandTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Command/CommandTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ public function testGetHelper()
173173
$this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper');
174174
}
175175

176+
/**
177+
* @expectedException \LogicException
178+
* @expectedExceptionMessage Cannot retrieve helper "formatter" because there is no HelperSet defined.
179+
*/
180+
public function testGetHelperWithoutHelperSet()
181+
{
182+
$command = new \TestCommand();
183+
$command->getHelper('formatter');
184+
}
185+
176186
public function testMergeApplicationDefinition()
177187
{
178188
$application1 = new Application();

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Helper/TableTest.php
+40-34Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -269,21 +269,27 @@ public function testRenderProvider()
269269
'9971-5-0210-0',
270270
new TableCell("A Tale of \nTwo Cities", array('colspan' => 2)),
271271
),
272+
new TableSeparator(),
273+
array(
274+
new TableCell('Cupiditate dicta atque porro, tempora exercitationem modi animi nulla nemo vel nihil!', array('colspan' => 3)),
275+
),
272276
),
273277
'default',
274278
<<<TABLE
275-
+----------------+---------------+-----------------+
276-
| ISBN | Title | Author |
277-
+----------------+---------------+-----------------+
278-
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
279-
+----------------+---------------+-----------------+
280-
| Divine Comedy(Dante Alighieri) |
281-
+----------------+---------------+-----------------+
282-
| Arduino: A Quick-Start Guide | Mark Schmidt |
283-
+----------------+---------------+-----------------+
284-
| 9971-5-0210-0 | A Tale of |
285-
| | Two Cities |
286-
+----------------+---------------+-----------------+
279+
+-------------------------------+-------------------------------+-----------------------------+
280+
| ISBN | Title | Author |
281+
+-------------------------------+-------------------------------+-----------------------------+
282+
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
283+
+-------------------------------+-------------------------------+-----------------------------+
284+
| Divine Comedy(Dante Alighieri) |
285+
+-------------------------------+-------------------------------+-----------------------------+
286+
| Arduino: A Quick-Start Guide | Mark Schmidt |
287+
+-------------------------------+-------------------------------+-----------------------------+
288+
| 9971-5-0210-0 | A Tale of |
289+
| | Two Cities |
290+
+-------------------------------+-------------------------------+-----------------------------+
291+
| Cupiditate dicta atque porro, tempora exercitationem modi animi nulla nemo vel nihil! |
292+
+-------------------------------+-------------------------------+-----------------------------+
287293
288294
TABLE
289295
),
@@ -336,16 +342,16 @@ public function testRenderProvider()
336342
),
337343
'default',
338344
<<<TABLE
339-
+------------------+--------+-----------------+
340-
| ISBN | Title | Author |
341-
+------------------+--------+-----------------+
342-
| 9971-5-0210-0 | Dante Alighieri |
343-
| | Charles Dickens |
344-
+------------------+--------+-----------------+
345-
| Dante Alighieri | 9971-5-0210-0 |
346-
| J. R. R. Tolkien | |
347-
| J. R. R | |
348-
+------------------+--------+-----------------+
345+
+------------------+---------+-----------------+
346+
| ISBN | Title | Author |
347+
+------------------+---------+-----------------+
348+
| 9971-5-0210-0 | Dante Alighieri |
349+
| | Charles Dickens |
350+
+------------------+---------+-----------------+
351+
| Dante Alighieri | 9971-5-0210-0 |
352+
| J. R. R. Tolkien | |
353+
| J. R. R | |
354+
+------------------+---------+-----------------+
349355
350356
TABLE
351357
),
@@ -473,9 +479,9 @@ public function testRenderProvider()
473479
),
474480
'default',
475481
<<<TABLE
476-
+--+--+--+--+--+--+--+--+--+
477-
| 1 | 2 | 3 | 4 |
478-
+--+--+--+--+--+--+--+--+--+
482+
+---+--+--+---+--+---+--+---+--+
483+
| 1 | 2 | 3 | 4 |
484+
+---+--+--+---+--+---+--+---+--+
479485
480486
TABLE
481487
),
@@ -580,15 +586,15 @@ public function testRenderMultiCalls()
580586

581587
$expected =
582588
<<<TABLE
583-
+---+--+
584-
| foo |
585-
+---+--+
586-
+---+--+
587-
| foo |
588-
+---+--+
589-
+---+--+
590-
| foo |
591-
+---+--+
589+
+----+---+
590+
| foo |
591+
+----+---+
592+
+----+---+
593+
| foo |
594+
+----+---+
595+
+----+---+
596+
| foo |
597+
+----+---+
592598
593599
TABLE;
594600

0 commit comments

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