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

CssRules::getRule()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
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
}