Indisposable::validate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 4
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Propaganistas\LaravelDisposableEmail\Validation;
4
5
use Propaganistas\LaravelDisposableEmail\Facades\DisposableDomains;
6
7
class Indisposable
8
{
9
    /**
10
     * Default error message.
11
     *
12
     * @var string
13
     */
14
    public static $errorMessage = 'Disposable email addresses are not allowed.';
15
16
    /**
17
     * Validates whether an email address does not originate from a disposable email service.
18
     *
19
     * @param string $attribute
20
     * @param mixed $value
21
     * @param array $parameters
22
     * @param \Illuminate\Validation\Validator $validator
23
     * @return bool
24
     */
25 9
    public function validate($attribute, $value, $parameters, $validator)
0 ignored issues
show
Unused Code introduced by
The parameter $validator is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
    public function validate($attribute, $value, $parameters, /** @scrutinizer ignore-unused */ $validator)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $attribute is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
    public function validate(/** @scrutinizer ignore-unused */ $attribute, $value, $parameters, $validator)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
    public function validate($attribute, $value, /** @scrutinizer ignore-unused */ $parameters, $validator)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27 9
        return DisposableDomains::isNotDisposable($value);
0 ignored issues
show
Bug introduced by
The method isNotDisposable() does not exist on Propaganistas\LaravelDis...cades\DisposableDomains. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return DisposableDomains::/** @scrutinizer ignore-call */ isNotDisposable($value);
Loading history...
28
    }
29
}
30