Completed
Push — master ( 0978bf...663ac6 )
by Andrii
01:58
created

Action   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isApplicable() 0 5 2
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\action;
12
13
use hiqdev\php\billing\price\PriceInterface;
14
15
/**
16
 * Simple Action.
17
 * Applicable when same target and same type.
18
 *
19
 * @author Andrii Vasyliev <[email protected]>
20
 */
21
class Action extends AbstractAction
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 5
    public function isApplicable(PriceInterface $price)
27
    {
28 5
        return $this->target->equals($price->getTarget()) &&
29 5
            $this->type->equals($price->getType());
30
    }
31
}
32