Completed
Push — master ( e36c6b...c46352 )
by Łukasz
14:01
created

UserEmail   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSpecifications() 0 17 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\API\Repository\Values\Content\Query\Criterion;
10
11
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
12
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications;
13
14
class UserEmail extends Criterion
15
{
16
    /**
17
     * @param string|string[] $value
18
     * @param string|null $operator
19
     */
20
    public function __construct($value, ?string $operator = null)
21
    {
22
        parent::__construct(null, $operator, $value);
23
    }
24
25
    /**
26
     * @return \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications[]
27
     */
28
    public function getSpecifications(): array
29
    {
30
        return [
31
            new Specifications(
32
                Operator::EQ,
33
                Specifications::FORMAT_SINGLE
34
            ),
35
            new Specifications(
36
                Operator::IN,
37
                Specifications::FORMAT_ARRAY
38
            ),
39
            new Specifications(
40
                Operator::LIKE,
41
                Specifications::FORMAT_SINGLE
42
            ),
43
        ];
44
    }
45
}
46