NullReactionTotal::getWeight()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Laravel Love.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Love\Reactant\ReactionTotal\Models;
15
16
use Cog\Contracts\Love\Reactant\Models\Reactant as ReactantInterface;
17
use Cog\Contracts\Love\Reactant\ReactionTotal\Exceptions\ReactionTotalInvalid;
18
use Cog\Contracts\Love\Reactant\ReactionTotal\Models\ReactionTotal as ReactionTotalInterface;
19
20
final class NullReactionTotal implements
21
    ReactionTotalInterface
22
{
23
    private ReactantInterface $reactant;
24
25
    public function __construct(
26
        ReactantInterface $reactant,
27
    ) {
28
        $this->reactant = $reactant;
29
    }
30
31
    public function getReactant(): ReactantInterface
32
    {
33
        return $this->reactant;
34
    }
35
36
    public function getCount(): int
37
    {
38
        return 0;
39
    }
40
41
    public function getWeight(): float
42
    {
43
        return 0.0;
44
    }
45
46
    public function incrementCount(
47
        int $amount,
48
    ): void {
49
        throw ReactionTotalInvalid::notExists();
50
    }
51
52
    public function decrementCount(
53
        int $amount,
54
    ): void {
55
        throw ReactionTotalInvalid::notExists();
56
    }
57
58
    public function incrementWeight(
59
        float $amount,
60
    ): void {
61
        throw ReactionTotalInvalid::notExists();
62
    }
63
64
    public function decrementWeight(
65
        float $amount,
66
    ): void {
67
        throw ReactionTotalInvalid::notExists();
68
    }
69
}
70