Issues (174)

src/charge/modifiers/addons/WithSince.php (2 issues)

Labels
Severity
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\charge\modifiers\addons;
12
13
/**
14
 * With Since trait.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
trait WithSince
19
{
20 14
    public function since($time)
21
    {
22 14
        return $this->addAddon('since', new Since($time));
0 ignored issues
show
It seems like addAddon() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        return $this->/** @scrutinizer ignore-call */ addAddon('since', new Since($time));
Loading history...
23
    }
24
25 12
    public function getSince(): ?Since
26
    {
27 12
        return $this->getAddon('since');
0 ignored issues
show
It seems like getAddon() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return $this->/** @scrutinizer ignore-call */ getAddon('since');
Loading history...
28
    }
29
}
30