Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 4.125 |
Changes | 0 |
1 | <?php |
||
21 | 14 | public static function create() : ClientPacker |
|
22 | { |
||
23 | 14 | if (\class_exists(BufferUnpacker::class)) { |
|
24 | 14 | return PurePacker::fromAvailableExtensions(); |
|
25 | } |
||
26 | |||
27 | if (\extension_loaded('msgpack')) { |
||
28 | return new PeclPacker(); |
||
29 | } |
||
30 | |||
31 | throw new \Error('None of the supported msgpack packages were found. To install one, run "composer require rybakit/msgpack"'); |
||
|
|||
32 | } |
||
33 | } |
||
34 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.