Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc794e5

Browse filesBrowse files
committed
minor #39632 CS: Apply ternary_to_null_coalescing fixer (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- CS: Apply ternary_to_null_coalescing fixer | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Since we don't need to support PHP 5 anymore, we can upgrade our older code to use the null coalescing operator and enforce its usage through our PHP CS Fixer configuration. I think, the usage of that operator improves the readability of our codebase at lot. Note that the changes in this PR are (with the exception of `.php_cs.dist`) completely automated. You should get the same results by running the following command (and reverting the changes to PhpUnitBridge afterwards). ```sh php-cs-fixer fix --rules='{"ternary_to_null_coalescing":true}' src ``` Commits ------- 07c4773 CS: Apply ternary_to_null_coalescing fixer
2 parents 0ed047f + 07c4773 commit fc794e5
Copy full SHA for fc794e5

File tree

139 files changed

+270
-274
lines changed
Filter options

Some content is hidden

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

139 files changed

+270
-274
lines changed

‎.php_cs.dist

Copy file name to clipboardExpand all lines: .php_cs.dist
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ return PhpCsFixer\Config::create()
1717
'combine_nested_dirname' => true,
1818
'list_syntax' => ['syntax' => 'short'],
1919
'visibility_required' => ['property', 'method', 'const'],
20+
'ternary_to_null_coalescing' => true,
2021
])
2122
->setRiskyAllowed(true)
2223
->setFinder(

‎src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private function findAndSortTags(string $tagName, ContainerBuilder $container):
134134

135135
foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $tags) {
136136
foreach ($tags as $attributes) {
137-
$priority = isset($attributes['priority']) ? $attributes['priority'] : 0;
137+
$priority = $attributes['priority'] ?? 0;
138138
$sortedTags[$priority][] = [$serviceId, $attributes];
139139
}
140140
}

‎src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function validate($entity, Constraint $constraint)
165165
}
166166

167167
$errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0];
168-
$invalidValue = isset($criteria[$errorPath]) ? $criteria[$errorPath] : $criteria[$fields[0]];
168+
$invalidValue = $criteria[$errorPath] ?? $criteria[$fields[0]];
169169

170170
$this->context->buildViolation($constraint->message)
171171
->atPath($errorPath)

‎src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __invoke(array $record)
3838
'priority' => $record['level'],
3939
'priorityName' => $record['level_name'],
4040
'context' => $record['context'],
41-
'channel' => isset($record['channel']) ? $record['channel'] : '',
41+
'channel' => $record['channel'] ?? '',
4242
];
4343

