ClassWithPHPStanGenericsAnnotations.php 934 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace EasySwoole\DoctrineAnnotation\Tests\Fixtures;
  3. /**
  4. * @template T
  5. */
  6. interface WithPHPStanExtendsAnnotations
  7. {
  8. }
  9. /**
  10. * @template T
  11. */
  12. class ClassWithPHPStanExtendsAnnotationsGeneric
  13. {
  14. }
  15. /**
  16. * @template T
  17. */
  18. trait GenericPHPStanTrait
  19. {
  20. }
  21. /**
  22. * @template T
  23. * @implements WithPHPStanExtendsAnnotationsInterface<int>
  24. * @extends ClassWithPHPStanExtendsAnnotationsGeneric<int>
  25. */
  26. class ClassWithPHPStanGenericsAnnotations extends ClassWithPHPStanExtendsAnnotationsGeneric implements
  27. WithPHPStanExtendsAnnotations
  28. {
  29. /**
  30. * @use GenericPHPStanTrait<T>
  31. */
  32. use GenericPHPStanTrait;
  33. /** @var array<T> */
  34. private $bar;
  35. /**
  36. * @param array<T> $array
  37. *
  38. * @return array<T>
  39. */
  40. public function foo($array)
  41. {
  42. return $this->bar;
  43. }
  44. /**
  45. * @Template("@foo.html.twig")
  46. */
  47. public function twigTemplateFunctionName(): void
  48. {
  49. }
  50. }