for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* @author : Korotkov Danila <[email protected]>
* @license https://mit-license.org/ MIT
*/
namespace Behavioral\ChainOfResponsibility;
* Class Chain
* @package Behavioral\ChainOfResponsibility
class Chain
{
* @var array
protected $chain;
* @param int $count
public function run(int $count): void
if (count($this->chain)) {
$firstChain = new $this->chain[0]();
$firstChain($count, $this->chain);
}
* @param string $className
public function addToChain(string $className): void
$this->chain[] = $className;