Issues (115)

src/Styles/DelimiterTrait.php (1 issue)

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\Styles;
11
12
use SimpleXMLElement;
13
14
/**
15
 * Trait DelimiterTrait
16
 * @package Seboettg\CiteProc\Styles
17
 * @author Sebastian Böttger <[email protected]>
18
 */
19
trait DelimiterTrait
20
{
21
22
    /**
23
     * @param SimpleXMLElement $node
24
     */
25
    protected function initDelimiterAttributes(SimpleXMLElement $node)
26
    {
27
        foreach ($node->attributes() as $attribute) {
28
            /** @var string $name */
29
            $name = (string) $attribute->getName();
30
            $value = (string) $attribute;
31
32
            switch ($name) {
33
                case 'delimiter':
34
                    $this->delimiter = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property delimiter does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
35
                    return;
36
            }
37
        }
38
    }
39
}
40