for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Aguimaraes\Bureaucrat;
class FailSafe
{
/**
* @var CircuitBreaker
*/
private $circuitBreaker;
* @var Retry
private $retry;
* @param $policy
*
* @return FailSafe
* @throws \InvalidArgumentException
public function with($policy) : FailSafe
if ($policy instanceof CircuitBreaker) {
$this->circuitBreaker = $policy;
return $this;
}
if ($policy instanceof Retry) {
$this->retry = $policy;
throw new \InvalidArgumentException('Argument is an invalid policy');
public function and($policy) : FailSafe
return $this->with($policy);
public function run(callable $operation, array $args = [])
$operation
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$args
// TODO
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.