Skip to content

Commit 0f00f7c

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: Php Inspections (EA Extended): squash all PR-13813 commits replaced the last remaining is_integer() call [2.3] [Config] [Console] [DependencyInjection] [DomCrawler] [Form] [HttpKernel] [PropertyAccess] [Security] [Translation] [Yaml] static code analysis, code cleanup [FrameworkBundle] simplify dep declaration [VarDumper] Fix "next element is already occupied" [Validator] Added missing galician (gl) translations [PropertyAccess] stop overwriting once a reference is reached (3rd) [OptionsResolver] Remove Unused Variable from Foreach Cycles [travis] Tests Security sub-components [Twig] bootstrap_3_layout.html.twig is usable as a trait [travis] Tests Security sub-components CS fixes [TwigBridge] Bootstrap Layout - Fix the label of checkbox cannot be empty [travis] test with php nightly Conflicts: .travis.yml src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php src/Symfony/Component/Security/Http/Tests/Firewall/RememberMeListenerTest.php
2 parents 0ab3beb + 6cd8734 commit 0f00f7c

File tree

40 files changed

+206
-116
lines changed

40 files changed

+206
-116
lines changed

.travis.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ matrix:
1010
env: deps=low
1111
- php: 5.6
1212
env: deps=high
13+
- php: nightly
1314
- php: hhvm-nightly
1415
allow_failures:
16+
- php: nightly
1517
- php: hhvm-nightly
1618
fast_finish: true
1719

@@ -25,12 +27,12 @@ env:
2527
before_install:
2628
- travis_retry sudo apt-get install parallel
2729
- composer self-update
28-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then phpenv config-rm xdebug.ini; fi;
29-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
30-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
31-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then pecl install -f memcached-2.1.0; fi;
32-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
33-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then php -i; fi;
30+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then phpenv config-rm xdebug.ini; fi;
31+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
32+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
33+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then pecl install -f memcached-2.1.0; fi;
34+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
35+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then php -i; fi;
3436
- sudo locale-gen fr_FR.UTF-8 && sudo update-locale
3537
# Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built
3638
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
@@ -39,8 +41,9 @@ install:
3941
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
4042

4143
script:
44+
- components=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
4245
- if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi;
43-
- if [ "$deps" = "no" ]; then ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
46+
- if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
4447
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
45-
- if [ "$deps" = "high" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
46-
- if [ "$deps" = "low" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
48+
- if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
49+
- if [ "$deps" = "low" ]; then echo "$components" | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "form_div_layout.html.twig" %}
1+
{% use "form_div_layout.html.twig" %}
22

33
{# Widgets #}
44

@@ -164,12 +164,12 @@
164164
{% if parent_label_class is defined %}
165165
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
166166
{% endif %}
167-
{% if label is empty %}
167+
{% if label is not sameas(false) and label is empty %}
168168
{% set label = name|humanize %}
169169
{% endif %}
170170
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
171171
{{ widget|raw }}
172-
{{ label|trans({}, translation_domain) }}
172+
{{ label is not sameas(false) ? label|trans({}, translation_domain) }}
173173
</label>
174174
{% endif %}
175175
{% endblock checkbox_radio_label %}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
388388
);
389389

390390
foreach ($urls as $i => $url) {
391-
if (is_integer($i)) {
391+
if (is_int($i)) {
392392
if (0 === strpos($url, 'https://') || 0 === strpos($url, '//')) {
393393
$urls['http'][] = $urls['ssl'][] = $url;
394394
} else {

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
303303
'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage',
304304
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
305305
);
306-
list($class, ) = explode(':', $config['dsn'], 2);
306+
list($class) = explode(':', $config['dsn'], 2);
307307
if (!isset($supported[$class])) {
308308
throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class));
309309
}

src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ protected function validatePrototypeNode(PrototypedArrayNode $node)
472472
);
473473
}
474474

475-
if (null !== $this->key && (null === $this->addDefaultChildren || is_integer($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
475+
if (null !== $this->key && (null === $this->addDefaultChildren || is_int($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
476476
throw new InvalidDefinitionException(
477477
sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path)
478478
);

src/Symfony/Component/Config/Definition/PrototypedArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function setAddChildrenIfNoneSet($children = array('defaults'))
117117
if (null === $children) {
118118
$this->defaultChildren = array('defaults');
119119
} else {
120-
$this->defaultChildren = is_integer($children) && $children > 0 ? range(1, $children) : (array) $children;
120+
$this->defaultChildren = is_int($children) && $children > 0 ? range(1, $children) : (array) $children;
121121
}
122122
}
123123

src/Symfony/Component/Config/Util/XmlUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ protected static function getXmlErrors($internalErrors)
222222
LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR',
223223
$error->code,
224224
trim($error->message),
225-
$error->file ? $error->file : 'n/a',
225+
$error->file ?: 'n/a',
226226
$error->line,
227227
$error->column
228228
);

src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function setOption($option)
149149
));
150150
}
151151

152-
if (false === array_search(static::$availableOptions[$option], $this->options)) {
152+
if (!in_array(static::$availableOptions[$option], $this->options)) {
153153
$this->options[] = static::$availableOptions[$option];
154154
}
155155
}

src/Symfony/Component/Console/Tests/Helper/LegacyDialogHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function testNoInteraction()
177177
protected function getInputStream($input)
178178
{
179179
$stream = fopen('php://memory', 'r+', false);
180-
fputs($stream, $input);
180+
fwrite($stream, $input);
181181
rewind($stream);
182182

183183
return $stream;

src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function testNoInteraction()
274274
protected function getInputStream($input)
275275
{
276276
$stream = fopen('php://memory', 'r+', false);
277-
fputs($stream, $input);
277+
fwrite($stream, $input);
278278
rewind($stream);
279279

280280
return $stream;

0 commit comments

Comments
 (0)