Skip to content

Commit ef33ea6

Browse files
committed
add @psalm-pure annotation to appropriate static methods
1 parent 430af0b commit ef33ea6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Option.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public static function none(): None
3535
}
3636

3737
/**
38+
* @psalm-pure
3839
* @template TNew
3940
* @param TNew|null $value
4041
* @return Option<TNew>
@@ -47,6 +48,7 @@ public static function fromNullable($value): Option
4748
}
4849

4950
/**
51+
* @psalm-pure
5052
* @template T
5153
* @param list<Option<T>> $options
5254
* @return Option<list<T>>

src/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function error($value): Error
3737
/**
3838
* Filters and extracts values only of Success results from the given array.
3939
*
40+
* @psalm-pure
4041
* @template S
4142
* @param list<ResultInterface<S, mixed>> $results
4243
* @return list<S>
@@ -67,6 +68,7 @@ public static function extractSuccesses(array $results): array
6768
/**
6869
* Filters and extracts values only of Error results from the given array.
6970
*
71+
* @psalm-pure
7072
* @template E
7173
* @param list<ResultInterface<mixed, E>> $results
7274
* @return list<E>

0 commit comments

Comments
 (0)