Skip to content

Commit 15c436a

Browse files
committed
CS: Apply ternary_to_null_coalescing fixer
1 parent 3ca0178 commit 15c436a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

DependencyInjection/SecurityExtension.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
283283
if (isset($firewall['request_matcher'])) {
284284
$matcher = new Reference($firewall['request_matcher']);
285285
} elseif (isset($firewall['pattern']) || isset($firewall['host'])) {
286-
$pattern = isset($firewall['pattern']) ? $firewall['pattern'] : null;
287-
$host = isset($firewall['host']) ? $firewall['host'] : null;
288-
$methods = isset($firewall['methods']) ? $firewall['methods'] : [];
286+
$pattern = $firewall['pattern'] ?? null;
287+
$host = $firewall['host'] ?? null;
288+
$methods = $firewall['methods'] ?? [];
289289
$matcher = $this->createRequestMatcher($container, $pattern, $host, null, $methods);
290290
}
291291

@@ -394,7 +394,7 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
394394
}
395395

396396
// Determine default entry point
397-
$configuredEntryPoint = isset($firewall['entry_point']) ? $firewall['entry_point'] : null;
397+
$configuredEntryPoint = $firewall['entry_point'] ?? null;
398398

399399
// Authentication listeners
400400
[$authListeners, $defaultEntryPoint] = $this->createAuthenticationListeners($container, $id, $firewall, $authenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint, $contextListenerId);
@@ -415,8 +415,8 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
415415
// Exception listener
416416
$exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $configuredEntryPoint ?: $defaultEntryPoint, $firewall['stateless']));
417417

418-
$config->replaceArgument(8, isset($firewall['access_denied_handler']) ? $firewall['access_denied_handler'] : null);
419-
$config->replaceArgument(9, isset($firewall['access_denied_url']) ? $firewall['access_denied_url'] : null);
418+
$config->replaceArgument(8, $firewall['access_denied_handler'] ?? null);
419+
$config->replaceArgument(9, $firewall['access_denied_url'] ?? null);
420420

421421
$container->setAlias('security.user_checker.'.$id, new Alias($firewall['user_checker'], false));
422422

@@ -430,7 +430,7 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
430430
}
431431

432432
$config->replaceArgument(10, $listenerKeys);
433-
$config->replaceArgument(11, isset($firewall['switch_user']) ? $firewall['switch_user'] : null);
433+
$config->replaceArgument(11, $firewall['switch_user'] ?? null);
434434

435435
return [$matcher, $listeners, $exceptionListener, null !== $logoutListenerId ? new Reference($logoutListenerId) : null];
436436
}

Tests/Functional/AbstractWebTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ protected static function createKernel(array $options = []): KernelInterface
6161
return new $class(
6262
static::getVarDir(),
6363
$options['test_case'],
64-
isset($options['root_config']) ? $options['root_config'] : 'config.yml',
65-
isset($options['environment']) ? $options['environment'] : strtolower(static::getVarDir().$options['test_case']),
66-
isset($options['debug']) ? $options['debug'] : false
64+
$options['root_config'] ?? 'config.yml',
65+
$options['environment'] ?? strtolower(static::getVarDir().$options['test_case']),
66+
$options['debug'] ?? false
6767
);
6868
}
6969

0 commit comments

Comments
 (0)