Access properties in class directly

This commit is contained in:
Sebastian Meyer 2024-09-07 21:30:29 +02:00
parent 00d24e0f77
commit 4b59c57496
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ trait OverloadingGetter
*/
public function __isset(string $property): bool
{
$value = $this->__get($property);
$value = $this->_data[$property] ?? null;
return boolval($value) !== false;
}
}

View File

@ -96,10 +96,10 @@ trait TypeChecker
*/
public function hasAllowedType(mixed $value): bool
{
if (count($this->getAllowedTypes()) === 0) {
if (count($this->_allowedTypes) === 0) {
return true;
}
foreach ($this->getAllowedTypes() as $type) {
foreach ($this->_allowedTypes as $type) {
$function = 'is_' . $type;
if (function_exists($function) && $function($value)) {
return true;
@ -124,7 +124,7 @@ trait TypeChecker
*/
public function isAllowedType(string $type): bool
{
return in_array($type, $this->getAllowedTypes(), true);
return in_array($type, $this->_allowedTypes, true);
}
/**