InvalidUrlException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace GloBee\PaymentApi\Exceptions\Validation;
4
5
class InvalidUrlException extends ValidationException
6
{
7
    /**
8
     * InvalidUrlException constructor.
9
     *
10
     * @param string $field
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
11
     * @param string $url
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
12
     */
13 3
    public function __construct($field, $url)
0 ignored issues
show
Coding Style introduced by
Type hint "string" missing for $field
Loading history...
Coding Style introduced by
Type hint "string" missing for $url
Loading history...
14
    {
15 3
        $message = sprintf('The %s format is invalid.', $field);
16
        $error = [
17 3
            'type' => 'invalid_url',
18
            'extra' => null,
19 3
            'field' => $field,
20 3
            'message' => $message,
21
        ];
22 3
        parent::__construct([$error], $message);
23 3
    }
24
}
25