Passed
Push — master ( a4e0c3...938fb4 )
by Claudio
02:13
created

Collator::compare()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Budgegeria\IntlSort;
6
7
use Collator as IntlCollector;
8
9
use function assert;
10
use function is_int;
11
12
class Collator extends IntlCollector
13
{
14
    /**
15
     * @param mixed $value
16
     * @param mixed $comparativeValue
17
     */
18 51
    public function compare($value, $comparativeValue): int
19
    {
20 51
        $result = parent::compare((string) $value, (string) $comparativeValue);
21
22 51
        assert(is_int($result));
23
24 51
        return $result;
25
    }
26
}
27