Skip to content

Commit 319b60b

Browse files
committed
Use Null Coalesce Operator
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
1 parent 6973c65 commit 319b60b

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

system/HTTP/CLIRequest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,7 @@ public function getSegments(): array
148148
*/
149149
public function getOption(string $key)
150150
{
151-
if (array_key_exists($key, $this->options))
152-
{
153-
return $this->options[$key];
154-
}
155-
156-
return null;
151+
return $this->options[$key] ?? null;
157152
}
158153

159154
//--------------------------------------------------------------------

system/Images/Handlers/BaseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public function getEXIF(string $key = null, bool $silent = false)
480480
$exif = exif_read_data($this->image->getPathname());
481481
if (! is_null($key) && is_array($exif))
482482
{
483-
$exif = array_key_exists($key, $exif) ? $exif[$key] : false;
483+
$exif = $exif[$key] ?? false;
484484
}
485485

486486
return $exif;

0 commit comments

Comments
 (0)