Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
DecoderHashmap
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 offsetGet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 create
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Serializer;
3
4use Apie\Core\Lists\ItemHashmap;
5use Apie\Serializer\Encoders\FormSubmitDecoder;
6use Apie\Serializer\Encoders\JsonDecoder;
7use Apie\Serializer\Encoders\MultipartDecoder;
8use Apie\Serializer\Interfaces\DecoderInterface;
9
10final class DecoderHashmap extends ItemHashmap
11{
12    protected bool $mutable = false;
13
14    public function offsetGet(mixed $offset): DecoderInterface
15    {
16        return parent::offsetGet($offset);
17    }
18
19    public static function create(): self
20    {
21        return new self([
22            'application/json' => new JsonDecoder(),
23            'application/x-www-form-urlencoded' => new FormSubmitDecoder(),
24            'multipart/form-data' => new MultipartDecoder(),
25        ]);
26    }
27}