4444
if (!isset($this->errorCount[$hash])) {

‎src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(FragmentHandler $handler)
4242
*/
4343
public function renderFragment($uri, $options = [])
4444
{
45-
$strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
45+
$strategy = $options['strategy'] ?? 'inline';
4646
unset($options['strategy']);
4747

4848
return $this->handler->render($uri, $strategy, $options);

‎src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function compile(Compiler $compiler)
4545
// The "label" function expects the label in the second and
4646
// the variables in the third argument
4747
$label = $arguments[1];
48-
$variables = isset($arguments[2]) ? $arguments[2] : null;
48+
$variables = $arguments[2] ?? null;
4949
$lineno = $label->getTemplateLine();
5050

5151
if ($label instanceof ConstantExpression) {

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected function describeCallable($callable, array $options = [])
144144

145145
protected function describeContainerParameter($parameter, array $options = [])
146146
{
147-
$key = isset($options['parameter']) ? $options['parameter'] : '';
147+
$key = $options['parameter'] ?? '';
148148

149149
$this->writeData([$key => $parameter], $options);
150150
}
@@ -156,7 +156,7 @@ protected function describeContainerEnvVars(array $envs, array $options = [])
156156

157157
private function writeData(array $data, array $options)
158158
{
159-
$flags = isset($options['json_encoding']) ? $options['json_encoding'] : 0;
159+
$flags = $options['json_encoding'] ?? 0;
160160

161161
$this->write(json_encode($data, $flags | \JSON_PRETTY_PRINT)."\n");
162162
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function describeRoute(Route $route, array $options = [])
8484
{
8585
$tableHeaders = ['Property', 'Value'];
8686
$tableRows = [
87-
['Route Name', isset($options['name']) ? $options['name'] : ''],
87+
['Route Name', $options['name'] ?? ''],
8888
['Path', $route->getPath()],
8989
['Path Regex', $route->compile()->getRegex()],
9090
['Host', ('' !== $route->getHost() ? $route->getHost() : 'ANY')],
@@ -150,7 +150,7 @@ protected function describeContainerService($service, array $options = [], Conta
150150
$options['output']->table(
151151
['Service ID', 'Class'],
152152
[
153-
[isset($options['id']) ? $options['id'] : '-', \get_class($service)],
153+
[$options['id'] ?? '-', \get_class($service)],
154154
]
155155
);
156156
}
@@ -159,7 +159,7 @@ protected function describeContainerService($service, array $options = [], Conta
159159
protected function describeContainerServices(ContainerBuilder $builder, array $options = [])
160160
{
161161
$showHidden = isset($options['show_hidden']) && $options['show_hidden'];
162-
$showTag = isset($options['tag']) ? $options['tag'] : null;
162+
$showTag = $options['tag'] ?? null;
163163

164164
if ($showHidden) {
165165
$title = 'Symfony Container Hidden Services';
@@ -223,7 +223,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
223223
foreach ($this->sortByPriority($definition->getTag($showTag)) as $key => $tag) {
224224
$tagValues = [];
225225
foreach ($tagsNames as $tagName) {
226-
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : '';
226+
$tagValues[] = $tag[$tagName] ?? '';
227227
}
228228
if (0 === $key) {
229229
$tableRows[] = array_merge([$serviceId], $tagValues, [$definition->getClass()]);
@@ -257,7 +257,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
257257

258258
$tableHeaders = ['Option', 'Value'];
259259

260-
$tableRows[] = ['Service ID', isset($options['id']) ? $options['id'] : '-'];
260+
$tableRows[] = ['Service ID', $options['id'] ?? '-'];
261261
$tableRows[] = ['Class', $definition->getClass() ?: '-'];
262262

263263
$omitTags = isset($options['omit_tags']) && $options['omit_tags'];

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
3838

3939
protected function describeRoute(Route $route, array $options = [])
4040
{
41-
$this->writeDocument($this->getRouteDocument($route, isset($options['name']) ? $options['name'] : null));
41+
$this->writeDocument($this->getRouteDocument($route, $options['name'] ?? null));
4242
}
4343

4444
protected function describeContainerParameters(ParameterBag $parameters, array $options = [])
@@ -62,18 +62,18 @@ protected function describeContainerService($service, array $options = [], Conta
6262

6363
protected function describeContainerServices(ContainerBuilder $builder, array $options = [])
6464
{
65-
$this->writeDocument($this->getContainerServicesDocument($builder, isset($options['tag']) ? $options['tag'] : null, isset($options['show_hidden']) && $options['show_hidden'], isset($options['show_arguments']) && $options['show_arguments'], isset($options['filter']) ? $options['filter'] : null));
65+
$this->writeDocument($this->getContainerServicesDocument($builder, $options['tag'] ?? null, isset($options['show_hidden']) && $options['show_hidden'], isset($options['show_arguments']) && $options['show_arguments'], $options['filter'] ?? null));
6666
}
6767

6868
protected function describeContainerDefinition(Definition $definition, array $options = [])
6969
{
70-
$this->writeDocument($this->getContainerDefinitionDocument($definition, isset($options['id']) ? $options['id'] : null, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']));
70+
$this->writeDocument($this->getContainerDefinitionDocument($definition, $options['id'] ?? null, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']));
7171
}
7272

7373
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
7474
{
7575
$dom = new \DOMDocument('1.0', 'UTF-8');
76-
$dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias, isset($options['id']) ? $options['id'] : null)->childNodes->item(0), true));
76+
$dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias, $options['id'] ?? null)->childNodes->item(0), true));
7777

7878
if (!$builder) {
7979
$this->writeDocument($dom);

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function process(ContainerBuilder $container)
3434
$collectors = new \SplPriorityQueue();
3535
$order = \PHP_INT_MAX;
3636
foreach ($container->findTaggedServiceIds('data_collector', true) as $id => $attributes) {
37-
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
37+
$priority = $attributes[0]['priority'] ?? 0;
3838
$template = null;
3939

4040
if (isset($attributes[0]['template'])) {

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function load(array $configs, ContainerBuilder $container)
230230
// mark any env vars found in the ide setting as used
231231
$container->resolveEnvPlaceholders($ide);
232232

233-
$container->setParameter('templating.helper.code.file_link_format', str_replace('%', '%%', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) ?: (isset($links[$ide]) ? $links[$ide] : $ide));
233+
$container->setParameter('templating.helper.code.file_link_format', str_replace('%', '%%', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) ?: ($links[$ide] ?? $ide));
234234
}
235235
$container->setParameter('debug.file_link_format', '%templating.helper.code.file_link_format%');
236236
}
@@ -1083,7 +1083,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
10831083
} else {
10841084
// let format fallback to main version_format
10851085
$format = $package['version_format'] ?: $config['version_format'];
1086-
$version = isset($package['version']) ? $package['version'] : null;
1086+
$version = $package['version'] ?? null;
10871087
$version = $this->createVersion($container, $version, $format, $package['json_manifest_path'], $name);
10881088
}
10891089

+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'color']);
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'color']);
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'email']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'email']) ?>

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php if (false !== $label): ?>
2-
<?php if ($required) { $label_attr['class'] = trim((isset($label_attr['class']) ? $label_attr['class'] : '').' required'); } ?>
2+
<?php if ($required) { $label_attr['class'] = trim(($label_attr['class'] ?? '').' required'); } ?>
33
<?php if (!$compound) { $label_attr['for'] = $id; } ?>
44
<?php if (!$label) { $label = isset($label_format)
55
? strtr($label_format, ['%name%' => $name, '%id%' => $id])
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'hidden']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'hidden']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'number']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'number']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'text']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'password']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'password']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?php $symbol = false !== $symbol ? ($symbol ? ' '.$symbol : ' %') : '' ?>
2-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']).$view->escape($symbol) ?>
2+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'text']).$view->escape($symbol) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'range']);
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'range']);
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'button_widget', ['type' => isset($type) ? $type : 'reset']) ?>
1+
<?php echo $view['form']->block($form, 'button_widget', ['type' => $type ?? 'reset']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'search']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'search']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'button_widget', ['type' => isset($type) ? $type : 'submit']) ?>
1+
<?php echo $view['form']->block($form, 'button_widget', ['type' => $type ?? 'submit']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'tel']);
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'tel']);
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'url']) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => $type ?? 'url']) ?>

