Passed
Pull Request — 3.x (#31)
by
unknown
18:33 queued 03:34
created

Index   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A notUnique() 0 5 1
A __construct() 0 4 1
A unique() 0 5 1
1
<?php
2
3
4
declare(strict_types=1);
5
6
namespace Cycle\Migrations\V2;
7
8
class Index
9
{
10
    protected array $fields;
11
    protected ?string $name;
12
    protected bool $unique = false;
13
14
    public function __construct(array $fields, ?string $name = null)
15
    {
16
        $this->fields = $fields;
17
        $this->name = $name;
18
    }
19
20
    public function unique(): self
21
    {
22
        $this->unique = true;
23
24
        return $this;
25
    }
26
27
    public function notUnique(): self
28
    {
29
        $this->unique = false;
30
31
        return $this;
32
    }
33
}
34