Completed
Push — dev ( 798ae0...4b619a )
by James Ekow Abaka
04:30
created

Index::addKey()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "Index.php" doesn't match the expected filename "index.php"
Loading history...
2
namespace yentu\database;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
5
class Index extends BasicKey
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
6
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Index
Loading history...
7
    protected $unique = false;
0 ignored issues
show
Coding Style introduced by
Protected member variable "unique" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
8
9
    public function unique($unique = true)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
Incorrect spacing between argument "$unique" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$unique"; expected 0 but found 1
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
10
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
11
        $this->unique = $unique;
12
        return $this;
13
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
14
15 7
    protected function doesKeyExist($constraint)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
16
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
17 7
        return $this->getDriver()->doesIndexExist($constraint);
18
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
19
20 7
    protected function addKey($constraint)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
21
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
22 7
        $this->getDriver()->addIndex($constraint);
23 7
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
24
25
    protected function dropKey($constraint)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
26
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
27
        $this->getDriver()->dropIndex($constraint);
28
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
29
30 7
    protected function getNamePostfix()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
31
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
32 7
        return 'idx';
33
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
34
35 7
    protected function buildDescription()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
36
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
37 7
        return parent::buildDescription() + ['unique' => $this->unique];
0 ignored issues
show
Coding Style introduced by
Arithmetic operation must be bracketed
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
38
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
39
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
40