Completed
Push — master ( 14a2bb...4a945d )
by Andrii
02:47
created

SimpleAction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 5
crap 1
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 DateTime;
14
use hiqdev\php\billing\price\PriceInterface;
15
16
/**
17
 * Simple Action.
18
 * Charges only same target and same type.
19
 *
20
 * @author Andrii Vasyliev <[email protected]>
21
 */
22
class SimpleAction extends AbstractAction
23
{
24
    /**
25
     * {@inheritdoc}
26 3
     */
27
    public function isApplicable(PriceInterface $price)
28 3
    {
29 3
        return $this->target->equals($price->getTarget()) &&
30
            $this->getType()->equals($price->getType());
31
    }
32
}
33