Passed
Push — master ( d2184e...ee1eb5 )
by Sebastian
04:46
created

CssRules   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRule() 0 6 2
1
<?php
2
/*
1 ignored issue
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
3
 * citeproc-php
4
 *
5
 * @link        http://github.com/seboettg/citeproc-php for the source repository
6
 * @copyright   Copyright (c) 2017 Sebastian Böttger.
7
 * @license     https://opensource.org/licenses/MIT
8
 */
9
10
namespace Seboettg\CiteProc\Styles\Css;
11
12
use Seboettg\Collection\ArrayList;
13
14
/**
15
 * Class CssRules
16
 * @package Seboettg\CiteProc\Styles\Css
1 ignored issue
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
17
 * @author Sebastian Böttger <[email protected]>
1 ignored issue
show
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
18
 */
3 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
19
class CssRules extends ArrayList
20
{
21
    /**
1 ignored issue
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $rule should have a doc-comment as per coding-style.
Loading history...
22
     * @param $rule
1 ignored issue
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
23
     * @return CssRule
1 ignored issue
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
24
     */
25 3
    public function getRule($rule)
26
    {
27 3
        if (!$this->hasKey($rule)) {
28 3
            $this->set($rule, new CssRule(substr($rule, 1), substr($rule, 0, 1)));
29
        }
30 3
        return $this->get($rule);
31
    }
32
}