Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit c6f28d3

Browse files
committed
Fix return type of PipelineEncoder::encode
1 parent e6bffc8 commit c6f28d3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Builder/Encoder/PipelineEncoder.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
use MongoDB\Builder\Pipeline;
88
use MongoDB\Codec\EncodeIfSupported;
99
use MongoDB\Exception\UnsupportedValueException;
10-
use stdClass;
1110

12-
/** @template-extends AbstractExpressionEncoder<array, Pipeline> */
11+
/** @template-extends AbstractExpressionEncoder<list<mixed>, Pipeline> */
1312
class PipelineEncoder extends AbstractExpressionEncoder
1413
{
15-
/** @template-use EncodeIfSupported<array, Pipeline> */
14+
/** @template-use EncodeIfSupported<list<mixed>, Pipeline> */
1615
use EncodeIfSupported;
1716

17+
/** @psalm-assert-if-true Pipeline $value */
1818
public function canEncode(mixed $value): bool
1919
{
2020
return $value instanceof Pipeline;
2121
}
2222

23-
public function encode(mixed $value): stdClass|array|string
23+
/** @return list<mixed> */
24+
public function encode(mixed $value): array
2425
{
2526
if (! $this->canEncode($value)) {
2627
throw UnsupportedValueException::invalidEncodableValue($value);

0 commit comments

Comments
 (0)