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

ArrayHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkValueWithStack() 0 4 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
}