Innmind /
Immutable
| 1 | <?php |
||||
| 2 | declare(strict_types = 1); |
||||
| 3 | |||||
| 4 | namespace Innmind\Immutable\Monoid; |
||||
| 5 | |||||
| 6 | use Innmind\Immutable\{ |
||||
| 7 | Monoid, |
||||
| 8 | Sequence, |
||||
| 9 | }; |
||||
| 10 | |||||
| 11 | /** |
||||
| 12 | * @template T |
||||
| 13 | * @psalm-immutable |
||||
| 14 | * @implements Monoid<Sequence<T>> |
||||
| 15 | */ |
||||
| 16 | final class Append implements Monoid |
||||
| 17 | { |
||||
| 18 | /** |
||||
| 19 | * @template C of object |
||||
| 20 | * |
||||
| 21 | * @param class-string<C> $class |
||||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||||
| 22 | * |
||||
| 23 | * @return self<C> |
||||
| 24 | */ |
||||
| 25 | public static function of(string $class = null): self |
||||
|
0 ignored issues
–
show
The parameter
$class is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 26 | { |
||||
| 27 | /** @var self<C> */ |
||||
| 28 | return new self; |
||||
| 29 | } |
||||
| 30 | |||||
| 31 | public function identity(): mixed |
||||
| 32 | { |
||||
| 33 | /** @var Sequence<T> */ |
||||
| 34 | return Sequence::of(); |
||||
| 35 | } |
||||
| 36 | |||||
| 37 | /** |
||||
| 38 | * @param Sequence<T> $a |
||||
| 39 | * @param Sequence<T> $b |
||||
| 40 | * |
||||
| 41 | * @return Sequence<T> |
||||
| 42 | */ |
||||
| 43 | public function combine(mixed $a, mixed $b): mixed |
||||
| 44 | { |
||||
| 45 | return $a->append($b); |
||||
| 46 | } |
||||
| 47 | } |
||||
| 48 |