ValidateEmail::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 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