Skip to content

Commit 15eefe4

Browse files
committed
minor #42165 Simplify some code with null coalesce operator (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Simplify some code with null coalesce operator | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - For your consideration. There are many other possible usages of null coalesce operator, but the result is not very readable ... so this PR only contains the changes where the result is clearly better. Commits ------- 17ad5b75fa Simplify some code with null coalesce operator
2 parents a96e44e + 991fcb3 commit 15eefe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Event/ConsoleErrorEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function setExitCode(int $exitCode): void
5353

5454
public function getExitCode(): int
5555
{
56-
return null !== $this->exitCode ? $this->exitCode : (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
56+
return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
5757
}
5858
}

0 commit comments

Comments
 (0)