Skip to content

Commit 62576f2

Browse files
committed
Remove redundant check in conditionals
Because empty() is essentially the concise equivalent to !isset($var) || $var == false using both isset() && !empty() in a conditional serves no purpose. The isset() check has been removed.
1 parent 887150a commit 62576f2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

system/Entity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function __get(string $key)
313313
$result = $this->mutateDate($result);
314314
}
315315
// Or cast it as something?
316-
else if ($this->_cast && isset($this->casts[$key]) && ! empty($this->casts[$key]))
316+
else if ($this->_cast && ! empty($this->casts[$key]))
317317
{
318318
$result = $this->castAs($result, $this->casts[$key]);
319319
}
@@ -471,7 +471,7 @@ protected function mapProperty(string $key)
471471
return $key;
472472
}
473473

474-
if (isset($this->datamap[$key]) && ! empty($this->datamap[$key]))
474+
if (! empty($this->datamap[$key]))
475475
{
476476
return $this->datamap[$key];
477477
}

0 commit comments

Comments
 (0)