Completed
Push — 186-data ( d4ee1e )
by
unknown
08:25 queued 10s
created

RegexMatchQuery   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A matchQuery() 0 5 2
1
<?php
2
3
namespace League\Plates\Template\Query\MatchQuery;
4
5
use League\Plates\Template;
6
use League\Plates\Template\Query\MatchQuery;
7
8
class RegexMatchQuery implements MatchQuery
9
{
10
    private $match_query;
11
12
    public function __construct(MatchQuery $match_query) {
13
        $this->match_query = $match_query;
14
    }
15
16
    public function matchQuery($query, Template $template) {
17
        return preg_match($query, $template->name) === 1
18
            ? true
19
            : $this->match_query->matchQuery($query, $template);
20
    }
21
}
22