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

StyleElement::__construct()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 24
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 10
nc 4
nop 2
dl 0
loc 24
ccs 11
cts 11
cp 1
crap 4
rs 9.9332
c 1
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) 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