-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Result): introduce
Result::unwrapOr()
(#470)
* feat(Result): introduce `Result::unwrapOr()` I'd like to introduce a function that allows to get inner value from Result if success and allows to bypass throwing an exception from Failure by providing a default value. * Update src/Psl/Result/Failure.php Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com> * Update src/Psl/Result/ResultInterface.php Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com> * Update src/Psl/Result/Success.php Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com> * style: fix --------- Co-authored-by: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters