for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SimpleAnnotation;
use phpDocumentor\Reflection\Types\This;
use SimpleAnnotation\Concerns\ParsedAnnotationInterface;
/**
* A model class to manipulate the annotations parsed values.
* The abstraction of \JsonSerializable is necessary to the \SimpleAnnotation\Concerns\Cache\FileCache implementation.
*
* @package SimpleAnnotation
*/
final class AnnotationParsed implements ParsedAnnotationInterface, \JsonSerializable
{
/** @var array */
private array $properties = [];
* Magic method.
* @param string $name
* @return bool
public function __isset(string $name) : bool
return isset($this->properties[$name]);
}
* @param $value
public function __set(string $name, $value)
if (!isset($this->properties[$name])) {
$this->properties[$name] = $value;
} else {
if (is_array($this->properties[$name])) {
$this->properties[$name][] = $value;
$this->properties[$name] = [$this->properties[$name], $value];
* @return mixed
public function __get(string $name)
return $this->properties[$name];
* Stub method of \JsonSerializable.
* @return array
public function jsonSerialize()
return get_object_vars($this);
public function isEmpty(): bool
return empty($this->properties);