for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Annotations;
* Constant based node declaration.
abstract class AbstractAnnotation implements AnnotationInterface
{
protected const NAME = '';
protected const SCHEMA = [];
* @inheritdoc
public function getName(): string
return static::NAME;
}
public function getSchema(): array
$schema = static::SCHEMA;
array_walk_recursive($schema, function (&$v) {
if (is_string($v) && class_exists($v)) {
$v = new $v;
});
return $schema;
public function setAttribute(string $name, $value)
$this->{$name} = $value;