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