PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.2.89
WindPress – Tailwind CSS integration for WordPress v3.2.89
3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 All 143 releases
← All changes | vendor/masterminds/html5/src/HTML5.php +15 -16 3.0.133.2.89 View file →
@@ -26,9 +26,9 @@
26 26 );
27 27 protected $errors = array();
28 28 public function __construct(array $defaultOptions = array())
29 29 {
30 - $this->defaultOptions = \array_merge($this->defaultOptions, $defaultOptions);
30 + $this->defaultOptions = array_merge($this->defaultOptions, $defaultOptions);
31 31 }
32 32 /**
33 33 * Get the current default options.
34 34 *
@@ -58,12 +58,12 @@
58 58 */
59 59 public function load($file, array $options = array())
60 60 {
61 61 // Handle the case where file is a resource.
62 - if (\is_resource($file)) {
63 - return $this->parse(\stream_get_contents($file), $options);
62 + if (is_resource($file)) {
63 + return $this->parse(stream_get_contents($file), $options);
64 64 }
65 - return $this->parse(\file_get_contents($file), $options);
65 + return $this->parse(file_get_contents($file), $options);
66 66 }
67 67 /**
68 68 * Parse a HTML Document from a string.
69 69 *
@@ -126,15 +126,14 @@
126 126 * @return bool
127 127 */
128 128 public function hasErrors()
129 129 {
130 - return \count($this->errors) > 0;
130 + return count($this->errors) > 0;
131 131 }
132 132 /**
133 133 * Parse an input string.
134 134 *
135 135 * @param string $input
136 - * @param array $options
137 136 *
138 137 * @return \DOMDocument
139 138 */
140 139 public function parse($input, array $options = array())
@@ -139,9 +138,9 @@
139 138 */
140 139 public function parse($input, array $options = array())
141 140 {
142 141 $this->errors = array();
143 - $options = \array_merge($this->defaultOptions, $options);
142 + $options = array_merge($this->defaultOptions, $options);
144 143 $events = new DOMTreeBuilder(\false, $options);
145 144 $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8');
146 145 $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML : Tokenizer::CONFORMANT_HTML);
147 146 $parser->parse();
@@ -160,9 +159,9 @@
160 159 * @return \DOMDocumentFragment
161 160 */
162 161 public function parseFragment($input, array $options = array())
163 162 {
164 - $options = \array_merge($this->defaultOptions, $options);
163 + $options = array_merge($this->defaultOptions, $options);
165 164 $events = new DOMTreeBuilder(\true, $options);
166 165 $scanner = new Scanner($input, !empty($options['encoding']) ? $options['encoding'] : 'UTF-8');
167 166 $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML : Tokenizer::CONFORMANT_HTML);
168 167 $parser->parse();
@@ -181,15 +180,15 @@
181 180 */
182 181 public function save($dom, $file, $options = array())
183 182 {
184 183 $close = \true;
185 - if (\is_resource($file)) {
184 + if (is_resource($file)) {
186 185 $stream = $file;
187 186 $close = \false;
188 187 } else {
189 - $stream = \fopen($file, 'wb');
188 + $stream = fopen($file, 'wb');
190 189 }
191 - $options = \array_merge($this->defaultOptions, $options);
190 + $options = array_merge($this->defaultOptions, $options);
192 191 $rules = new OutputRules($stream, $options);
193 192 $trav = new Traverser($dom, $stream, $rules, $options);
194 193 $trav->walk();
195 194 /*
@@ -196,9 +195,9 @@
196 195 * release the traverser to avoid cyclic references and allow PHP to free memory without waiting for gc_collect_cycles
197 196 */
198 197 $rules->unsetTraverser();
199 198 if ($close) {
200 - \fclose($stream);
199 + fclose($stream);
201 200 }
202 201 }
203 202 /**
204 203 * Convert a DOM into an HTML5 string.
@@ -212,11 +211,11 @@
212 211 * @return string A HTML5 documented generated from the DOM.
213 212 */
214 213 public function saveHTML($dom, $options = array())
215 214 {
216 - $stream = \fopen('php://temp', 'wb');
217 - $this->save($dom, $stream, \array_merge($this->defaultOptions, $options));
218 - $html = \stream_get_contents($stream, -1, 0);
219 - \fclose($stream);
215 + $stream = fopen('php://temp', 'wb');
216 + $this->save($dom, $stream, array_merge($this->defaultOptions, $options));
217 + $html = stream_get_contents($stream, -1, 0);
218 + fclose($stream);
220 219 return $html;
221 220 }
222 221 }