Skip to content

Commit

Permalink
Fixes deprecation thrown when calling class_exists with null in PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-granados committed Mar 10, 2023
1 parent cabac12 commit 0ac2bcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ protected function keyType($key)
$keyType = $key . "Type";

// ensure keyType is a valid class
if (property_exists($this, $keyType) && class_exists($this->$keyType)) {
if (property_exists($this, $keyType) && $this->$keyType !== null && class_exists($this->$keyType)) {
return $this->$keyType;
}
}
Expand Down

0 comments on commit 0ac2bcf

Please sign in to comment.