Skip to content

Commit

Permalink
Apply php-cs-fixer rule for array_key_exists()
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Feb 23, 2019
1 parent 204efa2 commit 4dcd928
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Command/ConfigDebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function getConfigForPath(array $config, $path, $alias)
$steps = explode('.', $path);

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

Expand Down
2 changes: 1 addition & 1 deletion Console/Descriptor/JsonDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null), $options);
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null), $options);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Console/Descriptor/MarkdownDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ protected function describeContainerParameter($parameter, array $options = [])
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$event = array_key_exists('event', $options) ? $options['event'] : null;
$event = \array_key_exists('event', $options) ? $options['event'] : null;

$title = 'Registered listeners';
if (null !== $event) {
Expand Down
2 changes: 1 addition & 1 deletion Console/Descriptor/TextDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ protected function describeContainerParameter($parameter, array $options = [])
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$event = array_key_exists('event', $options) ? $options['event'] : null;
$event = \array_key_exists('event', $options) ? $options['event'] : null;

if (null !== $event) {
$title = sprintf('Registered Listeners for "%s" Event', $event);
Expand Down
2 changes: 1 addition & 1 deletion Console/Descriptor/XmlDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null));
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
}

foreach ($transitions as $name => $transition) {
if (array_key_exists('name', $transition)) {
if (\array_key_exists('name', $transition)) {
continue;
}
$transition['name'] = $name;
Expand Down
8 changes: 4 additions & 4 deletions DependencyInjection/FrameworkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
$registryDefinition = $container->getDefinition('workflow.registry');

foreach ($config['workflows'] as $name => $workflow) {
if (!array_key_exists('type', $workflow)) {
if (!\array_key_exists('type', $workflow)) {
$workflow['type'] = 'workflow';
@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);
}
Expand Down Expand Up @@ -1052,7 +1052,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
foreach ($config['packages'] as $name => $package) {
if (null !== $package['version_strategy']) {
$version = new Reference($package['version_strategy']);
} elseif (!array_key_exists('version', $package) && null === $package['json_manifest_path']) {
} elseif (!\array_key_exists('version', $package) && null === $package['json_manifest_path']) {
// if neither version nor json_manifest_path are specified, use the default
$version = $defaultVersion;
} else {
Expand Down Expand Up @@ -1273,15 +1273,15 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
$definition = $container->findDefinition('validator.email');
$definition->replaceArgument(0, $config['strict_email']);

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

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

if (array_key_exists('static_method', $config) && $config['static_method']) {
if (\array_key_exists('static_method', $config) && $config['static_method']) {
foreach ($config['static_method'] as $methodName) {
$validatorBuilder->addMethodCall('addMethodMapping', [$methodName]);
}
Expand Down

0 comments on commit 4dcd928

Please sign in to comment.