1
0
mirror of https://github.com/danog/file.git synced 2024-11-26 11:54:54 +01:00

Do not use ternary operator when not needed

This commit is contained in:
Daniil Gentili 2018-12-24 13:51:42 +01:00
parent 5a69fca406
commit 1fb69a836a

View File

@ -372,10 +372,9 @@ class BlockingDriver implements Driver
if ($error = \error_get_last()) {
$message .= \sprintf(" Errno: %d; %s", $error["type"], $error["message"]);
}
return new Failure(new FilesystemException($message));
}
return ($result === false)
? new Failure(new FilesystemException($message))
: new Success($result);
return new Success($result);
}
/**
@ -389,10 +388,8 @@ class BlockingDriver implements Driver
if ($error = \error_get_last()) {
$message .= \sprintf(" Errno: %d; %s", $error["type"], $error["message"]);
}
return new Failure(new FilesystemException($message));
}
return ($result === false)
? new Failure(new FilesystemException($message))
: new Success($result);
return new Success($result);
}
}