Completed
Branch 2.x (867c01)
by Akihito
09:30
created

LogicalAndMatcher   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 6
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 30
ccs 12
cts 12
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matchesClass() 0 10 3
A matchesMethod() 0 10 3
1
<?php
2
/**
3
 * This file is part of the Ray.Aop package
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php BSD
6
 */
7
namespace Ray\Aop\Matcher;
8
9
use Ray\Aop\AbstractMatcher;
10
11
class LogicalAndMatcher extends AbstractMatcher
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 3
    public function matchesClass(\ReflectionClass $class, array $arguments)
17
    {
18 3
        $isAnd = true;
19 3
        foreach ($arguments as $matcher) {
20
            /* @var $matcher AbstractMatcher */
21 3
            $isAnd = $isAnd && $matcher->matchesClass($class, $matcher->getArguments());
22 3
        }
23
24 3
        return $isAnd;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 1
    public function matchesMethod(\ReflectionMethod $method, array $arguments)
31
    {
32 1
        $isAnd = true;
33 1
        foreach ($arguments as $matcher) {
34
            /* @var $matcher AbstractMatcher */
35 1
            $isAnd = $isAnd && $matcher->matchesMethod($method, $matcher->getArguments());
36 1
        }
37
38 1
        return $isAnd;
39
    }
40
}
41