This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
8
{
9
/** @var float $limit */
10
private $time;
11
12
/** @var int $ttl */
13
private $ttl;
14
15
/**
16
* @param float $time
17
* @param int $ttl
18
*/
19
16
public function __construct(float $time, int $ttl = null)
20
{
21
16
$this->time = $time;
22
16
$this->ttl = $ttl;
23
16
}
24
25
/**
26
* @param array $array
27
*
28
* @return ThrottlerItemInterface
29
*/
30
16
public static function createFromArray(array $array): ThrottlerItemInterface
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.