Skip to content

Commit 2021c68

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: CS: Apply ternary_to_null_coalescing fixer
2 parents 2f7650a + 2455a11 commit 2021c68

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

DataCollector/ConfigDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function getPhpVersion()
180180
*/
181181
public function getPhpVersionExtra()
182182
{
183-
return isset($this->data['php_version_extra']) ? $this->data['php_version_extra'] : null;
183+
return $this->data['php_version_extra'] ?? null;
184184
}
185185

186186
/**

DataCollector/LoggerDataCollector.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,32 @@ public function lateCollect()
7979

8080
public function getLogs()
8181
{
82-
return isset($this->data['logs']) ? $this->data['logs'] : [];
82+
return $this->data['logs'] ?? [];
8383
}
8484

8585
public function getPriorities()
8686
{
87-
return isset($this->data['priorities']) ? $this->data['priorities'] : [];
87+
return $this->data['priorities'] ?? [];
8888
}
8989

9090
public function countErrors()
9191
{
92-
return isset($this->data['error_count']) ? $this->data['error_count'] : 0;
92+
return $this->data['error_count'] ?? 0;
9393
}
9494

9595
public function countDeprecations()
9696
{
97-
return isset($this->data['deprecation_count']) ? $this->data['deprecation_count'] : 0;
97+
return $this->data['deprecation_count'] ?? 0;
9898
}
9999

100100
public function countWarnings()
101101
{
102-
return isset($this->data['warning_count']) ? $this->data['warning_count'] : 0;
102+
return $this->data['warning_count'] ?? 0;
103103
}
104104

105105
public function countScreams()
106106
{
107-
return isset($this->data['scream_count']) ? $this->data['scream_count'] : 0;
107+
return $this->data['scream_count'] ?? 0;
108108
}
109109

110110
public function getCompilerLogs()

DataCollector/RequestDataCollector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function collect(Request $request, Response $response, \Throwable $except
8686
'format' => $request->getRequestFormat(),
8787
'content' => $content,
8888
'content_type' => $response->headers->get('Content-Type', 'text/html'),
89-
'status_text' => isset(Response::$statusTexts[$statusCode]) ? Response::$statusTexts[$statusCode] : '',
89+
'status_text' => Response::$statusTexts[$statusCode] ?? '',
9090
'status_code' => $statusCode,
9191
'request_query' => $request->query->all(),
9292
'request_request' => $request->request->all(),
@@ -337,12 +337,12 @@ public function getController()
337337
*/
338338
public function getRedirect()
339339
{
340-
return isset($this->data['redirect']) ? $this->data['redirect'] : false;
340+
return $this->data['redirect'] ?? false;
341341
}
342342

343343
public function getForwardToken()
344344
{
345-
return isset($this->data['forward_token']) ? $this->data['forward_token'] : null;
345+
return $this->data['forward_token'] ?? null;
346346
}
347347

348348
public function onKernelController(ControllerEvent $event)

EventListener/RouterListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function onKernelRequest(RequestEvent $event)
116116

117117
if (null !== $this->logger) {
118118
$this->logger->info('Matched route "{route}".', [
119-
'route' => isset($parameters['_route']) ? $parameters['_route'] : 'n/a',
119+
'route' => $parameters['_route'] ?? 'n/a',
120120
'route_parameters' => $parameters,
121121
'request_uri' => $request->getUri(),
122122
'method' => $request->getMethod(),

Fragment/AbstractSurrogateFragmentRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ public function render($uri, Request $request, array $options = [])
7171
$uri = $this->generateSignedFragmentUri($uri, $request);
7272
}
7373

74-
$alt = isset($options['alt']) ? $options['alt'] : null;
74+
$alt = $options['alt'] ?? null;
7575
if ($alt instanceof ControllerReference) {
7676
$alt = $this->generateSignedFragmentUri($alt, $request);
7777
}
7878

79-
$tag = $this->surrogate->renderIncludeTag($uri, $alt, isset($options['ignore_errors']) ? $options['ignore_errors'] : false, isset($options['comment']) ? $options['comment'] : '');
79+
$tag = $this->surrogate->renderIncludeTag($uri, $alt, $options['ignore_errors'] ?? false, $options['comment'] ?? '');
8080

8181
return new Response($tag);
8282
}

Fragment/HIncludeFragmentRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function render($uri, Request $request, array $options = [])
7373
// We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.
7474
$uri = str_replace('&', '&', $uri);
7575

76-
$template = isset($options['default']) ? $options['default'] : $this->globalDefaultTemplate;
76+
$template = $options['default'] ?? $this->globalDefaultTemplate;
7777
if (null !== $this->twig && $template && $this->twig->getLoader()->exists($template)) {
7878
$content = $this->twig->render($template);
7979
} else {

HttpCache/Esi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function process(Request $request, Response $response)
9797

9898
$chunks[$i] = sprintf('<?php echo $this->surrogate->handle($this, %s, %s, %s) ?>'."\n",
9999
var_export($options['src'], true),
100-
var_export(isset($options['alt']) ? $options['alt'] : '', true),
100+
var_export($options['alt'] ?? '', true),
101101
isset($options['onerror']) && 'continue' === $options['onerror'] ? 'true' : 'false'
102102
);
103103
++$i;

HttpCache/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ private function requestsMatch(?string $vary, array $env1, array $env2): bool
277277

278278
foreach (preg_split('/[\s,]+/', $vary) as $header) {
279279
$key = str_replace('_', '-', strtolower($header));
280-
$v1 = isset($env1[$key]) ? $env1[$key] : null;
281-
$v2 = isset($env2[$key]) ? $env2[$key] : null;
280+
$v1 = $env1[$key] ?? null;
281+
$v2 = $env2[$key] ?? null;
282282
if ($v1 !== $v2) {
283283
return false;
284284
}

Log/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(string $minLevel = null, $output = null, callable $f
4343
$minLevel = null === $output || 'php://stdout' === $output || 'php://stderr' === $output ? LogLevel::ERROR : LogLevel::WARNING;
4444

4545
if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) {
46-
switch ((int) (isset($_ENV['SHELL_VERBOSITY']) ? $_ENV['SHELL_VERBOSITY'] : $_SERVER['SHELL_VERBOSITY'])) {
46+
switch ((int) ($_ENV['SHELL_VERBOSITY'] ?? $_SERVER['SHELL_VERBOSITY'])) {
4747
case -1: $minLevel = LogLevel::ERROR; break;
4848
case 1: $minLevel = LogLevel::NOTICE; break;
4949
case 2: $minLevel = LogLevel::INFO; break;

UriSigner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ private function buildUrl(array $url, array $params = []): string
9999
$url['query'] = http_build_query($params, '', '&');
100100

101101
$scheme = isset($url['scheme']) ? $url['scheme'].'://' : '';
102-
$host = isset($url['host']) ? $url['host'] : '';
102+
$host = $url['host'] ?? '';
103103
$port = isset($url['port']) ? ':'.$url['port'] : '';
104-
$user = isset($url['user']) ? $url['user'] : '';
104+
$user = $url['user'] ?? '';
105105
$pass = isset($url['pass']) ? ':'.$url['pass'] : '';
106106
$pass = ($user || $pass) ? "$pass@" : '';
107-
$path = isset($url['path']) ? $url['path'] : '';
107+
$path = $url['path'] ?? '';
108108
$query = isset($url['query']) && $url['query'] ? '?'.$url['query'] : '';
109109
$fragment = isset($url['fragment']) ? '#'.$url['fragment'] : '';
110110

0 commit comments

Comments
 (0)