AnnotationWithRequiredAttributes.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace EasySwoole\DoctrineAnnotation\Tests\Fixtures;
  3. use EasySwoole\DoctrineAnnotation\Tests\Fixtures\AnnotationTargetAnnotation;
  4. /**
  5. * @Annotation
  6. * @Target("ALL")
  7. * @Attributes({
  8. @Attribute("value", required = true , type = "string"),
  9. @Attribute(
  10. "annot",
  11. required = true ,
  12. type = "EasySwoole\DoctrineAnnotation\Tests\Fixtures\AnnotationTargetAnnotation"
  13. ),
  14. })
  15. */
  16. final class AnnotationWithRequiredAttributes
  17. {
  18. /**
  19. * @param mixed[] $data
  20. */
  21. public function __construct(array $data)
  22. {
  23. foreach ($data as $key => $value) {
  24. $this->$key = $value;
  25. }
  26. }
  27. /** @var string */
  28. private $value;
  29. /** @var AnnotationTargetAnnotation */
  30. private $annot;
  31. /**
  32. * @return string
  33. */
  34. public function getValue()
  35. {
  36. return $this->value;
  37. }
  38. /**
  39. * @return AnnotationTargetAnnotation
  40. */
  41. public function getAnnot()
  42. {
  43. return $this->annot;
  44. }
  45. }