Added more type-hints and documented a few methods

This commit is contained in:
Roland Häder 2022-06-16 16:35:39 +02:00
parent 97e27cb523
commit aa5f0d5ec1
5 changed files with 26 additions and 17 deletions

View file

@ -55,14 +55,14 @@ abstract class BaseEntity extends BaseDataTransferObject
}
/**
* @param $name
* @param mixed $name
* @return bool
* @throws HTTPException\InternalServerErrorException
*/
public function __isset($name)
public function __isset($name): bool
{
if (!property_exists($this, $name)) {
throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class);
throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' of type ' . gettype($name) . ' in Entity ' . static::class);
}
return !empty($this->$name);