Completed
Pull Request — master (#463)
by Alexander
30:17 queued 05:15
created

TruePointcut   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 38
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
/*
5
 * Go! AOP framework
6
 *
7
 * @copyright Copyright 2012, Lisachenko Alexander <[email protected]>
8
 *
9
 * This source file is subject to the license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Go\Aop\Pointcut;
14
15
use Go\Aop\Pointcut;
16
17
/**
18
 * Canonical Pointcut instance that always matches.
19
 */
20
class TruePointcut implements Pointcut
21
{
22
    use PointcutClassFilterTrait;
23
24
    /**
25
     * Filter kind
26
     */
27
    protected int $filterKind;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
28
29
    /**
30
     * Default constructor can be used to specify concrete filter kind
31 12
     */
32
    public function __construct(int $filterKind = self::KIND_ALL)
33 12
    {
34 12
        $this->filterKind = $filterKind;
35
    }
36
37
    /**
38
     * Performs matching of point of code
39
     *
40
     * @param mixed              $point     Specific part of code, can be any Reflection class
41
     * @param null|mixed         $context   Related context, can be class or namespace
42
     * @param null|string|object $instance  Invocation instance or string for static calls
43
     * @param null|array         $arguments Dynamic arguments for method
44 1
     */
45
    public function matches($point, $context = null, $instance = null, array $arguments = null): bool
46 1
    {
47
        return true;
48
    }
49
50
    /**
51
     * Returns the kind of point filter
52 5
     */
53
    public function getKind(): int
54 5
    {
55
        return $this->filterKind;
56
    }
57
}
58