Index::isUnique()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
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 | \Attribute::IS_REPEATABLE), NamedArgumentConstructor]
16
class Index
17
{
18
    /**
19
     * @param non-empty-string[] $columns
0 ignored issues
show
Documentation Bug introduced by
The doc comment non-empty-string[] at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string[].
Loading history...
20
     * @param non-empty-string|null $name
21
     */
22 680
    public function __construct(
23
        private array $columns,
24
        private bool $unique = false,
25
        private ?string $name = null,
26
    ) {
27 680
    }
28
29 502
    public function getColumns(): array
30
    {
31 502
        return $this->columns;
32
    }
33
34 478
    public function getIndex(): ?string
35
    {
36 478
        return $this->name;
37
    }
38
39 478
    public function isUnique(): bool
40
    {
41 478
        return $this->unique;
42
    }
43
}
44