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  | 
            ||
| 25 | abstract class ServiceActivator extends \PEIP\Pipe\Pipe  | 
            ||
| 26 | { | 
            ||
| 27 | protected $serviceCallable;  | 
            ||
| 28 | |||
| 29 | /**  | 
            ||
| 30 | * Handles the reply logic.  | 
            ||
| 31 | * Delegates calling of service to method 'callService'.  | 
            ||
| 32 | * Replies on message�s reply-channel or registered output-channel if set.  | 
            ||
| 33 | *  | 
            ||
| 34 | * @param \PEIP\INF\Message\Message $message message to handle/reply for  | 
            ||
| 35 | *  | 
            ||
| 36 | * @return  | 
            ||
| 37 | */  | 
            ||
| 38 | public function doReply(\PEIP\INF\Message\Message $message)  | 
            ||
| 48 | |||
| 49 | /**  | 
            ||
| 50 | * Calls a method on a service (registered as a callable) with  | 
            ||
| 51 | * content/payload of given message as argument.  | 
            ||
| 52 | *  | 
            ||
| 53 | * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload  | 
            ||
| 54 | *  | 
            ||
| 55 | * @return mixed result of calling the registered service callable with message content/payload  | 
            ||
| 56 | */  | 
            ||
| 57 | View Code Duplication | protected function callService(\PEIP\INF\Message\Message $message)  | 
            |
| 70 | }  | 
            ||
| 71 | 
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
@ignorePhpDoc annotation to the duplicate definition and it will be ignored.