Passed
Pull Request — master (#63)
by Mark
23:06
created

Sorting::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQL\Doctrine\Annotation;
6
7
use Attribute;
8
use GraphQL\Doctrine\Sorting\SortingInterface;
9
10
/**
11
 * Annotation used to define custom sorting.
12
 *
13
 * @Annotation
14
 * @NamedArgumentConstructor
15
 * @Target({"CLASS"})
16
 */
17
#[Attribute(Attribute::TARGET_CLASS)]
18
final class Sorting
19
{
20
    /**
21
     * FQCN of PHP class implementing `SortingInterface`.
22
     *
23
     * @var array<string>
24
     */
25
    public array $classes = [];
26
27
    /**
28
     * @param array<string> $classes
29
     */
30
    public function __construct(array $classes)
31
    {
32
        $this->classes = $classes;
33
    }
34
}
35