TableFindByPropertyMethodReflection.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. declare(strict_types=1);
  3. namespace Cake\PHPStan;
  4. use PHPStan\Reflection\ClassReflection;
  5. use PHPStan\Reflection\MethodReflection;
  6. use PHPStan\Type\ObjectType;
  7. use PHPStan\Type\Type;
  8. class TableFindByPropertyMethodReflection implements MethodReflection
  9. {
  10. /**
  11. * @var string
  12. */
  13. private $name;
  14. /**
  15. * @var \PHPStan\Reflection\ClassReflection
  16. */
  17. private $declaringClass;
  18. public function __construct(string $name, ClassReflection $declaringClass)
  19. {
  20. $this->name = $name;
  21. $this->declaringClass = $declaringClass;
  22. }
  23. public function getDeclaringClass(): ClassReflection
  24. {
  25. return $this->declaringClass;
  26. }
  27. public function getPrototype(): MethodReflection
  28. {
  29. return $this;
  30. }
  31. public function isStatic(): bool
  32. {
  33. return false;
  34. }
  35. /**
  36. * @return \PHPStan\Reflection\ParameterReflection[]
  37. */
  38. public function getParameters(): array
  39. {
  40. return [];
  41. }
  42. public function isVariadic(): bool
  43. {
  44. return true;
  45. }
  46. public function isPrivate(): bool
  47. {
  48. return false;
  49. }
  50. public function isPublic(): bool
  51. {
  52. return true;
  53. }
  54. public function getName(): string
  55. {
  56. return $this->name;
  57. }
  58. public function getReturnType(): Type
  59. {
  60. return new ObjectType('Cake\ORM\Query');
  61. }
  62. }