Commit ce560990 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(chore): Change trigger_error() to error_log() on MagicAttributes

Pipeline #95677079 failed with stages
in 3 minutes and 43 seconds
......@@ -22,11 +22,12 @@ trait MagicAttributes
$attribute = lcfirst($attribute);
if (!property_exists($this, $attribute)) {
trigger_error(sprintf(
"Attribute %s is not defined in %s",
error_log(sprintf(
"Attribute %s is not defined in %s (%s)",
$attribute,
get_class($this)
), E_USER_WARNING);
get_class($this),
$name
));
}
$this->$attribute = $args[0];
......@@ -42,11 +43,12 @@ trait MagicAttributes
$attribute = lcfirst($attribute);
if (!property_exists($this, $attribute)) {
trigger_error(sprintf(
"Attribute %s is not defined in %s",
error_log(sprintf(
"Attribute %s is not defined in %s (%s)",
$attribute,
get_class($this)
), E_USER_WARNING);
get_class($this),
$name
));
}
return $this->$attribute;
......@@ -55,21 +57,23 @@ trait MagicAttributes
$attribute = lcfirst($attribute);
if (!property_exists($this, $attribute)) {
trigger_error(sprintf(
"Attribute %s is not defined in %s",
error_log(sprintf(
"Attribute %s is not defined in %s (%s)",
$attribute,
get_class($this)
), E_USER_WARNING);
get_class($this),
$name
));
}
return (bool) $this->$attribute;
} elseif (strpos($name, 'has', 0) === 0) {
if (!property_exists($this, $name)) {
trigger_error(sprintf(
"Attribute %s is not defined in %s",
error_log(sprintf(
"Attribute %s is not defined in %s (%s)",
$name,
get_class($this)
), E_USER_WARNING);
get_class($this),
$name
));
}
return (bool) $this->$name;
......
Please register or to comment