Skip to content

Commit 305276c

Browse files
committed
Replaced ternaries with null coalescing operator
1 parent b5e7084 commit 305276c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Escaper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(string $delimiter = '/')
4343
*/
4444
public function escapeCharacterClass(string $char): string
4545
{
46-
return (isset($this->inCharacterClass[$char])) ? $this->inCharacterClass[$char] : $char;
46+
return $this->inCharacterClass[$char] ?? $char;
4747
}
4848

4949
/**
@@ -54,6 +54,6 @@ public function escapeCharacterClass(string $char): string
5454
*/
5555
public function escapeLiteral(string $char): string
5656
{
57-
return (isset($this->inLiteral[$char])) ? $this->inLiteral[$char] : $char;
57+
return $this->inLiteral[$char] ?? $char;
5858
}
5959
}

src/Output/PrintableAscii.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function escapeControlCode(int $cp): string
4343
{
4444
$table = [9 => '\\t', 10 => '\\n', 13 => '\\r'];
4545

46-
return (isset($table[$cp])) ? $table[$cp] : $this->escapeAscii($cp);
46+
return $table[$cp] ?? $this->escapeAscii($cp);
4747
}
4848

4949
/**

0 commit comments

Comments
 (0)