Completed
Push — master ( 3097a5...bdf786 )
by Ron
03:10
created

OptionalDBFilterMap::getMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
1
<?php
2
namespace Kir\MySQL\Builder\Expr;
3
4
class OptionalDBFilterMap {
5
	/** @var array */
6
	private $map;
7
8
	/**
9
	 * @param array $map
10
	 */
11
	final public function __construct(array $map) {
12
		$this->map = $map;
13
	}
14
15
	/**
16
	 * @param array $map
17
	 * @return static
18
	 */
19
	public static function from(array $map) {
20
		return new static($map);
21
	}
22
23
	/**
24
	 * @return array
25
	 */
26
	protected function getMap(): array {
27
		return $this->map;
28
	}
29
30
	/**
31
	 * @param string $expression
32
	 * @param string|string[] $keyPath
33
	 * @param callable|null $validator
34
	 * @return DBExprFilter
35
	 */
36
	public function __invoke($expression, $keyPath, $validator = null) {
37
		return new DBExprFilter($expression, $this->map, $keyPath, $validator);
38
	}
39
}
40