Passed
Push — next ( 0f1d72...90a142 )
by Bas
10:40
created

isStringable()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 3
cts 3
cp 1
crap 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
if (! function_exists('isStringable')) {
6
7
    function isStringable(mixed $value): bool
8
    {
9 1
        if ($value === null || is_scalar($value) || $value instanceof Stringable) {
10 1
            return true;
11
        }
12
13 1
        return false;
14
    }
15
}
16