@@ -57,13 +57,13 @@ public function dd(): never
5757 /** Create an assertable document from a file. */
5858 public static function createFromFile (string $ path , int $ options = 0 , ?string $ overrideEncoding = null ): self
5959 {
60- return self ::promoteErrorsToExceptions (fn () => new self (HTMLDocument::createFromFile ($ path , $ options , $ overrideEncoding )));
60+ return self ::convertErrorsToExceptions (fn () => new self (HTMLDocument::createFromFile ($ path , $ options , $ overrideEncoding )));
6161 }
6262
6363 /** Create an assertable document from a string. */
6464 public static function createFromString (string $ source , int $ options = 0 , ?string $ overrideEncoding = null ): self
6565 {
66- return self ::promoteErrorsToExceptions (fn () => new self (HTMLDocument::createFromString ($ source , $ options , $ overrideEncoding )));
66+ return self ::convertErrorsToExceptions (fn () => new self (HTMLDocument::createFromString ($ source , $ options , $ overrideEncoding )));
6767 }
6868
6969 /** Return the assertable element matching the given selector. */
@@ -104,8 +104,8 @@ public function getElementsByTagName(string $tag): AssertableElementsList
104104 return new AssertableElementsList ($ this ->document ->getElementsByTagName ($ tag ));
105105 }
106106
107- /** Promote any PHP errors that occur in the given callback to custom exceptions. */
108- private static function promoteErrorsToExceptions (callable $ callback ): mixed
107+ /** Convert any PHP errors that occur in the given callback to custom exceptions. */
108+ private static function convertErrorsToExceptions (callable $ callback ): mixed
109109 {
110110 try {
111111 set_error_handler (function (int $ severity , string $ message , string $ file , int $ line ): never {
0 commit comments