for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace KunicMarko\SonataAnnotationBundle\Annotation;
/**
* @Annotation
* @Target("CLASS")
*
* @author Marko Kunic <[email protected]>
*/
final class AddChild implements AnnotationInterface
{
* @var string
public $class;
public $field;
public function getClass(): string
if ($this->class) {
return $this->class;
}
throw new \InvalidArgumentException(
sprintf(
'Argument "class" is mandatory in "%s" annotation.',
self::class
)
);
public function getField(): string
if ($this->field) {
return $this->field;
'Argument "field" is mandatory in "%s" annotation.',