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

Root   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A factory() 0 6 1
A __construct() 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) 2017 Sebastian Böttger.
7
 * @license     https://opensource.org/licenses/MIT
8
 */
9
10
namespace Seboettg\CiteProc\Root;
11
12
use Seboettg\CiteProc\CiteProc;
13
use Seboettg\CiteProc\Style\InheritableNameAttributesTrait;
14
use Seboettg\CiteProc\Style\Options\NameOptions;
15
16
/**
17
 * Class Root
18
 * @package Seboettg\CiteProc\Style
19
 * @author Sebastian Böttger <[email protected]>
20
 */
21
class Root
22
{
23
    /** @var NameOptions */
24
    private $nameOptions;
25
26 173
    public static function factory($node)
27
    {
28 173
        $nameOptions = NameOptions::updateNameOptions($node);
29 173
        CiteProc::getContext()->setNameOptions($nameOptions);
30
31 173
        return new self($nameOptions);
32
    }
33
34 173
    public function __construct(NameOptions $nameOptions)
35
    {
36 173
        $this->nameOptions = $nameOptions;
37 173
    }
38
}
39