Skip to content

Commit

Permalink
Removed conditional return
Browse files Browse the repository at this point in the history
  • Loading branch information
devnix committed Dec 25, 2023
1 parent 0d8529b commit 3e71e52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/Psl/Option/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,7 @@ public function equals(mixed $other): bool
*
* @param Option<Tu> $other The other `Option` to zip with.
*
* @return (
* T is never
* ? Option<never>
* : (Tu is never ? Option<never> : Option<array{T, Tu}>)
* )
* @return Option<array{T, Tu}> The resulting `Option` containing the combined tuple or `None`.
*/
public function zip(Option $other): Option
{
Expand Down
8 changes: 4 additions & 4 deletions tests/static-analysis/Option/zip.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
use Psl\Type;

/**
* @return Option\Option<never>
* @return Option\Option<array{never, int}>
*/
function test_partial_none_tuple_1(): Option\Option
{
return Option\none()->zip(Option\some(1));
}

/**
* @return Option\Option<never>
* @return Option\Option<array{int, never}>
*/
function test_partial_none_tuple_2(): Option\Option
{
Expand All @@ -24,7 +24,7 @@ function test_partial_none_tuple_2(): Option\Option
/**
* @throws Type\Exception\AssertException
*
* @return array{Option\Option<never>, Option\Option<never>}
* @return array{Option\Option<never>, Option\Option<int>}
*/
function test_partial_none_unzip_1(): array
{
Expand All @@ -42,7 +42,7 @@ function test_some_zip(): Option\Option
/**
* @throws Type\Exception\AssertException
*
* @return array{Option\Option<never>, Option\Option<never>}
* @return array{Option\Option<int>, Option\Option<never>}
*/
function test_partial_none_unzip_2(): array
{
Expand Down

0 comments on commit 3e71e52

Please sign in to comment.