AnnotationWithAttributes.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. namespace EasySwoole\DoctrineAnnotation\Tests\Fixtures;
  3. use EasySwoole\DoctrineAnnotation\Tests\Fixtures\AnnotationTargetAll;
  4. /**
  5. * @Annotation
  6. * @Target("ALL")
  7. * @Attributes({
  8. @Attribute("mixed", type = "mixed"),
  9. @Attribute("boolean", type = "boolean"),
  10. @Attribute("bool", type = "bool"),
  11. @Attribute("float", type = "float"),
  12. @Attribute("string", type = "string"),
  13. @Attribute("integer", type = "integer"),
  14. @Attribute("array", type = "array"),
  15. @Attribute("arrayOfIntegers", type = "array<integer>"),
  16. @Attribute("arrayOfStrings", type = "string[]"),
  17. @Attribute("annotation", type = "EasySwoole\DoctrineAnnotation\Tests\Fixtures\AnnotationTargetAll"),
  18. @Attribute("arrayOfAnnotations", type = "array<EasySwoole\DoctrineAnnotation\Tests\Fixtures\AnnotationTargetAll>"),
  19. })
  20. */
  21. final class AnnotationWithAttributes
  22. {
  23. /**
  24. * @param mixed[] $data
  25. */
  26. public function __construct(array $data)
  27. {
  28. foreach ($data as $key => $value) {
  29. $this->$key = $value;
  30. }
  31. }
  32. /** @var mixed */
  33. private $mixed;
  34. /** @var bool */
  35. private $boolean;
  36. /** @var bool */
  37. private $bool;
  38. /** @var float */
  39. private $float;
  40. /** @var string */
  41. private $string;
  42. /** @var integer */
  43. private $integer;
  44. /** @var mixed[] */
  45. private $array;
  46. /** @var object */
  47. private $annotation;
  48. /** @var int[] */
  49. private $arrayOfIntegers;
  50. /** @var string[] */
  51. private $arrayOfStrings;
  52. /** @var object[] */
  53. private $arrayOfAnnotations;
  54. /**
  55. * @return mixed
  56. */
  57. public function getMixed()
  58. {
  59. return $this->mixed;
  60. }
  61. /**
  62. * @return boolean
  63. */
  64. public function getBoolean()
  65. {
  66. return $this->boolean;
  67. }
  68. /**
  69. * @return bool
  70. */
  71. public function getBool()
  72. {
  73. return $this->bool;
  74. }
  75. /**
  76. * @return float
  77. */
  78. public function getFloat()
  79. {
  80. return $this->float;
  81. }
  82. /**
  83. * @return string
  84. */
  85. public function getString()
  86. {
  87. return $this->string;
  88. }
  89. public function getInteger(): int
  90. {
  91. return $this->integer;
  92. }
  93. /**
  94. * @return mixed[]
  95. */
  96. public function getArray()
  97. {
  98. return $this->array;
  99. }
  100. /**
  101. * @return AnnotationTargetAll
  102. */
  103. public function getAnnotation()
  104. {
  105. return $this->annotation;
  106. }
  107. /**
  108. * @return string[]
  109. */
  110. public function getArrayOfStrings()
  111. {
  112. return $this->arrayOfStrings;
  113. }
  114. /**
  115. * @return array<integer>
  116. */
  117. public function getArrayOfIntegers()
  118. {
  119. return $this->arrayOfIntegers;
  120. }
  121. /**
  122. * @return array<EasySwoole\DoctrineAnnotation\Tests\Fixtures\AnnotationTargetAll>
  123. */
  124. public function getArrayOfAnnotations()
  125. {
  126. return $this->arrayOfAnnotations;
  127. }
  128. }