for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WPEmerge\Routing;
use WPEmerge\Helpers\Handler as GenericHandler;
/**
* Represent a Closure or a controller method to be executed in response to a request
*/
class Handler {
* Actual handler
*
* @var GenericHandler
protected $handler = null;
* Constructor
* @param string|\Closure $handler
public function __construct( $handler ) {
$this->handler = new GenericHandler( $handler );
}
* Get the handler
* @return GenericHandler
public function get() {
return $this->handler;
* Execute the handler
* @param mixed $arguments,...
$arguments,...
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return mixed
object|integer|double|null|boolean
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function execute() {
$arguments = func_get_args();
$response = call_user_func_array( [$this->handler, 'execute'], $arguments );
if ( is_string( $response ) ) {
return wpm_output( $response );
if ( is_array( $response ) ) {
return wpm_json( $response );
return $response;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.