mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-18 21:48:24 -04:00
apply null coalescing operator
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user