Augmentation vers version 3.3.0
This commit is contained in:
45
vendor/s9e/regexp-builder/src/Runner.php
vendored
Normal file
45
vendor/s9e/regexp-builder/src/Runner.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package s9e\RegexpBuilder
|
||||
* @copyright Copyright (c) 2016-2018 The s9e Authors
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
namespace s9e\RegexpBuilder;
|
||||
|
||||
use s9e\RegexpBuilder\Passes\PassInterface;
|
||||
|
||||
class Runner
|
||||
{
|
||||
/**
|
||||
* @var PassInterface[]
|
||||
*/
|
||||
protected $passes = [];
|
||||
|
||||
/**
|
||||
* Add a pass to the list
|
||||
*
|
||||
* @param PassInterface $pass
|
||||
* @return void
|
||||
*/
|
||||
public function addPass(PassInterface $pass)
|
||||
{
|
||||
$this->passes[] = $pass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run all passes on the list of strings
|
||||
*
|
||||
* @param array[] $strings
|
||||
* @return array[]
|
||||
*/
|
||||
public function run(array $strings)
|
||||
{
|
||||
foreach ($this->passes as $pass)
|
||||
{
|
||||
$strings = $pass->run($strings);
|
||||
}
|
||||
|
||||
return $strings;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user