Runner   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 32
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 8 2
A addPass() 0 3 1
1
<?php declare(strict_types=1);
2
3
/**
4
* @package   s9e\RegexpBuilder
5
* @copyright Copyright (c) 2016-2022 The s9e authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\RegexpBuilder;
9
10
use s9e\RegexpBuilder\Passes\PassInterface;
11
12
class Runner
13
{
14
	/**
15
	* @var PassInterface[]
16
	*/
17
	protected $passes = [];
18
19
	/**
20
	* Add a pass to the list
21
	*
22
	* @param  PassInterface $pass
23
	* @return void
24
	*/
25 1
	public function addPass(PassInterface $pass): void
26
	{
27 1
		$this->passes[] = $pass;
28 1
	}
29
30
	/**
31
	* Run all passes on the list of strings
32
	*
33
	* @param  array[] $strings
34
	* @return array[]
35
	*/
36 1
	public function run(array $strings): array
37
	{
38 1
		foreach ($this->passes as $pass)
39
		{
40 1
			$strings = $pass->run($strings);
41
		}
42
43 1
		return $strings;
44
	}
45
}