Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 17 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
29 | public function message(): string |
||
30 | { |
||
31 | try { |
||
32 | $docBlockTypes = $this->parameter->getDocBlockTypes(); |
||
33 | } catch (\InvalidArgumentException $e) { |
||
34 | // we need this here to prevent reflection-bocblock errors on @see invalid Fqsen |
||
35 | } |
||
36 | |||
37 | return sprintf( |
||
38 | 'Parameter <info>%s</info> of function <info>%s</info> defined in <comment>%s</comment> ' . |
||
39 | 'does not have a type hint but has a boc block type of <info>%s</info>.', |
||
40 | $this->parameter->getName(), |
||
41 | $this->parameter->getDeclaringFunction()->getName(), |
||
42 | $this->parameter->getDeclaringFunction()->getFileName(), |
||
43 | implode($docBlockTypes) |
||
44 | ); |
||
45 | } |
||
46 | } |
||
47 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.