ReflectionService.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace Doctrine\Persistence\Mapping;
  3. use ReflectionClass;
  4. use ReflectionProperty;
  5. /**
  6. * Very simple reflection service abstraction.
  7. *
  8. * This is required inside metadata layers that may require either
  9. * static or runtime reflection.
  10. */
  11. interface ReflectionService
  12. {
  13. /**
  14. * Returns an array of the parent classes (not interfaces) for the given class.
  15. *
  16. * @param string $class
  17. *
  18. * @return string[]
  19. *
  20. * @throws MappingException
  21. */
  22. public function getParentClasses($class);
  23. /**
  24. * Returns the shortname of a class.
  25. *
  26. * @param string $class
  27. *
  28. * @return string
  29. */
  30. public function getClassShortName($class);
  31. /**
  32. * @param string $class
  33. *
  34. * @return string
  35. */
  36. public function getClassNamespace($class);
  37. /**
  38. * Returns a reflection class instance or null.
  39. *
  40. * @param string $class
  41. *
  42. * @return ReflectionClass|null
  43. */
  44. public function getClass($class);
  45. /**
  46. * Returns an accessible property (setAccessible(true)) or null.
  47. *
  48. * @param string $class
  49. * @param string $property
  50. *
  51. * @return ReflectionProperty|null
  52. */
  53. public function getAccessibleProperty($class, $property);
  54. /**
  55. * Checks if the class have a public method with the given name.
  56. *
  57. * @param mixed $class
  58. * @param mixed $method
  59. *
  60. * @return bool
  61. */
  62. public function hasPublicMethod($class, $method);
  63. }