apply null coalescing operator

This commit is contained in:
El RIDO
2025-11-19 19:24:17 +01:00
parent c8643f187e
commit 69e5fc1b05
7 changed files with 19 additions and 40 deletions
+2 -6
View File
@@ -65,12 +65,8 @@ class YourlsProxy extends AbstractProxy
*/
protected function _extractShortUrl(array $data): ?string
{
if (
array_key_exists('statusCode', $data) &&
$data['statusCode'] == 200 &&
array_key_exists('shorturl', $data)
) {
return $data['shorturl'];
if (($data['statusCode'] ?? 0) == 200) {
return $data['shorturl'] ?? 0;
}
return null;
}