1 | <?php |
||||
2 | |||||
3 | namespace Knik\Binn\Decoder; |
||||
4 | |||||
5 | use Knik\Binn\Contracts\BinnValueDecoder; |
||||
6 | |||||
7 | class BinnDecode |
||||
8 | { |
||||
9 | /** @var DecoderCollection */ |
||||
10 | private $decoders; |
||||
11 | |||||
12 | public function __construct(DecoderCollection $decoders) |
||||
13 | { |
||||
14 | $this->decoders = $decoders; |
||||
15 | } |
||||
16 | |||||
17 | public function decode($value, $format, $context = []) |
||||
0 ignored issues
–
show
The parameter
$context is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||
18 | { |
||||
19 | /** @var BinnValueDecoder $decoder */ |
||||
20 | foreach ($this->decoders->getAll() as $decoder) { |
||||
21 | if ($decoder->supportsDecoding($value)) { |
||||
22 | return $decoder->decode($value); |
||||
23 | } |
||||
24 | } |
||||
25 | |||||
26 | return null; |
||||
27 | } |
||||
28 | } |
||||
29 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.