IControllerMethodReflector.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Olivier Paroz <github@oparoz.com>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. namespace OCP\AppFramework\Utility;
  25. /**
  26. * Interface ControllerMethodReflector
  27. *
  28. * Reads and parses annotations from doc comments
  29. *
  30. * @package OCP\AppFramework\Utility
  31. * @since 8.0.0
  32. */
  33. interface IControllerMethodReflector {
  34. /**
  35. * @param object $object an object or classname
  36. * @param string $method the method which we want to inspect
  37. * @return void
  38. * @since 8.0.0
  39. */
  40. public function reflect($object, $method);
  41. /**
  42. * Inspects the PHPDoc parameters for types
  43. *
  44. * @param string $parameter the parameter whose type comments should be
  45. * parsed
  46. * @return string|null type in the type parameters (@param int $something)
  47. * would return int or null if not existing
  48. * @since 8.0.0
  49. */
  50. public function getType($parameter);
  51. /**
  52. * @return array the arguments of the method with key => default value
  53. * @since 8.0.0
  54. */
  55. public function getParameters();
  56. /**
  57. * Check if a method contains an annotation
  58. *
  59. * @param string $name the name of the annotation
  60. * @return bool true if the annotation is found
  61. * @since 8.0.0
  62. */
  63. public function hasAnnotation($name);
  64. }