Skip to content

Commit a268efb

Browse files
committed
Updated type hint for user errors to allow nulls.
1 parent b9039c8 commit a268efb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/htmldoc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ public function valid() : bool {
187187
*
188188
* @param string $url The address of the HTML file to retrieve
189189
* @param resource $context A resource object made with stream_context_create()
190-
* @param string &$error A reference to any user error that is generated
190+
* @param ?string &$error A reference to any user error that is generated
191191
* @return string|false The loaded HTML, or false on error
192192
*/
193-
public function open(string $url, $context = null, string &$error = null) {
193+
public function open(string $url, $context = null, ?string &$error = null) {
194194

195195
// check resource
196196
if ($context !== null && !\is_resource($context)) {
@@ -230,10 +230,10 @@ public function open(string $url, $context = null, string &$error = null) {
230230
*
231231
* @param string $html A string containing valid HTML
232232
* @param string $charset The charset of the document
233-
* @param string &$error A reference to any user error that is generated
233+
* @param ?string &$error A reference to any user error that is generated
234234
* @return bool Whether the input HTML was parsed
235235
*/
236-
public function load(string $html, string $charset = null, &$error = null) : bool {
236+
public function load(string $html, string $charset = null, ?string &$error = null) : bool {
237237

238238
// detect the charset
239239
if ($charset || ($charset = $this->getCharsetFromHtml($html)) !== null) {

0 commit comments

Comments
 (0)