Conditions | 5 |
Paths | 3 |
Total Lines | 10 |
Lines | 10 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
35 | public function find_invocation_warnings( $invocation, $warnings ) { |
||
36 | if ( $invocation instanceof Static_Call ) { |
||
37 | // check if it's instantiating this missing class |
||
38 | if ( $invocation->class_name === $this->old_declaration->class_name |
||
39 | && $invocation->method_name === $this->old_declaration->method_name |
||
40 | && $this->old_declaration->static ) { |
||
41 | $warnings->add( new Warning( $invocation->path, $invocation->line, 'Class static method ' . $this->old_declaration->display_name() . ' was moved from ' . $this->old_declaration->path . ' to ' . $this->new_declaration->path ) ); |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 |
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.