1 | <?php |
||||
2 | |||||
3 | namespace Knik\Binn\Encoder; |
||||
4 | |||||
5 | use Knik\Binn\Contracts\BinnValueEncoder; |
||||
6 | |||||
7 | class BinnEncode |
||||
8 | { |
||||
9 | /** @var EncoderCollection */ |
||||
10 | private $encoders; |
||||
11 | |||||
12 | public function __construct(EncoderCollection $encoders) |
||||
13 | { |
||||
14 | $this->encoders = $encoders; |
||||
15 | } |
||||
16 | |||||
17 | public function encode($value, $format, $context = []): ?string |
||||
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 BinnValueEncoder $encoder */ |
||||
20 | foreach ($this->encoders->getAll() as $encoder) { |
||||
21 | if ($encoder->supportsEncoding($value)) { |
||||
22 | return $encoder->encode($value); |
||||
23 | } |
||||
24 | } |
||||
25 | |||||
26 | return "\x00"; |
||||
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.