Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class NoIssetOnExpr
{
public function run($backedEnumClassName, $backedEnumValue)
{
if ($backedEnumClassName::tryFrom($backedEnumValue) !== null) {
if ($backedEnumClassName::tryFrom($backedEnumValue) === null) {
throw new \Symfony\Component\DependencyInjection\Exception\RuntimeException(sprintf('Enum value "%s" is not backed by "%s".', $backedEnumValue, $backedEnumClassName));
}
return $backedEnumClassName::tryFrom($backedEnumValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\BinaryOp\Coalesce;
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
use PhpParser\Node\Expr\BooleanNot;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\ConstFetch;
Expand Down Expand Up @@ -253,7 +252,7 @@ private function createIf(Coalesce $coalesce, Throw_ $throw): If_
if ($conditionalExpr instanceof Variable || $conditionalExpr instanceof ArrayDimFetch || $conditionalExpr instanceof PropertyFetch) {
$booleanNot = new BooleanNot(new Isset_([$conditionalExpr]));
} else {
$booleanNot = new NotIdentical($conditionalExpr, new ConstFetch(new Name('null')));
$booleanNot = new Identical($conditionalExpr, new ConstFetch(new Name('null')));
}

return new If_($booleanNot, [
Expand Down
Loading