Completed
Push — master ( 0bb17e...5a7e4d )
by Sebastian
04:41
created

CssRules   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRule() 0 7 2
1
<?php
2
/*
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
class CssRules extends ArrayList
15
{
16
    /**
17
     * @param $rule
18
     * @return CssRule
19
     */
20
    public function getRule($rule)
21
    {
22
        if (!$this->hasKey($rule)) {
23
            $this->set($rule, new CssRule(substr($rule, 1), substr($rule, 0, 1)));
24
        }
25
        return $this->get($rule);
26
    }
27
}