PrimaryKey::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\Annotated\Annotation\Table;
6
7
use Doctrine\Common\Annotations\Annotation\Target;
8
use Spiral\Attributes\NamedArgumentConstructor;
9
10
/**
11
 * @Annotation
12
 * @NamedArgumentConstructor
13
 * @Target("ANNOTATION", "CLASS")
14
 */
15
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
16
class PrimaryKey extends Index
17
{
18 24
    public function __construct(array $columns = [])
19
    {
20 24
        $unique = true;
21 24
        $name = 'PK';
22
23 24
        parent::__construct(
24 24
            columns: $columns,
25
            unique: $unique,
26
            name: $name
27
        );
28 24
    }
29
}
30