@@ -73,7 +73,7 @@ private function fetchIanaStatusCodes(): DOMDocument
7373 }
7474 }
7575 if ($ ianaHttpStatusCodes ) {
76- if (! getenv ('ALWAYS_REFRESH_IANA_HTTP_STATUS_CODES ' )) {
76+ if (getenv ('ALWAYS_REFRESH_IANA_HTTP_STATUS_CODES ' ) === ' false ' ) {
7777 // use cached codes
7878 return $ ianaHttpStatusCodes ;
7979 }
@@ -82,7 +82,7 @@ private function fetchIanaStatusCodes(): DOMDocument
8282
8383 $ updatedQueryResult = $ xpath ->query ('//ns:updated ' );
8484 if ($ updatedQueryResult !== false && $ updatedQueryResult ->length > 0 ) {
85- $ updated = $ updatedQueryResult ->item (0 )?->nodeValue ?: '' ;
85+ $ updated = $ updatedQueryResult ->item (0 )?->nodeValue ?? '' ;
8686 $ updated = strtotime ($ updated );
8787 }
8888 }
@@ -91,7 +91,7 @@ private function fetchIanaStatusCodes(): DOMDocument
9191 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
9292 curl_setopt ($ ch , CURLOPT_TIMEOUT , 30 );
9393 curl_setopt ($ ch , CURLOPT_USERAGENT , 'PHP Curl ' );
94- if ($ updated ) {
94+ if ($ updated !== null ) {
9595 $ ifModifiedSince = sprintf (
9696 'If-Modified-Since: %s ' ,
9797 gmdate ('D, d M Y H:i:s \G\M\T ' , $ updated )
@@ -142,8 +142,8 @@ public function ianaCodesReasonPhrasesProvider(): array
142142 continue ;
143143 }
144144
145- $ value = $ valueQueryResult ->item (0 )?->nodeValue ?: '' ;
146- $ description = $ descriptionQueryResult ->item (0 )?->nodeValue ?: '' ;
145+ $ value = $ valueQueryResult ->item (0 )?->nodeValue ?? '' ;
146+ $ description = $ descriptionQueryResult ->item (0 )?->nodeValue ?? '' ;
147147
148148 if (in_array ($ description , ['Unassigned ' , '(Unused) ' ], true )) {
149149 continue ;
0 commit comments