Passed
Pull Request — master (#18)
by Vladislav
07:44
created

NumericHelper::checkValueLessThan()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 2
nop 2
1
<?php
2
namespace Carpenstar\ByBitAPI\Core\Helpers;
3
4
use Carpenstar\ByBitAPI\Core\Exceptions\SDKException;
5
6
class NumericHelper
7
{
8
    public static function checkValueMoreThan(float $value, float $minValue): void
9
    {
10
        if ($value < $minValue) {
11
            throw new SDKException("Value {$value} less than {$minValue}");
12
        }
13
    }
14
15
    public static function checkValueLessThan(float $value, float $maxValue): void
16
    {
17
        if ($value > $maxValue) {
18
            throw new SDKException("Value {$value} more than {$maxValue}");
19
        }
20
    }
21
}