Failed Conditions
Push — master ( 4252f4...9d8e13 )
by Adrien
07:13
created

UrlType::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 3
cp 0
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Api\Scalar;
6
7
class UrlType extends AbstractStringBasedType
8
{
9
    /**
10
     * Validate an URL
11
     *
12
     * @param mixed $value
13
     *
14
     * @return bool
15
     */
16
    protected function isValid($value): bool
17
    {
18
        return is_string($value) && filter_var($value, FILTER_VALIDATE_URL);
19
    }
20
}
21