Skip to content

Commit

Permalink
add @psalm-pure annotation to appropriate static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
someniatko committed May 4, 2023
1 parent 430af0b commit ef33ea6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function none(): None
}

/**
* @psalm-pure
* @template TNew
* @param TNew|null $value
* @return Option<TNew>
Expand All @@ -47,6 +48,7 @@ public static function fromNullable($value): Option
}

/**
* @psalm-pure
* @template T
* @param list<Option<T>> $options
* @return Option<list<T>>
Expand Down
2 changes: 2 additions & 0 deletions src/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static function error($value): Error
/**
* Filters and extracts values only of Success results from the given array.
*
* @psalm-pure
* @template S
* @param list<ResultInterface<S, mixed>> $results
* @return list<S>
Expand Down Expand Up @@ -67,6 +68,7 @@ public static function extractSuccesses(array $results): array
/**
* Filters and extracts values only of Error results from the given array.
*
* @psalm-pure
* @template E
* @param list<ResultInterface<mixed, E>> $results
* @return list<E>
Expand Down

0 comments on commit ef33ea6

Please sign in to comment.