for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BrightComponents\Common\Payloads;
use BrightComponents\Common\Payloads\Contracts\PayloadContract;
class Payload extends PayloadContract
{
/** @var string */
private $status;
/** @var array */
private $input = [];
private $output = [];
private $messages = [];
/**
* Create a copy of the payload with the status.
*
* @param string $status
* @return \BrightComponents\Common\Payloads\Contracts\PayloadContract
*/
public function withStatus($status)
$copy = clone $this;
$copy->status = $status;
return $copy;
}
* Get the status of the payload.
* @return string
public function getStatus()
return $this->status;
* Create a copy of the payload with input array.
* @param array $input
public function withInput(array $input)
$copy->input = $input;
* Get input array from the payload.
* @return array
public function getInput()
return $this->input;
* Create a copy of the payload with output array.
* @param array $output
public function withOutput(array $output)
$copy->output = $output;
* Get output array from the payload.
public function getOutput()
return $this->output;
* Create a copy of the payload with messages array.
$output
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.
public function withMessages(array $messages)
$copy->messages = $messages;
* Get messages array from the payload.
public function getMessages()
return $this->messages;
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.