1 | <?php declare(strict_types=1); |
||
13 | class Document |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $content; |
||
20 | |||
21 | /** |
||
22 | * @var \DOMDocument |
||
23 | */ |
||
24 | protected $domDocument; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $jsonArray; |
||
30 | |||
31 | /** |
||
32 | * Document constructor. |
||
33 | * @param string $content |
||
34 | */ |
||
35 | 40 | public function __construct(string $content) |
|
41 | |||
42 | /** |
||
43 | * @param $character |
||
44 | * @return bool |
||
45 | */ |
||
46 | 27 | public function startWith(string $character) : bool |
|
50 | |||
51 | /** |
||
52 | * @return bool |
||
53 | */ |
||
54 | 5 | public function isJson() : bool |
|
58 | |||
59 | /** |
||
60 | * @return bool |
||
61 | */ |
||
62 | 23 | public function isXml() : bool |
|
66 | |||
67 | /** |
||
68 | * @return \DOMDocument |
||
69 | */ |
||
70 | 22 | public function getDOMDocument() : \DOMDocument |
|
78 | |||
79 | /** |
||
80 | * @return array |
||
81 | */ |
||
82 | 3 | public function getJsonAsArray() : array |
|
90 | |||
91 | /** |
||
92 | * @return \DOMDocument |
||
93 | */ |
||
94 | 22 | protected function loadDomDocument() : \DOMDocument |
|
116 | |||
117 | /** |
||
118 | * @return array |
||
119 | */ |
||
120 | 3 | protected function loadJsonAsArray() : array |
|
128 | } |
||
129 |