Completed
Push — master ( 4e4f47...806721 )
by Ivannis Suárez
02:27
created

UserMessageValidator::logoutUserValidator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Core\Bus\Tests\Fixtures\Message;
13
14
use Cubiche\Core\Validator\Assert;
15
use Cubiche\Core\Validator\Exception\ValidationException;
16
use Cubiche\Core\Validator\Validator;
17
18
/**
19
 * UserMessageValidator class.
20
 *
21
 * @author Ivannis Suárez Jerez <[email protected]>
22
 */
23
class UserMessageValidator
24
{
25
    /**
26
     * @param LoginUserMessage $event
27
     *
28
     * @return bool
29
     */
30
    public function loginUserValidator(LoginUserMessage $event)
31
    {
32
        Validator::assert($event->email(), Assert::email()->contains('gmail.com'));
33
    }
34
35
    /**
36
     * @param LogoutUserMessage $event
37
     *
38
     * @return bool
39
     */
40
    public function logoutUserValidator(LogoutUserMessage $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event 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...
41
    {
42
        throw new ValidationException('The email is invalid');
43
    }
44
}
45