‎src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(FragmentHandler $handler)
4444
*/
4545
public function render($uri, array $options = [])
4646
{
47-
$strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
47+
$strategy = $options['strategy'] ?? 'inline';
4848
unset($options['strategy']);
4949

5050
return $this->handler->render($uri, $strategy, $options);

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AbstractWebTestCase.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AbstractWebTestCase.php
+3-3Lines 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

‎src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ private function getParameterBag(array $params = []): ContainerInterface
551551
->expects($this->any())
552552
->method('get')
553553
->willReturnCallback(function ($key) use ($params) {
554-
return isset($params[$key]) ? $params[$key] : null;
554+
return $params[$key] ?? null;
555555
})
556556
;
557557

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<?php $type = isset($type) ? $type : 'text'; ?>
1+
<?php $type = $type ?? 'text'; ?>
22
<input type="<?php echo $type; ?>" <?php $view['form']->block($form, 'widget_attributes'); ?> value="<?php echo $value; ?>" rel="theme" />

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+7-7Lines 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
}

‎src/Symfony/Bundle/SecurityBundle/Tests/Functional/AbstractWebTestCase.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Functional/AbstractWebTestCase.php
+3-3Lines 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

‎src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function showAction(Request $request, FlattenException $exception, DebugL
6767
(string) $this->findTemplate($request, $request->getRequestFormat(), $code, $showException),
6868
[
6969
'status_code' => $code,
70-
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',
70+
'status_text' => Response::$statusTexts[$code] ?? '',
7171
'exception' => $exception,
7272
'logger' => $logger,
7373
'currentContent' => $currentContent,

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function process(ContainerBuilder $container)
3333
$found = 0;
3434

3535
foreach ($container->findTaggedServiceIds('twig.loader', true) as $id => $attributes) {
36-
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
36+
$priority = $attributes[0]['priority'] ?? 0;
3737
$prioritizedLoaders[$priority][] = $id;
3838
++$found;
3939
}

‎src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ private function renderWithCspNonces(Request $request, string $template, array $
403403

404404
$nonces = $this->cspHandler ? $this->cspHandler->getNonces($request, $response) : [];
405405

406-
$variables['csp_script_nonce'] = isset($nonces['csp_script_nonce']) ? $nonces['csp_script_nonce'] : null;
407-
$variables['csp_style_nonce'] = isset($nonces['csp_style_nonce']) ? $nonces['csp_style_nonce'] : null;
406+
$variables['csp_script_nonce'] = $nonces['csp_script_nonce'] ?? null;
407+
$variables['csp_style_nonce'] = $nonces['csp_style_nonce'] ?? null;
408408

409409
$response->setContent($this->twig->render($template, $variables));
410410

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.