Lines
100.00%
1 / 1
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| SerializerAwareTrait | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| setSerializer | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Tomaj\Hermes\Driver; | |
| 6 | ||
| 7 | use Tomaj\Hermes\SerializerInterface; | |
| 8 | ||
| 9 | trait SerializerAwareTrait | |
| 10 | { | |
| 11 | private SerializerInterface $serializer; | |
| 12 | ||
| 13 | /** | |
| 14 | * Set serializer to driver | |
| 15 | * | |
| 16 | * You can this trait to set serializer from outsite to your driver | |
| 17 | * if you need your custom serialization for your objects. | |
| 18 | */ | |
| 19 | public function setSerializer(SerializerInterface $serializer): void | |
| 20 | { | |
| 21 | $this->serializer = $serializer; | |
| 22 | } | |
| 23 | } |