Passed
Push — master ( bdfaa2...ebdd6d )
by Vladislav
51s queued 13s
created

StringHelper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A clearInterval() 0 4 1
1
<?php
2
namespace Carpenstar\ByBitAPI\Core\Helpers;
3
4
class StringHelper
5
{
6
    public static function clearInterval(string $interval): int
7
    {
8
        preg_match('#([0-9]+)#', $interval, $matches);
9
        return $matches[1] ?? $interval;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $matches[1] ?? $interval could return the type string which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
Loading history...
10
    }
11
}