for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Gielfeldt\TransactionalPHP;
/**
* Class Operation
*
* @package Gielfeldt\TransactionalPHP
*/
class Operation
{
* @var string[]
protected $idx;
* @var callable
protected $callback;
* @var mixed
protected $value;
* Set callback.
* @param callable $callback
* The callback.
* @return $this
public function setCallback(callable $callback)
$this->callback = $callback;
return $this;
}
* Get callback.
* @return callable|null
public function getCallback()
return $this->callback;
* @param mixed $value
* The value to set.
public function setValue($value)
$this->value = $value;
* Get value.
* @return mixed
public function getValue()
return is_callable($this->value) ? call_user_func($this->value) : $this->value;
* @param Connection $connection
* The connection to use for this id.
* @param string $id
$id
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.
* The id.
public function setIdx(Connection $connection, $idx)
$this->idx[$connection->connectionId()] = $idx;
* Get id.
* The connection to get id from.
* @return string|null
public function idx(Connection $connection)
$connectionId = $connection->connectionId();
return isset($this->idx[$connectionId]) ? $this->idx[$connectionId] : null;
* Execute operation.
public function execute()
return call_user_func($this->callback);
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.