Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
/**
* Describes a Result
*
* @template T
* @template-covariant T
* The Ok value
*
* @template E
* @template-covariant E
* The Err value
*/
abstract class Result
Expand All @@ -45,14 +45,14 @@
/**
* Converts from Result<T, E> to Option<T>, and discarding the error, if any
*
* @return Option<T>

Check failure on line 48 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:48:16: InvalidTemplateParam: Template param T of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
*/
abstract public function ok(): Option;

/**
* Converts from Result<T, E> to Option<E>, and discarding the value, if any
*
* @return Option<E>

Check failure on line 55 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:55:16: InvalidTemplateParam: Template param E of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
*/
abstract public function err(): Option;

Expand All @@ -61,7 +61,7 @@
*
* @template U
*
* @param callable(T):U $mapper

Check failure on line 64 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:64:15: InvalidTemplateParam: Template param T of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
* @return Result<U,E>
*/
abstract public function map(callable $mapper): self;
Expand All @@ -72,7 +72,7 @@
* @template U
*
* @param U $default
* @param callable(T):U $f

Check failure on line 75 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:75:15: InvalidTemplateParam: Template param T of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
*
* @return U
*/
Expand All @@ -83,8 +83,8 @@
*
* @template U
*
* @param callable(E):U $default

Check failure on line 86 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:86:15: InvalidTemplateParam: Template param E of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
* @param callable(T):U $f

Check failure on line 87 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:87:15: InvalidTemplateParam: Template param T of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
*
* @return U
*/
Expand All @@ -95,7 +95,7 @@
*
* @template F
*
* @param callable(E):F $op

Check failure on line 98 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:98:15: InvalidTemplateParam: Template param E of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
* @return Result<T,F>
*/
abstract public function mapErr(callable $op): self;
Expand All @@ -103,7 +103,7 @@
/**
* Calls a function with a reference to the contained value if Ok.
*
* @param callable(T):void $f

Check failure on line 106 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:106:15: InvalidTemplateParam: Template param T of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
*
* @return Result<T,E>
*/
Expand All @@ -112,7 +112,7 @@
/**
* Calls a function with a reference to the contained value if Err.
*
* @param callable(E):void $f

Check failure on line 115 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:115:15: InvalidTemplateParam: Template param E of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
*
* @return Result<T,E>
*/
Expand Down Expand Up @@ -174,7 +174,7 @@
* @template U
* @template F
*
* @param callable(T):Result<U,F> $op

Check failure on line 177 in src/Result.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (8.1, locked)

InvalidTemplateParam

src/Result.php:177:15: InvalidTemplateParam: Template param T of Prewk\Result is marked covariant and cannot be used here (see https://psalm.dev/183)
* @return Result<U,E|F>
*/
abstract public function andThen(callable $op): self;
Expand Down
2 changes: 1 addition & 1 deletion src/Result/Err.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Err
*
* @template E
* @template-covariant E
* The Err value
*
* @extends Result<mixed, E>
Expand Down
2 changes: 1 addition & 1 deletion src/Result/Ok.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Ok
*
* @template T
* @template-covariant T
* The Ok value
*
* @extends Result<T, mixed>
Expand Down