@@ -73,7 +73,7 @@ private function fetchIanaStatusCodes(): DOMDocument
73
73
}
74
74
}
75
75
if ($ ianaHttpStatusCodes ) {
76
- if (! getenv ('ALWAYS_REFRESH_IANA_HTTP_STATUS_CODES ' )) {
76
+ if (getenv ('ALWAYS_REFRESH_IANA_HTTP_STATUS_CODES ' ) === ' false ' ) {
77
77
// use cached codes
78
78
return $ ianaHttpStatusCodes ;
79
79
}
@@ -82,7 +82,7 @@ private function fetchIanaStatusCodes(): DOMDocument
82
82
83
83
$ updatedQueryResult = $ xpath ->query ('//ns:updated ' );
84
84
if ($ updatedQueryResult !== false && $ updatedQueryResult ->length > 0 ) {
85
- $ updated = $ updatedQueryResult ->item (0 )?->nodeValue ?: '' ;
85
+ $ updated = $ updatedQueryResult ->item (0 )?->nodeValue ?? '' ;
86
86
$ updated = strtotime ($ updated );
87
87
}
88
88
}
@@ -91,7 +91,7 @@ private function fetchIanaStatusCodes(): DOMDocument
91
91
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
92
92
curl_setopt ($ ch , CURLOPT_TIMEOUT , 30 );
93
93
curl_setopt ($ ch , CURLOPT_USERAGENT , 'PHP Curl ' );
94
- if ($ updated ) {
94
+ if ($ updated !== null ) {
95
95
$ ifModifiedSince = sprintf (
96
96
'If-Modified-Since: %s ' ,
97
97
gmdate ('D, d M Y H:i:s \G\M\T ' , $ updated )
@@ -142,8 +142,8 @@ public function ianaCodesReasonPhrasesProvider(): array
142
142
continue ;
143
143
}
144
144
145
- $ value = $ valueQueryResult ->item (0 )?->nodeValue ?: '' ;
146
- $ description = $ descriptionQueryResult ->item (0 )?->nodeValue ?: '' ;
145
+ $ value = $ valueQueryResult ->item (0 )?->nodeValue ?? '' ;
146
+ $ description = $ descriptionQueryResult ->item (0 )?->nodeValue ?? '' ;
147
147
148
148
if (in_array ($ description , ['Unassigned ' , '(Unused) ' ], true )) {
149
149
continue ;
0 commit comments