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

ArrayHelper::checkValueWithStack()   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 ArrayHelper
7
{
8
    public static function checkValueWithStack(string $value, array $stack): void
9
    {
10
        if (!in_array($value, $stack)) {
11
            throw new SDKException("Value {$value} should be one of " . implode(",", $stack));
12
        }
13
    }
14
}