Passed
Push — main ( 3b8d3e...36fa87 )
by Chema
01:12 queued 13s
created

SendableRange::min()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpLightning\Invoice\Domain\Transfer;
6
7
final class SendableRange
8
{
9 6
    private function __construct(
10
        private int $min,
11
        private int $max,
12
    ) {
13 6
    }
14
15 6
    public static function withMinMax(int $min, int $max): self
16
    {
17 6
        return new self($min, $max);
18
    }
19
20 3
    public function contains(int $amount): bool
21
    {
22 3
        return $amount >= $this->min
23 3
            && $amount <= $this->max;
24
    }
25
26 3
    public function min(): int
27
    {
28 3
        return $this->min;
29
    }
30
31 3
    public function max(): int
32
    {
33 3
        return $this->max;
34
    }
35
}
36