for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FrancescoMalatesta\LaravelCircuitBreaker\Service;
final class ServiceOptions
{
/** @var int */
private $attemptsThreshold;
private $attemptsTtl;
private $failureTtl;
/**
* ServiceOptions constructor.
*
* @param $attemptsThreshold
* @param $attemptsTtl
* @param $failureTtl
*/
private function __construct(int $attemptsThreshold, int $attemptsTtl, int $failureTtl)
$this->attemptsThreshold = $attemptsThreshold;
$this->attemptsTtl = $attemptsTtl;
$this->failureTtl = $failureTtl;
}
public static function createFromOptions($attemptsThreshold, $attemptsTtl, $failureTtl) : ServiceOptions
return new self($attemptsThreshold, $attemptsTtl, $failureTtl);
* @return int
public function getAttemptsThreshold(): int
return $this->attemptsThreshold;
public function getAttemptsTtl(): int
return $this->attemptsTtl;
public function getFailureTtl(): int
return $this->failureTtl;