1 | <?php |
||
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 | 29 | public function __construct($content) |
|
39 | |||
40 | /** |
||
41 | * @param $character |
||
42 | * @return bool |
||
43 | */ |
||
44 | 23 | public function startWith($character) |
|
48 | |||
49 | /** |
||
50 | * @return bool |
||
51 | */ |
||
52 | 5 | public function isJson() |
|
56 | |||
57 | /** |
||
58 | * @return bool |
||
59 | */ |
||
60 | 19 | public function isXml() |
|
64 | |||
65 | /** |
||
66 | * @return \DOMDocument |
||
67 | */ |
||
68 | 18 | public function getDOMDocument() |
|
76 | |||
77 | /** |
||
78 | * @return array |
||
79 | */ |
||
80 | 3 | public function getJsonAsArray() |
|
88 | |||
89 | /** |
||
90 | * @return \DOMDocument |
||
91 | */ |
||
92 | 18 | protected function loadDomDocument() |
|
114 | |||
115 | /** |
||
116 | * @return array |
||
117 | */ |
||
118 | 3 | protected function loadJsonAsArray() |
|
126 | } |
||
127 |