File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 5
5
namespace MongoDB \Builder ;
6
6
7
7
use DateTimeInterface ;
8
- use MongoDB \BSON \UTCDateTime ;
8
+ use MongoDB \BSON \Type ;
9
9
use MongoDB \Builder \Encoder \CombinedFieldQueryEncoder ;
10
10
use MongoDB \Builder \Encoder \DateTimeEncoder ;
11
11
use MongoDB \Builder \Encoder \DictionaryEncoder ;
34
34
use function array_key_exists ;
35
35
use function is_object ;
36
36
37
- /** @template-implements Encoder<stdClass|array|string|int, Pipeline|StageInterface|ExpressionInterface|QueryInterface> */
37
+ /** @template-implements Encoder<Type| stdClass|array|string|int, Pipeline|StageInterface|ExpressionInterface|QueryInterface> */
38
38
final class BuilderEncoder implements Encoder
39
39
{
40
- /** @template-use EncodeIfSupported<stdClass|array|string|int, Pipeline|StageInterface|ExpressionInterface|QueryInterface> */
40
+ /** @template-use EncodeIfSupported<Type| stdClass|array|string|int, Pipeline|StageInterface|ExpressionInterface|QueryInterface> */
41
41
use EncodeIfSupported;
42
42
43
43
/** @var array<class-string, class-string<ExpressionEncoder>> */
@@ -71,7 +71,7 @@ public function canEncode(mixed $value): bool
71
71
return (bool ) $ this ->getEncoderFor ($ value )?->canEncode($ value );
72
72
}
73
73
74
- public function encode (mixed $ value ): stdClass |array |string |int | UTCDateTime
74
+ public function encode (mixed $ value ): Type | stdClass |array |string |int
75
75
{
76
76
$ encoder = $ this ->getEncoderFor ($ value );
77
77
Original file line number Diff line number Diff line change 4
4
5
5
namespace MongoDB \Builder \Encoder ;
6
6
7
- use MongoDB \BSON \UTCDateTime ;
7
+ use MongoDB \BSON \Type ;
8
8
use MongoDB \Builder \BuilderEncoder ;
9
9
use stdClass ;
10
10
11
11
use function get_object_vars ;
12
12
use function is_array ;
13
13
14
14
/**
15
- * @template BSONType of stdClass|array|string|int|UTCDateTime
15
+ * @template BSONType of Type| stdClass|array|string|int
16
16
* @template NativeType
17
17
* @template-implements ExpressionEncoder<BSONType, NativeType>
18
18
* @internal
@@ -26,6 +26,7 @@ final public function __construct(protected readonly BuilderEncoder $encoder)
26
26
/**
27
27
* Nested arrays and objects must be encoded recursively.
28
28
*
29
+ * @psalm-template T
29
30
* @psalm-param T $value
30
31
*
31
32
* @psalm-return (T is stdClass ? stdClass : (T is array ? array : mixed))
Original file line number Diff line number Diff line change 4
4
5
5
namespace MongoDB \Builder \Encoder ;
6
6
7
+ use MongoDB \BSON \Type ;
7
8
use MongoDB \Builder \BuilderEncoder ;
8
9
use MongoDB \Codec \Encoder ;
9
10
use stdClass ;
10
11
11
12
/**
12
- * @template BSONType of stdClass|array|string|int
13
+ * @template BSONType of Type| stdClass|array|string|int
13
14
* @template NativeType
14
15
* @template-extends Encoder<BSONType, NativeType>
15
16
* @internal
You can’t perform that action at this time.
0 commit comments