TableFindByPropertyMethodReflection.php 1.3 KB

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