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

StringHelper::clearInterval()   A

Complexity

Conditions 1
Paths 1

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 1
nc 1
nop 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
}