BotScoutValidator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A validateName() 0 4 1
A validateMail() 0 4 1
A validateIp() 0 4 1
1
<?php
2
3
namespace NicolasBeauvais\LaravelBotScout;
4
5
class BotScoutValidator
6
{
7
    /** @var BotScout */
8
    protected $botScout;
9
10
    /**
11
     * BotScoutValidator constructor.
12
     */
13
    public function __construct()
14
    {
15
        $this->botScout = app('laravel-botscout');
16
    }
17
18
    public function validateName($message, $attribute, $rule, $parameters) : bool
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from 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 $rule is not used and could be removed.

This check looks from 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.

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

Loading history...
19
    {
20
        return $this->botScout->name($attribute)->isValid();
21
    }
22
23
    public function validateMail($message, $attribute, $rule, $parameters) : bool
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from 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 $rule is not used and could be removed.

This check looks from 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.

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

Loading history...
24
    {
25
        return $this->botScout->mail($attribute)->isValid();
26
    }
27
28
    public function validateIp($message, $attribute, $rule, $parameters) : bool
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from 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 $rule is not used and could be removed.

This check looks from 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.

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

Loading history...
29
    {
30
        return $this->botScout->ip($attribute)->isValid();
31
    }
32
}
33