Skip to content

Commit 6cd8734

Browse files
committed
Merge branch '2.3' into 2.6
* 2.3: replaced the last remaining is_integer() call [2.3] [Config] [Console] [DependencyInjection] [DomCrawler] [Form] [HttpKernel] [PropertyAccess] [Security] [Translation] [Yaml] static code analysis, code cleanup [Validator] Added missing galician (gl) translations [travis] Tests Security sub-components [travis] Tests Security sub-components CS fixes [travis] test with php nightly Conflicts: src/Symfony/Component/Security/Http/Tests/Firewall/RememberMeListenerTest.php
2 parents 53570eb + e64b75f commit 6cd8734

File tree

32 files changed

+110
-76
lines changed

32 files changed

+110
-76
lines changed

.travis.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ matrix:
1111
env: deps=low
1212
- php: 5.6
1313
env: deps=high
14+
- php: nightly
1415
- php: hhvm-nightly
1516
allow_failures:
17+
- php: nightly
1618
- php: hhvm-nightly
1719
fast_finish: true
1820

@@ -26,12 +28,12 @@ env:
2628
before_install:
2729
- travis_retry sudo apt-get install parallel
2830
- composer self-update
29-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then phpenv config-rm xdebug.ini; fi;
30-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
31-
- 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;
32-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then pecl install -f memcached-2.1.0; fi;
33-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
34-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then php -i; fi;
31+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then phpenv config-rm xdebug.ini; fi;
32+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
33+
- 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;
34+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then pecl install -f memcached-2.1.0; fi;
35+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
36+
- if [[ "$TRAVIS_PHP_VERSION" != *"nightly" ]]; then php -i; fi;
3537
- sudo locale-gen fr_FR.UTF-8 && sudo update-locale
3638
# Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built
3739
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
@@ -40,7 +42,8 @@ install:
4042
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
4143

4244
script:
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;
45+
- components=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
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/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

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

320320
foreach ($urls as $i => $url) {
321-
if (is_integer($i)) {
321+
if (is_int($i)) {
322322
if (0 === strpos($url, 'https://') || 0 === strpos($url, '//')) {
323323
$urls['http'][] = $urls['ssl'][] = $url;
324324
} else {

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

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

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/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ private function getServiceCallsFromArguments(array $arguments, array &$calls, a
11691169
$behavior[$id] = $argument->getInvalidBehavior();
11701170
}
11711171

1172-
$calls[$id] += 1;
1172+
++$calls[$id];
11731173
}
11741174
}
11751175
}
@@ -1478,12 +1478,12 @@ private function getNextVariableName()
14781478
}
14791479

14801480
while ($i > 0) {
1481-
$i -= 1;
1481+
--$i;
14821482
$name .= $nonFirstChars[$i%$nonFirstCharsLength];
14831483
$i = intval($i/$nonFirstCharsLength);
14841484
}
14851485

1486-
$this->variableCount += 1;
1486+
++$this->variableCount;
14871487

14881488
// check that the name is not reserved
14891489
if (in_array($name, $this->reservedVariables, true)) {

src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ public function testAddGetCompilerPass()
260260
$builder->setResourceTracking(false);
261261
$builderCompilerPasses = $builder->getCompiler()->getPassConfig()->getPasses();
262262
$builder->addCompilerPass($this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface'));
263-
$this->assertEquals(sizeof($builderCompilerPasses) + 1, sizeof($builder->getCompiler()->getPassConfig()->getPasses()));
263+
264+
$this->assertCount(count($builder->getCompiler()->getPassConfig()->getPasses()) - 1, $builderCompilerPasses);
264265
}
265266

266267
/**

0 commit comments

Comments
 (0)