UniqueConstraint::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace LaravelDoctrine\Fluent\Builders;
4
5
use LaravelDoctrine\Fluent\Buildable;
6
7
class UniqueConstraint extends Index implements Buildable
8
{
9
    /**
10
     * Suffix to be added to the index key name
11
     *
12
     * @var string
13
     */
14
    protected $suffix = 'unique';
15
16
    /**
17
     * Execute the build process
18
     */
19 3
    public function build()
20
    {
21 3
        $this->builder->addUniqueConstraint(
22 3
            $this->getColumns(),
23 3
            $this->getName()
24 3
        );
25 3
    }
26
}
27