Completed
Branch EDTR/master (da238f)
by
unknown
09:58 queued 01:23
created

MatchAllRouteSpecifications::isMatchingRoute()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\domain\entities\routing\specifications;
4
5
/**
6
 * Class MatchAllRouteSpecifications
7
 * Returns true if ALL of the supplied Route Match Specifications also return true
8
 * ie: supplied Route Match Specifications joined using AND logic
9
 *
10
 * @package EventEspresso\core\domain\entities\routing
11
 * @author  Brent Christensen
12
 * @since   4.9.71.p
13
 */
14 View Code Duplication
class MatchAllRouteSpecifications extends MultiRouteSpecification
15
{
16
17
    /**
18
     * returns true if current request matches specification
19
     *
20
     * @since 4.9.71.p
21
     * @return boolean
22
     */
23
    public function isMatchingRoute()
24
    {
25
        foreach ($this->specifications as $specification) {
26
            if (! $specification->isMatchingRoute()) {
27
                return false;
28
            }
29
        }
30
        return true;
31
    }
32
}
33