Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
27 | class ParleLexer extends SimpleLexer |
||
28 | { |
||
29 | /** |
||
30 | * @var array|string[] |
||
31 | */ |
||
32 | private $map = []; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | private $id = 1; |
||
38 | |||
39 | /** |
||
40 | * @var Parle |
||
41 | */ |
||
42 | private $lexer; |
||
43 | |||
44 | /** |
||
45 | * ParleStateless constructor. |
||
46 | * @param array $tokens |
||
47 | * @param array $skip |
||
48 | * @throws BadLexemeException |
||
49 | */ |
||
50 | public function __construct(array $tokens = [], array $skip = []) |
||
61 | |||
62 | /** |
||
63 | * @param string $name |
||
64 | * @param string $pcre |
||
65 | * @return LexerInterface |
||
66 | * @throws BadLexemeException |
||
67 | */ |
||
68 | public function add(string $name, string $pcre): LexerInterface |
||
85 | |||
86 | /** |
||
87 | * @param Readable $input |
||
88 | * @return \Traversable|TokenInterface[] |
||
89 | */ |
||
90 | protected function exec(Readable $input): \Traversable |
||
106 | |||
107 | /** |
||
108 | * @param Readable $input |
||
109 | * @return \Generator|\Traversable |
||
110 | */ |
||
111 | protected function getInnerIterator(Readable $input): \Traversable |
||
126 | |||
127 | /** |
||
128 | * @param \Traversable|\Generator $iterator |
||
129 | * @return Unknown |
||
130 | */ |
||
131 | private function unknown(\Traversable $iterator): TokenInterface |
||
146 | |||
147 | /** |
||
148 | * @param \Traversable|\Iterator $iterator |
||
149 | * @return Token |
||
150 | */ |
||
151 | private function token(\Traversable $iterator): TokenInterface |
||
160 | |||
161 | /** |
||
162 | * @return iterable|TokenDefinition[] |
||
163 | */ |
||
164 | public function getTokenDefinitions(): iterable |
||
172 | } |
||
173 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.