Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | trait DisplayTrait |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private static $allowedValues = [ |
||
26 | "block", |
||
27 | "left-margin", |
||
28 | "right-inline", |
||
29 | "indent" |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $display; |
||
36 | |||
37 | /** |
||
38 | * @param $node |
||
39 | */ |
||
40 | public function initDisplayAttributes(SimpleXMLElement $node) |
||
41 | { |
||
42 | foreach ($node->attributes() as $attribute) { |
||
43 | switch ($attribute->getName()) { |
||
44 | case 'display': |
||
45 | $this->display = (string) $attribute; |
||
46 | return; |
||
47 | } |
||
48 | } |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param $text |
||
53 | * @return string |
||
54 | */ |
||
55 | public function wrapDisplayBlock($text) |
||
62 | } |
||
63 | } |
||
64 |