Merge branch '3.4' into 4.1
* 3.4: Fixed typo Fix ini_get() for boolean values SCA: fixed broken tests SCA: applied code style as per guidelines SCA: minor code tweaks
This commit is contained in:
commit
3e8a423047
@ -769,10 +769,8 @@ class FrameworkExtension extends Extension
|
|||||||
if ($config['formats']) {
|
if ($config['formats']) {
|
||||||
$loader->load('request.xml');
|
$loader->load('request.xml');
|
||||||
|
|
||||||
$container
|
$listener = $container->getDefinition('request.add_request_formats_listener');
|
||||||
->getDefinition('request.add_request_formats_listener')
|
$listener->replaceArgument(0, $config['formats']);
|
||||||
->replaceArgument(0, $config['formats'])
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ class ResourceCheckerConfigCache implements ConfigCacheInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
|
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
|
||||||
@opcache_invalidate($this->file, true);
|
@opcache_invalidate($this->file, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ class XmlUtils
|
|||||||
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
|
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
|
||||||
case preg_match('/^0x[0-9a-f]++$/i', $value):
|
case preg_match('/^0x[0-9a-f]++$/i', $value):
|
||||||
return hexdec($value);
|
return hexdec($value);
|
||||||
case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):
|
case preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value):
|
||||||
return (float) $value;
|
return (float) $value;
|
||||||
default:
|
default:
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -45,7 +45,7 @@ class Debug
|
|||||||
if (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
|
if (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
|
||||||
ini_set('display_errors', 0);
|
ini_set('display_errors', 0);
|
||||||
ExceptionHandler::register();
|
ExceptionHandler::register();
|
||||||
} elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
|
} elseif ($displayErrors && (!filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN) || ini_get('error_log'))) {
|
||||||
// CLI - display errors only if they're not already logged to STDERR
|
// CLI - display errors only if they're not already logged to STDERR
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
}
|
}
|
||||||
|
@ -611,9 +611,9 @@ class XmlFileLoaderTest extends TestCase
|
|||||||
$resources = $container->getResources();
|
$resources = $container->getResources();
|
||||||
|
|
||||||
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
|
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
|
||||||
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
|
|
||||||
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '/*', true), $resources));
|
|
||||||
$resources = array_map('strval', $resources);
|
$resources = array_map('strval', $resources);
|
||||||
|
$this->assertContains((string) (new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml')), $resources);
|
||||||
|
$this->assertContains((string) (new GlobResource($fixturesDir.'Prototype', '/*', true)), $resources);
|
||||||
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
|
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
|
||||||
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
|
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
|
||||||
}
|
}
|
||||||
|
@ -364,9 +364,9 @@ class YamlFileLoaderTest extends TestCase
|
|||||||
$resources = $container->getResources();
|
$resources = $container->getResources();
|
||||||
|
|
||||||
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
|
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
|
||||||
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml'), $resources));
|
|
||||||
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '', true), $resources));
|
|
||||||
$resources = array_map('strval', $resources);
|
$resources = array_map('strval', $resources);
|
||||||
|
$this->assertContains((string) (new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml')), $resources);
|
||||||
|
$this->assertContains((string) (new GlobResource($fixturesDir.'Prototype', '', true)), $resources);
|
||||||
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
|
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
|
||||||
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
|
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
|
||||||
}
|
}
|
||||||
|
@ -933,7 +933,7 @@ class Response
|
|||||||
public function setCache(array $options)
|
public function setCache(array $options)
|
||||||
{
|
{
|
||||||
if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'))) {
|
if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'))) {
|
||||||
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff))));
|
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['etag'])) {
|
if (isset($options['etag'])) {
|
||||||
|
@ -68,8 +68,8 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
|||||||
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
|
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
|
||||||
'php_timezone' => date_default_timezone_get(),
|
'php_timezone' => date_default_timezone_get(),
|
||||||
'xdebug_enabled' => \extension_loaded('xdebug'),
|
'xdebug_enabled' => \extension_loaded('xdebug'),
|
||||||
'apcu_enabled' => \extension_loaded('apcu') && ini_get('apc.enabled'),
|
'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN),
|
||||||
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
|
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN),
|
||||||
'bundles' => array(),
|
'bundles' => array(),
|
||||||
'sapi_name' => \PHP_SAPI,
|
'sapi_name' => \PHP_SAPI,
|
||||||
);
|
);
|
||||||
|
@ -39,8 +39,8 @@ class ConfigDataCollectorTest extends TestCase
|
|||||||
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
|
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
|
||||||
$this->assertNull($c->getToken());
|
$this->assertNull($c->getToken());
|
||||||
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
|
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
|
||||||
$this->assertSame(\extension_loaded('Zend OPcache') && ini_get('opcache.enable'), $c->hasZendOpcache());
|
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)), $c->hasZendOpcache());
|
||||||
$this->assertSame(\extension_loaded('apcu') && ini_get('apc.enabled'), $c->hasApcu());
|
$this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN)), $c->hasApcu());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user