@@ -193,10 +193,10 @@ public function loadFromFile(string $file, array $options = []): Dom
193193 */
194194 public function loadFromUrl (string $ url , array $ options = [], ?ClientInterface $ client = null , ?RequestInterface $ request = null ): Dom
195195 {
196- if (\is_null ( $ client) ) {
196+ if ($ client === null ) {
197197 $ client = new Client ();
198198 }
199- if (\is_null ( $ request) ) {
199+ if ($ request === null ) {
200200 $ request = new Request ('GET ' , $ url );
201201 }
202202
@@ -218,7 +218,7 @@ public function loadStr(string $str, array $option = []): Dom
218218 {
219219 $ this ->options = new Options ();
220220 $ this ->options ->setOptions ($ this ->globalOptions )
221- ->setOptions ($ option );
221+ ->setOptions ($ option );
222222
223223 $ this ->rawSize = \strlen ($ str );
224224 $ this ->raw = $ str ;
@@ -614,7 +614,7 @@ protected function parse(): void
614614 $ this ->root = new HtmlNode ('root ' );
615615 $ this ->root ->setHtmlSpecialCharsDecode ($ this ->options ->htmlSpecialCharsDecode );
616616 $ activeNode = $ this ->root ;
617- while (! \is_null ( $ activeNode) ) {
617+ while ($ activeNode!== null ) {
618618 if ($ activeNode && $ activeNode ->tag ->name () === 'script '
619619 && $ this ->options ->get ('cleanupInput ' ) != true
620620 ) {
@@ -636,7 +636,7 @@ protected function parse(): void
636636 $ originalNode = $ activeNode ;
637637 while ($ activeNode ->getTag ()->name () != $ info ['tag ' ]) {
638638 $ activeNode = $ activeNode ->getParent ();
639- if (\is_null ( $ activeNode) ) {
639+ if ($ activeNode === null ) {
640640 // we could not find opening tag
641641 $ activeNode = $ originalNode ;
642642 $ foundOpeningTag = false ;
@@ -693,7 +693,7 @@ protected function parseTag(): array
693693 if ($ this ->content ->fastForward (1 )->char () == '/ ' ) {
694694 // end tag
695695 $ tag = $ this ->content ->fastForward (1 )
696- ->copyByToken ('slash ' , true );
696+ ->copyByToken ('slash ' , true );
697697 // move to end of tag
698698 $ this ->content ->copyUntil ('> ' );
699699 $ this ->content ->fastForward (1 );
@@ -721,8 +721,10 @@ protected function parseTag(): array
721721 $ node ->setHtmlSpecialCharsDecode ($ this ->options ->htmlSpecialCharsDecode );
722722
723723 // attributes
724- while ($ this ->content ->char () != '> ' &&
725- $ this ->content ->char () != '/ ' ) {
724+ while (
725+ $ this ->content ->char () != '> ' &&
726+ $ this ->content ->char () != '/ '
727+ ) {
726728 $ space = $ this ->content ->skipByToken ('blank ' , true );
727729 if (empty ($ space )) {
728730 $ this ->content ->fastForward (1 );
@@ -742,7 +744,7 @@ protected function parseTag(): array
742744 $ this ->content ->skipByToken ('blank ' );
743745 if ($ this ->content ->char () == '= ' ) {
744746 $ this ->content ->fastForward (1 )
745- ->skipByToken ('blank ' );
747+ ->skipByToken ('blank ' );
746748 switch ($ this ->content ->char ()) {
747749 case '" ' :
748750 $ this ->content ->fastForward (1 );
@@ -751,6 +753,7 @@ protected function parseTag(): array
751753 $ moreString = $ this ->content ->copyUntilUnless ('" ' , '=> ' );
752754 $ string .= $ moreString ;
753755 } while (!empty ($ moreString ));
756+ $ attr ['value ' ] = $ string ;
754757 $ this ->content ->fastForward (1 );
755758 $ node ->getTag ()->setAttribute ($ name , $ string );
756759 break ;
@@ -761,6 +764,7 @@ protected function parseTag(): array
761764 $ moreString = $ this ->content ->copyUntilUnless ("' " , '=> ' );
762765 $ string .= $ moreString ;
763766 } while (!empty ($ moreString ));
767+ $ attr ['value ' ] = $ string ;
764768 $ this ->content ->fastForward (1 );
765769 $ node ->getTag ()->setAttribute ($ name , $ string , false );
766770 break ;
@@ -825,7 +829,7 @@ protected function detectCharset(): bool
825829 $ encode ->to ($ this ->defaultCharset );
826830
827831 $ enforceEncoding = $ this ->options ->enforceEncoding ;
828- if (! \is_null ( $ enforceEncoding) ) {
832+ if ($ enforceEncoding !== null ) {
829833 // they want to enforce the given encoding
830834 $ encode ->from ($ enforceEncoding );
831835 $ encode ->to ($ enforceEncoding );
0 commit comments