Skip to content

Commit

Permalink
#179 removed else branch in ValidTernary
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGoryunov committed Jul 6, 2022
1 parent 8fc61b0 commit 26d10c9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ValidTernary.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ public function __construct(

public function value(): mixed
{
if ($this->origin->valid()) {
$path = $this->cons;
} else {
$path = $this->alter;
}
return $path($this->origin);
return (
($this->origin->valid()) ?
$this->cons :
$this->alter
)($this->origin);
}
}

0 comments on commit 26d10c9

Please sign in to comment.