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

UserId::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
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 View Code Duplication
class UserId extends Criterion
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * @param int|int[] $value
18
     */
19
    public function __construct($value)
20
    {
21
        parent::__construct(null, null, $value);
22
    }
23
24
    /**
25
     * @return \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications[]
26
     */
27
    public function getSpecifications(): array
28
    {
29
        return [
30
            new Specifications(
31
                Operator::EQ,
32
                Specifications::FORMAT_SINGLE
33
            ),
34
            new Specifications(
35
                Operator::IN,
36
                Specifications::FORMAT_ARRAY
37
            ),
38
        ];
39
    }
40
}
41