Skip to content

Remove codec library classes #1160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 13, 2023
Merged
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
10 changes: 0 additions & 10 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@
<code><![CDATA[$mergedDriver['platform']]]></code>
</MixedAssignment>
</file>
<file src="src/Codec/DecodeIfSupported.php">
<MixedInferredReturnType>
<code>($value is BSONType ? NativeType : $value)</code>
</MixedInferredReturnType>
</file>
<file src="src/Codec/EncodeIfSupported.php">
<MixedInferredReturnType>
<code>($value is NativeType ? BSONType : $value)</code>
</MixedInferredReturnType>
</file>
<file src="src/Collection.php">
<MixedArgumentTypeCoercion>
<code>$options</code>
Expand Down
149 changes: 0 additions & 149 deletions src/Codec/CodecLibrary.php

This file was deleted.

28 changes: 0 additions & 28 deletions src/Codec/KnowsCodecLibrary.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Codec/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ By default, two codecs are provided: an `ArrayCodec` and an `ObjectCodec`. These
encode and decode values in arrays and `stdClass` instances, respectively. When encoding or decoding an object,
`ObjectCodec` only handles public properties of the object and ignores private and protected properties.

## Codec Libraries

The `CodecLibrary` class is able to combine several `Decoder`, `Encoder`, and `Codec` instances into a single codec.
When decoding or encoding a value, the library will use the first instance that supports the value. This allows for
easier composition of codecs. A `Decoder`, `Encoder`, or `Codec` implementation may choose to implement the
`KnowsCodecLibrary` interface. In this case, when the codec is added to a library, the library is injected into the
instance using the `attachCodecLibrary` method. This allows the codec to use the library to decode or encode values.

## Future Work

### Using Codecs
Expand Down
167 changes: 0 additions & 167 deletions tests/Codec/CodecLibraryTest.php

This file was deleted.