Conditions | 4 |
Paths | 3 |
Total Lines | 8 |
Lines | 8 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
29 | public function find_invocation_warnings( $invocation, $warnings ) { |
||
30 | if ( $invocation instanceof Static_Const ) { |
||
31 | if ( $invocation->class_name === $this->declaration->class_name |
||
32 | && $invocation->const_name === $this->declaration->const_name) { |
||
33 | $warnings->add( new Warning( $this->type(), $invocation->path, $invocation->line, 'Class constant ' . $this->declaration->display_name() . ' is missing', $this->declaration ) ); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 |
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.