Skip to content

Commit 12cc3ca

Browse files
committed
Fixed other instances of the mixed type hint being used which is not compatible with PHP 7.4.
Fixed some docblock errors. Updated dependencies.
1 parent 8e061cf commit 12cc3ca

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"require": {
1515
"php": ">=7.4",
1616
"hexydec/tokenise": "1.0.0",
17-
"hexydec/cssdoc": "1.0.1",
17+
"hexydec/cssdoc": "1.0.2",
1818
"hexydec/jslite": "0.5.6"
1919
},
2020
"autoload": {

composer.lock

+19-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/htmldoc.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public function offsetGet($i) { // return reference so you can set it like an ar
136136
*
137137
* @return mixed An HTMLdoc object containing the child node at the current pointer position or null if there are no children
138138
*/
139-
public function current() : mixed {
139+
#[\ReturnTypeWillChange]
140+
public function current() {
140141
if (isset($this->children[$this->pointer])) {
141142
$obj = new htmldoc($this->config);
142143
$obj->collection([$this->children[$this->pointer]]);
@@ -187,9 +188,9 @@ public function valid() : bool {
187188
* @param string $url The address of the HTML file to retrieve
188189
* @param resource $context A resource object made with stream_context_create()
189190
* @param string &$error A reference to any user error that is generated
190-
* @return mixed The loaded HTML, or false on error
191+
* @return string|false The loaded HTML, or false on error
191192
*/
192-
public function open(string $url, mixed $context = null, string &$error = null) {
193+
public function open(string $url, $context = null, string &$error = null) {
193194

194195
// check resource
195196
if ($context !== null && !\is_resource($context)) {

src/tokens/tag.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function __set(string $name, $value) : void {
9494
*
9595
* @return void
9696
*/
97-
public function __clone() {
97+
public function __clone() : void {
9898
foreach ($this->children AS &$item) {
9999
$item = clone $item;
100100
}
@@ -104,7 +104,7 @@ public function __clone() {
104104
/**
105105
* Parses an array of tokens into an HTML documents
106106
*
107-
* @param array &$tokens An array of tokens generated by tokenise()
107+
* @param tokenise &$tokens An array of tokens generated by tokenise()
108108
* @param array $config An array of configuration options
109109
* @return void
110110
*/
@@ -216,7 +216,7 @@ protected function getParentTagNames() : array {
216216
/**
217217
* Parses an array of tokens into an HTML documents
218218
*
219-
* @param array &$tokens A reference to an array of tokens generated by tokenise(), the reference allows the array pointer to pass between objectsS
219+
* @param tokenise &$tokens A reference to an array of tokens generated by tokenise(), the reference allows the array pointer to pass between objectsS
220220
* @return bool Whether the parser was able to capture any objects
221221
*/
222222
public function parseChildren(tokenise $tokens) : array {
@@ -905,6 +905,7 @@ public function children() : array {
905905
*
906906
* @return mixed The value of the requested property
907907
*/
908+
#[\ReturnTypeWillChange]
908909
public function __get(string $var) {
909910
return $this->$var;
910911
}

0 commit comments

Comments
 (0)