Fiber.php 625 B

123456789101112131415161718192021222324252627
  1. <?php
  2. if (!class_exists(Fiber::class)) {
  3. /**
  4. * Fiber stub to make PHPStan happy on PHP < 8.1
  5. *
  6. * @link https://www.php.net/manual/en/class.fiber.php
  7. * @copyright Copyright (c) 2023 Christian Lück, taken from https://github.com/clue/framework-x with permission
  8. */
  9. class Fiber
  10. {
  11. public static function suspend(mixed $value): void
  12. {
  13. // NOOP
  14. }
  15. public function __construct(callable $callback)
  16. {
  17. assert(is_callable($callback));
  18. }
  19. public function start(): int
  20. {
  21. return 42;
  22. }
  23. }
  24. }