| Total Complexity | 8 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | class NamePart |
||
| 40 | { |
||
| 41 | |||
| 42 | use FormattingTrait, |
||
| 43 | TextCaseTrait, |
||
| 44 | AffixesTrait; |
||
| 45 | |||
| 46 | private $name; |
||
| 47 | |||
| 48 | /** |
||
|
1 ignored issue
–
show
|
|||
| 49 | * @var Name |
||
| 50 | */ |
||
| 51 | private $parent; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * NamePart constructor. |
||
| 55 | * @param SimpleXMLElement $node |
||
|
2 ignored issues
–
show
|
|||
| 56 | * @param Name $parent |
||
|
2 ignored issues
–
show
|
|||
| 57 | */ |
||
| 58 | 3 | public function __construct(SimpleXMLElement $node, $parent) |
|
| 59 | { |
||
| 60 | 3 | $this->parent = $parent; |
|
| 61 | |||
| 62 | /** @var SimpleXMLElement $attribute */ |
||
|
3 ignored issues
–
show
|
|||
| 63 | 3 | foreach ($node->attributes() as $attribute) { |
|
| 64 | 3 | if ($attribute->getName() === 'name') { |
|
| 65 | 3 | $this->name = (string) $attribute; |
|
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | 3 | $this->initFormattingAttributes($node); |
|
| 70 | 3 | $this->initTextCaseAttributes($node); |
|
| 71 | 3 | $this->initAffixesAttributes($node); |
|
| 72 | 3 | } |
|
| 73 | |||
| 74 | /** |
||
|
1 ignored issue
–
show
|
|||
| 75 | * @param $data |
||
|
1 ignored issue
–
show
|
|||
| 76 | * @return mixed |
||
|
1 ignored issue
–
show
|
|||
| 77 | * @throws CiteProcException |
||
|
1 ignored issue
–
show
|
|||
| 78 | */ |
||
| 79 | 2 | public function render($data) |
|
| 101 | } |
||
| 102 | |||
| 103 | /** |
||
|
1 ignored issue
–
show
|
|||
| 104 | * @return string |
||
| 105 | */ |
||
| 106 | 3 | public function getName() |
|
| 111 | } |