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

UrlType::parseLiteral()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
cc 4
eloc 5
nc 3
nop 2
dl 0
loc 12
ccs 0
cts 9
cp 0
crap 20
rs 10
c 0
b 0
f 0
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