Matcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A match() 0 4 1
1
<?php
2
3
namespace Mattbit\Flat\Query;
4
5
use Mattbit\Flat\Model\DocumentInterface;
6
use Mattbit\Flat\Query\Expression\ExpressionInterface;
7
8
class Matcher
9
{
10
    /**
11
     * @var ExpressionInterface
12
     */
13
    protected $expression;
14
15
    /**
16
     * Construct a Matcher instance.
17
     *
18
     * @param ExpressionInterface $expression
19
     */
20 4
    public function __construct(ExpressionInterface $expression)
21
    {
22
        // @todo: the expression should be parsed here
23 4
        $this->expression = $expression;
24 4
    }
25
26
    /**
27
     * Check if a document matches the expression.
28
     *
29
     * @param DocumentInterface $document
30
     * @return mixed
31
     */
32 1
    public function match(DocumentInterface $document)
33
    {
34 1
        return $this->expression->match($document);
35
    }
36
}
37