diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
index 4ad140e6c6547..d80ca9f86cf0a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -314,7 +314,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
->end()
->end()
->validate()
- ->ifTrue(function ($v) { return isset($v['type']) && isset($v['service']); })
+ ->ifTrue(function ($v) { return isset($v['type'], $v['service']); })
->thenInvalid('"type" and "service" cannot be used together.')
->end()
->validate()
@@ -610,19 +610,19 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode)
->end()
->validate()
->ifTrue(function ($v) {
- return isset($v['version_strategy']) && isset($v['version']);
+ return isset($v['version_strategy'], $v['version']);
})
->thenInvalid('You cannot use both "version_strategy" and "version" at the same time under "assets".')
->end()
->validate()
->ifTrue(function ($v) {
- return isset($v['version_strategy']) && isset($v['json_manifest_path']);
+ return isset($v['version_strategy'], $v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets".')
->end()
->validate()
->ifTrue(function ($v) {
- return isset($v['version']) && isset($v['json_manifest_path']);
+ return isset($v['version'], $v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version" and "json_manifest_path" at the same time under "assets".')
->end()
@@ -654,19 +654,19 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode)
->end()
->validate()
->ifTrue(function ($v) {
- return isset($v['version_strategy']) && isset($v['version']);
+ return isset($v['version_strategy'], $v['version']);
})
->thenInvalid('You cannot use both "version_strategy" and "version" at the same time under "assets" packages.')
->end()
->validate()
->ifTrue(function ($v) {
- return isset($v['version_strategy']) && isset($v['json_manifest_path']);
+ return isset($v['version_strategy'], $v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets" packages.')
->end()
->validate()
->ifTrue(function ($v) {
- return isset($v['version']) && isset($v['json_manifest_path']);
+ return isset($v['version'], $v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.')
->end()
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
index 6cdb9deb8f93f..f663b0f5c6710 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
@@ -91,7 +91,7 @@ public function getConfigTreeBuilder()
->booleanNode('allow_if_equal_granted_denied')->defaultTrue()->end()
->end()
->validate()
- ->ifTrue(function ($v) { return isset($v['strategy']) && isset($v['service']); })
+ ->ifTrue(function ($v) { return isset($v['strategy'], $v['service']); })
->thenInvalid('"strategy" and "service" cannot be used together.')
->end()
->end()
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
index ed4f46c0b6407..bc21b789e139e 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
@@ -156,7 +156,7 @@ public function load(array $configs, ContainerBuilder $container)
$config['extensions']
);
- if (isset($config['autoescape_service']) && isset($config['autoescape_service_method'])) {
+ if (isset($config['autoescape_service'], $config['autoescape_service_method'])) {
$config['autoescape'] = array(new Reference($config['autoescape_service']), $config['autoescape_service_method']);
}
unset($config['autoescape_service'], $config['autoescape_service_method']);
diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php
index f18ee2a9f0923..2ebcdfb91cdb0 100644
--- a/src/Symfony/Component/Debug/ExceptionHandler.php
+++ b/src/Symfony/Component/Debug/ExceptionHandler.php
@@ -242,7 +242,7 @@ public function getContent(FlattenException $exception)
if ($trace['function']) {
$content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args']));
}
- if (isset($trace['file']) && isset($trace['line'])) {
+ if (isset($trace['file'], $trace['line'])) {
$content .= $this->formatPath($trace['file'], $trace['line']);
}
$content .= "\n";
diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
index 48cfde60dd49d..aa1f0bacc6d45 100644
--- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
@@ -616,7 +616,7 @@ private function parseCallable($callable, $parameter, $id, $file)
}
if (\is_array($callable)) {
- if (isset($callable[0]) && isset($callable[1])) {
+ if (isset($callable[0], $callable[1])) {
return array($this->resolveServices($callable[0], $file), $callable[1]);
}
diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php
index 08151cbf8cfa1..9534227243be0 100644
--- a/src/Symfony/Component/Filesystem/Filesystem.php
+++ b/src/Symfony/Component/Filesystem/Filesystem.php
@@ -489,7 +489,7 @@ public function makePathRelative($endPath, $startPath)
// Find for which directory the common path stops
$index = 0;
- while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) {
+ while (isset($startPathArr[$index], $endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) {
++$index;
}
diff --git a/src/Symfony/Component/Form/FormFactory.php b/src/Symfony/Component/Form/FormFactory.php
index 3f18ccf3259c3..ab8f933e70f00 100644
--- a/src/Symfony/Component/Form/FormFactory.php
+++ b/src/Symfony/Component/Form/FormFactory.php
@@ -117,7 +117,7 @@ public function createBuilderForProperty($class, $property, $data = null, array
if ($typeGuess) {
$attrs = array();
$typeGuessOptions = $typeGuess->getOptions();
- if (isset($typeGuessOptions['attr']) && isset($options['attr'])) {
+ if (isset($typeGuessOptions['attr'], $options['attr'])) {
$attrs = array('attr' => array_merge($typeGuessOptions['attr'], $options['attr']));
}
diff --git a/src/Symfony/Component/Form/FormRenderer.php b/src/Symfony/Component/Form/FormRenderer.php
index 3bc7bc909b6f3..415a637e13579 100644
--- a/src/Symfony/Component/Form/FormRenderer.php
+++ b/src/Symfony/Component/Form/FormRenderer.php
@@ -97,12 +97,12 @@ public function renderBlock(FormView $view, $blockName, array $variables = array
}
// Merge the passed with the existing attributes
- if (isset($variables['attr']) && isset($scopeVariables['attr'])) {
+ if (isset($variables['attr'], $scopeVariables['attr'])) {
$variables['attr'] = array_replace($scopeVariables['attr'], $variables['attr']);
}
// Merge the passed with the exist *label* attributes
- if (isset($variables['label_attr']) && isset($scopeVariables['label_attr'])) {
+ if (isset($variables['label_attr'], $scopeVariables['label_attr'])) {
$variables['label_attr'] = array_replace($scopeVariables['label_attr'], $variables['label_attr']);
}
@@ -227,12 +227,12 @@ public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $va
}
// Merge the passed with the existing attributes
- if (isset($variables['attr']) && isset($scopeVariables['attr'])) {
+ if (isset($variables['attr'], $scopeVariables['attr'])) {
$variables['attr'] = array_replace($scopeVariables['attr'], $variables['attr']);
}
// Merge the passed with the exist *label* attributes
- if (isset($variables['label_attr']) && isset($scopeVariables['label_attr'])) {
+ if (isset($variables['label_attr'], $scopeVariables['label_attr'])) {
$variables['label_attr'] = array_replace($scopeVariables['label_attr'], $variables['label_attr']);
}
diff --git a/src/Symfony/Component/Routing/Loader/YamlFileLoader.php b/src/Symfony/Component/Routing/Loader/YamlFileLoader.php
index d6511daac963b..4c09d1ed1f755 100644
--- a/src/Symfony/Component/Routing/Loader/YamlFileLoader.php
+++ b/src/Symfony/Component/Routing/Loader/YamlFileLoader.php
@@ -205,7 +205,7 @@ protected function validate($config, $name, $path)
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
throw new \InvalidArgumentException(sprintf('The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".', $path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys)));
}
- if (isset($config['resource']) && isset($config['path'])) {
+ if (isset($config['resource'], $config['path'])) {
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "resource" key and the "path" key for "%s". Choose between an import and a route definition.', $path, $name));
}
if (!isset($config['resource']) && isset($config['type'])) {
@@ -214,7 +214,7 @@ protected function validate($config, $name, $path)
if (!isset($config['resource']) && !isset($config['path'])) {
throw new \InvalidArgumentException(sprintf('You must define a "path" for the route "%s" in file "%s".', $name, $path));
}
- if (isset($config['controller']) && isset($config['defaults']['_controller'])) {
+ if (isset($config['controller'], $config['defaults']['_controller'])) {
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "controller" key and the defaults key "_controller" for "%s".', $path, $name));
}
}
diff --git a/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
index 43754b52f1fb1..d7811d72166ed 100644
--- a/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
@@ -180,7 +180,7 @@ public function __construct($header)
$this->header = $header;
preg_match_all('/(\w+)=("((?:[^"\\\\]|\\\\.)+)"|([^\s,$]+))/', $header, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
- if (isset($match[1]) && isset($match[3])) {
+ if (isset($match[1], $match[3])) {
$this->elements[$match[1]] = isset($match[4]) ? $match[4] : $match[3];
}
}
diff --git a/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php b/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php
index 71af8eadc42e1..b1c39d60425f2 100644
--- a/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php
+++ b/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php
@@ -68,9 +68,7 @@ public function supportsDecoding($format/*, array $context = array()*/)
*/
private function getDecoder($format, array $context)
{
- if (isset($this->decoderByFormat[$format])
- && isset($this->decoders[$this->decoderByFormat[$format]])
- ) {
+ if (isset($this->decoderByFormat[$format], $this->decoders[$this->decoderByFormat[$format]])) {
return $this->decoders[$this->decoderByFormat[$format]];
}
diff --git a/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php b/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php
index 6e2b85bf27ee3..4a75a96ecad77 100644
--- a/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php
+++ b/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php
@@ -92,9 +92,7 @@ public function needsNormalization($format/*, array $context = array()*/)
*/
private function getEncoder($format, array $context)
{
- if (isset($this->encoderByFormat[$format])
- && isset($this->encoders[$this->encoderByFormat[$format]])
- ) {
+ if (isset($this->encoderByFormat[$format], $this->encoders[$this->encoderByFormat[$format]])) {
return $this->encoders[$this->encoderByFormat[$format]];
}
diff --git a/src/Symfony/Component/Validator/Constraints/AbstractComparison.php b/src/Symfony/Component/Validator/Constraints/AbstractComparison.php
index 0a7e2f3fb733e..0c27b894e25c7 100644
--- a/src/Symfony/Component/Validator/Constraints/AbstractComparison.php
+++ b/src/Symfony/Component/Validator/Constraints/AbstractComparison.php
@@ -41,7 +41,7 @@ public function __construct($options = null)
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires either the "value" or "propertyPath" option to be set.', \get_class($this)));
}
- if (isset($options['value']) && isset($options['propertyPath'])) {
+ if (isset($options['value'], $options['propertyPath'])) {
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "value" or "propertyPath" options to be set, not both.', \get_class($this)));
}