ValidateEmail   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php namespace Anomaly\UsersModule\User\Validation;
2
3
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
4
5
/**
6
 * Class ValidateEmail
7
 *
8
 * @link          http://pyrocms.com/
9
 * @author        PyroCMS, Inc. <[email protected]>
10
 * @author        Ryan Thompson <[email protected]>
11
 */
12
class ValidateEmail
13
{
14
15
    /**
16
     * Handle the validation.
17
     *
18
     * @param  UserRepositoryInterface $users
19
     * @param                          $value
20
     * @return bool
21
     */
22
    public function handle(UserRepositoryInterface $users, $value)
23
    {
24
        if (!$users->findByEmail($value)) {
25
            return false;
26
        }
27
28
        return true;
29
    }
30
}
31