Skip to content

Commit 8fa0518

Browse files
committed
Add description to codec interfaces
1 parent cf08982 commit 8fa0518

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/Codec/Codec.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
namespace MongoDB\Codec;
44

55
/**
6+
* The Codec interface allows decoding BSON data to native PHP types and back
7+
* to BSON.
8+
*
69
* @psalm-template BSONType
710
* @psalm-template NativeType
811
* @template-extends Decoder<BSONType, NativeType>

src/Codec/DocumentCodec.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use MongoDB\BSON\Document;
66

77
/**
8+
* The DocumentCodec interface allows decoding BSON document data to native PHP
9+
* objects and back to BSON documents.
10+
*
811
* @psalm-template ObjectType of object
912
* @template-extends Codec<Document, ObjectType>
1013
*/

src/Codec/KnowsCodecLibrary.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace MongoDB\Codec;
44

5+
/**
6+
* This interface is used to indicate that a class is aware of the CodecLibrary
7+
* it was added to. The library will be injected when the codec is added to the
8+
* library. This allows codecs to recursively encode its nested values.
9+
*/
510
interface KnowsCodecLibrary
611
{
712
public function attachLibrary(CodecLibrary $library): void;

0 commit comments

Comments
 (0)