Unique   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the Storage package
5
 *
6
 * (c) Michal Wachowski <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Moss\Storage\Model\Definition\Index;
13
14
/**
15
 * Defines unique index for model
16
 *
17
 * @author  Michal Wachowski <[email protected]>
18
 * @package Moss\Storage
19
 */
20
class Unique extends Index
21
{
22
    protected $table;
23
    protected $name;
24
    protected $type;
25
    protected $fields = [];
26
27
    /**
28
     * Constructor
29
     *
30
     * @param string $name
31
     * @param array  $fields
32
     */
33
    public function __construct($name, array $fields)
34
    {
35
        $this->name = $name;
36
        $this->type = 'unique';
37
38
        $this->assertFields($fields);
39
40
        $this->fields = $fields;
41
    }
42
}
43