Passed
Push — 3.x ( 080893...4e5cb3 )
by Aleksei
09:48
created

PrimaryKey::__construct()   A

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\NamedArgumentConstructor;
8
use Doctrine\Common\Annotations\Annotation\Target;
9
10
/**
11
 * @Annotation
12
 * @NamedArgumentConstructor
13
 * @Target("ANNOTATION", "CLASS")
14
 */
15
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
16
class PrimaryKey extends Index
17
{
18 12
    public function __construct(array $columns = [])
19
    {
20 12
        $unique = true;
21 12
        $name = 'PK';
22
23 12
        parent::__construct(
24 12
            columns: $columns,
25
            unique: $unique,
26
            name: $name
27
        );
28 12
    }
29
}
30