Passed
Push — new-api ( 4bfe18...7ec1cc )
by Sebastian
05:06
created

StyleElement   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 27
ccs 5
cts 7
cp 0.7143
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setParent() 0 3 1
A setLayout() 0 3 1
A getParent() 0 3 1
1
<?php
2
/*
3
 * citeproc-php
4
 *
5
 * @link        http://github.com/seboettg/citeproc-php for the source repository
6
 * @copyright   Copyright (c) 2016 Sebastian Böttger.
7
 * @license     https://opensource.org/licenses/MIT
8
 */
9
10
namespace Seboettg\CiteProc\Style;
11
12
use Seboettg\CiteProc\Rendering\Layout;
13
use Seboettg\CiteProc\Root\Root;
14
use Seboettg\CiteProc\Style\Options\NameOptions;
15
16
/**
17
 * Class StyleElement
18
 *
19
 * StyleElement is an abstract class which must be extended by Citation and Bibliography class. The constructor
20
 * of StyleElement class parses the cs:layout element (necessary for cs:citation and cs:bibliography) and the optional
21
 * cs:sort element.
22
 *
23
 * @package Seboettg\CiteProc\Style
24
 */
25
abstract class StyleElement
26
{
27
    /** @var Layout */
28
    protected $layout;
29
30
    /** @var NameOptions */
31
    protected $nameOptions;
32
33
    /** @var Root */
34
    protected $parent;
35
36
    /**
37
     * @return Root
38
     */
39
    public function getParent(): ?Root
40
    {
41
        return $this->parent;
42
    }
43
44 173
    public function setParent(Root $parent)
45
    {
46 173
        $this->parent = $parent;
47 173
    }
48
49 173
    public function setLayout(?Layout $layout)
50
    {
51 173
        $this->layout = $layout;
52 173
    }
53
}
54