Sorting::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 3
rs 10
c 1
b 0
f 0
eloc 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQL\Doctrine\Attribute;
6
7
use Attribute;
8
use GraphQL\Doctrine\Sorting\SortingInterface;
9
10
/**
11
 * Attribute used to define custom sorting.
12
 */
13
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
14
final class Sorting implements ApiAttribute
15
{
16
    /**
17
     * @param class-string<SortingInterface> $class FQCN of PHP class implementing `SortingInterface`
18
     */
19 13
    public function __construct(
20
        public readonly string $class,
21 13
    ) {}
22
}
23