From 319b60b9a27fe28fb333eb6e2c781515761d2183 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Fri, 19 Apr 2019 22:10:11 -0300 Subject: [PATCH] Use Null Coalesce Operator Signed-off-by: Gabriel Caruso --- system/HTTP/CLIRequest.php | 7 +------ system/Images/Handlers/BaseHandler.php | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/system/HTTP/CLIRequest.php b/system/HTTP/CLIRequest.php index 23f1c0f005ec..a27597fb7aa2 100644 --- a/system/HTTP/CLIRequest.php +++ b/system/HTTP/CLIRequest.php @@ -148,12 +148,7 @@ public function getSegments(): array */ public function getOption(string $key) { - if (array_key_exists($key, $this->options)) - { - return $this->options[$key]; - } - - return null; + return $this->options[$key] ?? null; } //-------------------------------------------------------------------- diff --git a/system/Images/Handlers/BaseHandler.php b/system/Images/Handlers/BaseHandler.php index f3c39d0b8301..eed5cc679186 100644 --- a/system/Images/Handlers/BaseHandler.php +++ b/system/Images/Handlers/BaseHandler.php @@ -480,7 +480,7 @@ public function getEXIF(string $key = null, bool $silent = false) $exif = exif_read_data($this->image->getPathname()); if (! is_null($key) && is_array($exif)) { - $exif = array_key_exists($key, $exif) ? $exif[$key] : false; + $exif = $exif[$key] ?? false; } return $exif;