1 | <?php |
||
17 | class Yaml implements ParserInterface |
||
18 | { |
||
19 | use ParserTrait; |
||
20 | |||
21 | private $yamlParser = 'ext'; |
||
22 | |||
23 | private static $yamlParsers = ['ext','symfony']; |
||
24 | |||
25 | /** |
||
26 | * Yaml constructor. |
||
27 | * @param string $yamlParser |
||
28 | * @param string $schemaConfig |
||
29 | * @throws InvalidArgumentException |
||
30 | * @throws UnexpectedValueException |
||
31 | */ |
||
32 | public function __construct(string $yamlParser = 'ext', string $schemaConfig = null) |
||
39 | |||
40 | /** |
||
41 | * {@inheritDoc} |
||
42 | */ |
||
43 | public function parse() |
||
49 | |||
50 | /** |
||
51 | * {@inheritDoc} |
||
52 | */ |
||
53 | public function checkFormat() |
||
62 | |||
63 | /** |
||
64 | * @param string $selectedParser |
||
65 | * @throws UnexpectedValueException |
||
66 | */ |
||
67 | private function setYamlParser(string $selectedParser = 'ext') |
||
79 | |||
80 | /** |
||
81 | * @return array |
||
82 | * @throws InvalidArgumentException |
||
83 | */ |
||
84 | private function yamlParse() |
||
91 | |||
92 | /** |
||
93 | * @return array |
||
94 | * @throws InvalidArgumentException |
||
95 | */ |
||
96 | private function extParse() |
||
104 | |||
105 | /** |
||
106 | * @return array |
||
107 | * @throws InvalidArgumentException |
||
108 | */ |
||
109 | private function symfonyParse() |
||
117 | } |
||
118 |
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.