| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 25% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class JsonDeserializationVisitorFactory implements DeserializationVisitorFactory |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | private $options = 0; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | private $depth = 512; |
||
| 25 | |||
| 26 | 68 | /** |
|
| 27 | * @var bool |
||
| 28 | 68 | */ |
|
| 29 | private $strict; |
||
| 30 | |||
| 31 | public function __construct(bool $strict = false) |
||
| 32 | { |
||
| 33 | $this->strict = $strict; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getVisitor(): DeserializationVisitorInterface |
||
| 37 | { |
||
| 38 | if ($this->strict) { |
||
| 39 | return new JsonDeserializationStrictVisitor($this->options, $this->depth); |
||
| 40 | } |
||
| 41 | |||
| 42 | return new JsonDeserializationVisitor($this->options, $this->depth); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function setOptions(int $options): self |
||
| 50 | } |
||
| 51 | |||
| 52 | public function setDepth(int $depth): self |
||
| 57 | } |
||
| 58 | } |
||
| 59 |