Issues (113)

src/action/ActionInterface.php (1 issue)

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-2020, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\action;
12
13
use DateTimeImmutable;
14
use hiqdev\php\billing\customer\CustomerInterface;
15
use hiqdev\php\billing\EntityInterface;
16
use hiqdev\php\billing\price\PriceInterface;
17
use hiqdev\php\billing\sale\SaleInterface;
18
use hiqdev\php\billing\target\TargetInterface;
19
use hiqdev\php\billing\type\TypeInterface;
0 ignored issues
show
The type hiqdev\php\billing\type\TypeInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
use hiqdev\php\units\QuantityInterface;
21
22
/**
23
 * Action is action to be charged.
24
 *
25
 * Provides:
26
 *
27
 * - data: id, type, target, quantity, customer, time, sale, state, parent
28
 * - logic:
29
 *      - unique ID
30
 *      - check is applicable to price
31
 *
32
 * @author Andrii Vasyliev <[email protected]>
33
 */
34
interface ActionInterface extends EntityInterface
35
{
36
    /**
37
     * Returns if the given price applicable to this action.
38
     */
39
    public function isApplicable(PriceInterface $price): bool;
40
41
    /**
42
     * Returns client ot this action.
43
     */
44
    public function getCustomer(): CustomerInterface;
45
46
    /**
47
     * Returns target ot this action.
48
     */
49
    public function getTarget(): TargetInterface;
50
51
    /**
52
     * Returns type ot this action.
53
     */
54
    public function getType(): TypeInterface;
55
56
    /**
57
     * Returns quantity ot this action.
58
     */
59
    public function getQuantity(): QuantityInterface;
60
61
    /**
62
     * Returns time ot this action.
63
     */
64
    public function getTime(): DateTimeImmutable;
65
66
    /**
67
     * Returns sale if set.
68
     */
69
    public function getSale(): ?SaleInterface;
70
71
    /**
72
     * Returns null if the action state is not set.
73
     */
74
    public function isFinished(): ?bool;
75
76
    public function getParent(): ?ActionInterface;
77
78
    public function getState(): ?ActionState;
79
80
    public function hasSale();
81
82
    public function setSale(SaleInterface $sale);
83
84
    public function getUsageInterval(): UsageInterval;
85
86
    public function getFractionOfMonth(): float;
87
}
88