InvalidEmailException   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 InvalidEmailException extends ValidationException
6
{
7
    /**
8
     * InvalidEmailException constructor.
9
     *
10
     * @param string $field
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
11
     * @param string $email
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
12
     */
13 2
    public function __construct($field, $email)
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 $email
Loading history...
14
    {
15 2
        $message = sprintf('The %s must be a valid email address.', $field);
16
        $error = [
17 2
            'type' => 'invalid_email',
18
            'extra' => null,
19 2
            'field' => $field,
20 2
            'message' => $message,
21
        ];
22 2
        parent::__construct([$error], $message);
23 2
    }
24
}
25