Table   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 28
ccs 8
cts 8
cp 1
rs 10
c 2
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getColumns() 0 3 1
A getIndexes() 0 3 1
A __construct() 0 5 1
A getPrimary() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\Annotated\Annotation;
6
7
use Cycle\Annotated\Annotation\Table\Index;
8
use Cycle\Annotated\Annotation\Table\PrimaryKey;
9
use Doctrine\Common\Annotations\Annotation\Target;
10
use Spiral\Attributes\NamedArgumentConstructor;
11
12
/**
13
 * @Annotation
14
 * @NamedArgumentConstructor
15
 * @Target({"CLASS", "ANNOTATION"})
16
 */
17
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
18
final class Table
19
{
20
    /**
21
     * @param Column[] $columns
22
     * @param PrimaryKey|null $primary
23
     * @param Index[] $indexes
24
     */
25 86
    public function __construct(
26
        private array $columns = [],
27
        private ?PrimaryKey $primary = null,
28
        private array $indexes = [],
29
    ) {
30 86
    }
31
32 38
    public function getColumns(): array
33
    {
34 38
        return $this->columns;
35
    }
36
37 74
    public function getPrimary(): ?PrimaryKey
38
    {
39 74
        return $this->primary;
40
    }
41
42 74
    public function getIndexes(): array
43
    {
44 74
        return $this->indexes;
45
    }
46
}
47