AspectManager.php 823 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Di\Aop;
  12. class AspectManager
  13. {
  14. protected static array $container = [];
  15. public static function get($class, $method)
  16. {
  17. return static::$container[$class][$method] ?? [];
  18. }
  19. public static function has($class, $method)
  20. {
  21. return isset(static::$container[$class][$method]);
  22. }
  23. public static function set($class, $method, $value)
  24. {
  25. static::$container[$class][$method] = $value;
  26. }
  27. public static function insert($class, $method, $value)
  28. {
  29. static::$container[$class][$method][] = $value;
  30. }
  31. }