Skip to content

Commit

Permalink
Improve CI checking, to report on unimplemented properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
harm-smits committed May 21, 2021
1 parent 136b4e1 commit b5997cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Models/AModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use BadMethodCallException;
use DateTime;
use InvalidArgumentException;
use RuntimeException;

/**
* Class AModel
Expand All @@ -28,6 +29,14 @@ public function __call(string $method, array $args)
if ($get || $set) {
$variable = lcfirst(substr($method, 3));
if (!$this->_propertyExists($variable)) {
if (defined('HSMITS_CI')) {
throw new RuntimeException(sprintf(
"Undefined property '%s' for '%s'",
$variable,
get_class($this)
));
}

return null;
}

Expand Down

0 comments on commit b5997cb

Please sign in to comment.