IControllerMethodReflector.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  6. * SPDX-License-Identifier: AGPL-3.0-only
  7. */
  8. namespace OCP\AppFramework\Utility;
  9. /**
  10. * Interface ControllerMethodReflector
  11. *
  12. * Reads and parses annotations from doc comments
  13. *
  14. * @since 8.0.0
  15. * @deprecated 22.0.0 will be obsolete with native attributes in PHP8
  16. * @see https://help.nextcloud.com/t/how-should-we-use-php8-attributes/104278
  17. */
  18. interface IControllerMethodReflector {
  19. /**
  20. * @param object $object an object or classname
  21. * @param string $method the method which we want to inspect
  22. * @return void
  23. * @since 8.0.0
  24. * @deprecated 17.0.0 Reflect should not be called multiple times and only be used internally. This will be removed in Nextcloud 18
  25. */
  26. public function reflect($object, string $method);
  27. /**
  28. * Inspects the PHPDoc parameters for types
  29. *
  30. * @param string $parameter the parameter whose type comments should be
  31. * parsed
  32. * @return string|null type in the type parameters (@param int $something)
  33. * would return int or null if not existing
  34. * @since 8.0.0
  35. * @deprecated 22.0.0 this method is only used internally
  36. */
  37. public function getType(string $parameter);
  38. /**
  39. * @return array the arguments of the method with key => default value
  40. * @since 8.0.0
  41. * @deprecated 22.0.0 this method is only used internally
  42. */
  43. public function getParameters(): array;
  44. /**
  45. * Check if a method contains an annotation
  46. *
  47. * @param string $name the name of the annotation
  48. * @return bool true if the annotation is found
  49. * @since 8.0.0
  50. * @deprecated 22.0.0 will be obsolete with native attributes in PHP8
  51. * @see https://help.nextcloud.com/t/how-should-we-use-php8-attributes/104278
  52. */
  53. public function hasAnnotation(string $name): bool;
  54. }