Skip to content

Commit 94ae14e

Browse files
committed
CS: Apply ternary_to_null_coalescing fixer
1 parent ef2f7dd commit 94ae14e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ public static function handleFatalError(array $error = null): void
659659
if ($error && $error['type'] &= \E_PARSE | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR) {
660660
// Let's not throw anymore but keep logging
661661
$handler->throwAt(0, true);
662-
$trace = isset($error['backtrace']) ? $error['backtrace'] : null;
662+
$trace = $error['backtrace'] ?? null;
663663

664664
if (0 === strpos($error['message'], 'Allowed memory') || 0 === strpos($error['message'], 'Out of memory')) {
665665
$fatalError = new OutOfMemoryError($handler->levels[$error['type']].': '.$error['message'], 0, $error, 2, false, $trace);

Exception/FlattenException.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@ public function setTrace($trace, $file, $line): self
309309
$this->trace[] = [
310310
'namespace' => $namespace,
311311
'short_class' => $class,
312-
'class' => isset($entry['class']) ? $entry['class'] : '',
313-
'type' => isset($entry['type']) ? $entry['type'] : '',
314-
'function' => isset($entry['function']) ? $entry['function'] : null,
315-
'file' => isset($entry['file']) ? $entry['file'] : null,
316-
'line' => isset($entry['line']) ? $entry['line'] : null,
312+
'class' => $entry['class'] ?? '',
313+
'type' => $entry['type'] ?? '',
314+
'function' => $entry['function'] ?? null,
315+
'file' => $entry['file'] ?? null,
316+
'line' => $entry['line'] ?? null,
317317
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : [],
318318
];
319319
}

0 commit comments

Comments
 (0)