ArrayBracketsMatcher   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 5
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 10 1
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL, Commercial license.
5
 *
6
 * @package maslosoft/addendum
7
 * @licence AGPL, Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]> (Meta container, further improvements, bugfixes)
9
 * @copyright Copyright (c) Maslosoft (Meta container, further improvements, bugfixes)
10
 * @copyright Copyright (c) Jan Suchal (Original version, builder, parser)
11
 * @link https://maslosoft.com/addendum/ - maslosoft addendum
12
 * @link https://code.google.com/p/addendum/ - original addendum project
13
 */
14
15
namespace Maslosoft\Addendum\Matcher;
16
17
use Maslosoft\Addendum\Interfaces\Matcher\MatcherInterface;
18
19
class ArrayBracketsMatcher extends ParallelMatcher implements MatcherInterface
20
{
21
22 50
	protected function build()
23
	{
24 50
		$this->add((new ConstantMatcher('\[\]', []))->setPlugins($this->getPlugins()));
25 50
		$valuesMatcher = new SimpleSerialMatcher(1);
26 50
		$valuesMatcher->setPlugins($this->getPlugins());
27 50
		$valuesMatcher->add((new RegexMatcher('\s*\[\s*'))->setPlugins($this->getPlugins()));
28 50
		$valuesMatcher->add((new ArrayValuesMatcher)->setPlugins($this->getPlugins()));
29 50
		$valuesMatcher->add((new RegexMatcher('\s*\]\s*'))->setPlugins($this->getPlugins()));
30 50
		$this->add($valuesMatcher);
31 50
	}
32
33
}
34