Skip to content

Commit b0a3208

Browse files
Apply php-cs-fixer rule for array_key_exists()
1 parent af66641 commit b0a3208

File tree

88 files changed

+157
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+157
-157
lines changed

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ protected function getMetadata($class)
157157
// normalize class name
158158
$class = ClassUtils::getRealClass(ltrim($class, '\\'));
159159

160-
if (array_key_exists($class, $this->cache)) {
160+
if (\array_key_exists($class, $this->cache)) {
161161
return $this->cache[$class];
162162
}
163163

src/Symfony/Bridge/Twig/NodeVisitor/Scope.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function set($key, $value)
7777
*/
7878
public function has($key)
7979
{
80-
if (array_key_exists($key, $this->data)) {
80+
if (\array_key_exists($key, $this->data)) {
8181
return true;
8282
}
8383

@@ -98,7 +98,7 @@ public function has($key)
9898
*/
9999
public function get($key, $default = null)
100100
{
101-
if (array_key_exists($key, $this->data)) {
101+
if (\array_key_exists($key, $this->data)) {
102102
return $this->data[$key];
103103
}
104104

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private function getConfigForPath(array $config, $path, $alias)
139139
$steps = explode('.', $path);
140140

141141
foreach ($steps as $step) {
142-
if (!array_key_exists($step, $config)) {
142+
if (!\array_key_exists($step, $config)) {
143143
throw new LogicException(sprintf('Unable to find configuration for "%s.%s"', $alias, $path));
144144
}
145145

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
156156
*/
157157
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
158158
{
159-
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null), $options);
159+
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null), $options);
160160
}
161161

162162
/**

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ protected function describeContainerParameter($parameter, array $options = [])
275275
*/
276276
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
277277
{
278-
$event = array_key_exists('event', $options) ? $options['event'] : null;
278+
$event = \array_key_exists('event', $options) ? $options['event'] : null;
279279

280280
$title = 'Registered listeners';
281281
if (null !== $event) {

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ protected function describeContainerParameter($parameter, array $options = [])
385385
*/
386386
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
387387
{
388-
$event = array_key_exists('event', $options) ? $options['event'] : null;
388+
$event = \array_key_exists('event', $options) ? $options['event'] : null;
389389

390390
if (null !== $event) {
391391
$title = sprintf('Registered Listeners for "%s" Event', $event);

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
111111
*/
112112
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
113113
{
114-
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null));
114+
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null));
115115
}
116116

117117
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
371371
}
372372

373373
foreach ($transitions as $name => $transition) {
374-
if (array_key_exists('name', $transition)) {
374+
if (\array_key_exists('name', $transition)) {
375375
continue;
376376
}
377377
$transition['name'] = $name;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
602602
$registryDefinition = $container->getDefinition('workflow.registry');
603603

604604
foreach ($config['workflows'] as $name => $workflow) {
605-
if (!array_key_exists('type', $workflow)) {
605+
if (!\array_key_exists('type', $workflow)) {
606606
$workflow['type'] = 'workflow';
607607
@trigger_error(sprintf('The "type" option of the "framework.workflows.%s" configuration entry must be defined since Symfony 3.3. The default value will be "state_machine" in Symfony 4.0.', $name), E_USER_DEPRECATED);
608608
}
@@ -1052,7 +1052,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
10521052
foreach ($config['packages'] as $name => $package) {
10531053
if (null !== $package['version_strategy']) {
10541054
$version = new Reference($package['version_strategy']);
1055-
} elseif (!array_key_exists('version', $package) && null === $package['json_manifest_path']) {
1055+
} elseif (!\array_key_exists('version', $package) && null === $package['json_manifest_path']) {
10561056
// if neither version nor json_manifest_path are specified, use the default
10571057
$version = $defaultVersion;
10581058
} else {
@@ -1273,15 +1273,15 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
12731273
$definition = $container->findDefinition('validator.email');
12741274
$definition->replaceArgument(0, $config['strict_email']);
12751275

1276-
if (array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
1276+
if (\array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
12771277
if (!$this->annotationsConfigEnabled) {
12781278
throw new \LogicException('"enable_annotations" on the validator cannot be set as Annotations support is disabled.');
12791279
}
12801280

12811281
$validatorBuilder->addMethodCall('enableAnnotationMapping', [new Reference('annotation_reader')]);
12821282
}
12831283

1284-
if (array_key_exists('static_method', $config) && $config['static_method']) {
1284+
if (\array_key_exists('static_method', $config) && $config['static_method']) {
12851285
foreach ($config['static_method'] as $methodName) {
12861286
$validatorBuilder->addMethodCall('addMethodMapping', [$methodName]);
12871287
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
479479
foreach ($this->factories as $position) {
480480
foreach ($position as $factory) {
481481
$key = str_replace('-', '_', $factory->getKey());
482-
if (array_key_exists($key, $firewall)) {
482+
if (\array_key_exists($key, $firewall)) {
483483
$listenerKeys[] = $key;
484484
}
485485
}

0 commit comments

Comments
 (0)