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

StyleElement::setLayout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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) 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