xref: /ext-fiber/stubs/ReflectionFiber.php (revision 3765c7ad)
1<?php
2
3final class ReflectionFiber
4{
5    /**
6     * @param Fiber $fiber Any Fiber object, including those that are not started or have
7     *                     terminated.
8     */
9    public function __construct(Fiber $fiber) {}
10
11    /**
12     * @return Fiber The reflected Fiber object.
13     */
14    public function getFiber(): Fiber {}
15
16    /**
17     * @return string Current file of fiber execution.
18     *
19     * @throws Error If the fiber has not been started or has terminated.
20     */
21    public function getExecutingFile(): string {}
22
23    /**
24     * @return int Current line of fiber execution.
25     *
26     * @throws Error If the fiber has not been started or has terminated.
27     */
28    public function getExecutingLine(): int {}
29
30    /**
31     * @param int $options Same flags as {@see debug_backtrace()}.
32     *
33     * @return array Fiber backtrace, similar to {@see debug_backtrace()}
34     *               and {@see ReflectionGenerator::getTrace()}.
35     *
36     * @throws Error If the fiber has not been started or has terminated.
37     */
38    public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {}
39
40    /**
41     * @return callable Callable used to create the fiber.
42     *
43     * @throws Error If the fiber has been terminated.
44     */
45    public function getCallable(): callable {}
46}
47