@@ -6,32 +6,32 @@ |
||
6 | 6 | */ |
7 | 7 | class ReflectionEnum extends ReflectionClass |
8 | 8 | { |
9 | - public function __construct(object|string $objectOrClass) {} |
|
9 | + public function __construct(object|string $objectOrClass) {} |
|
10 | 10 | |
11 | - /** |
|
12 | - * @param string $name |
|
13 | - * @return bool |
|
14 | - */ |
|
15 | - public function hasCase(string $name): bool {} |
|
11 | + /** |
|
12 | + * @param string $name |
|
13 | + * @return bool |
|
14 | + */ |
|
15 | + public function hasCase(string $name): bool {} |
|
16 | 16 | |
17 | - /** |
|
18 | - * @return ReflectionEnumPureCase[]|ReflectionEnumBackedCase[] |
|
19 | - */ |
|
20 | - public function getCases(): array {} |
|
17 | + /** |
|
18 | + * @return ReflectionEnumPureCase[]|ReflectionEnumBackedCase[] |
|
19 | + */ |
|
20 | + public function getCases(): array {} |
|
21 | 21 | |
22 | - /** |
|
23 | - * @return ReflectionEnumPureCase|ReflectionEnumBackedCase |
|
24 | - * @throws ReflectionException If no found single reflection object for the corresponding case |
|
25 | - */ |
|
26 | - public function getCase(string $name): ReflectionEnumUnitCase {} |
|
22 | + /** |
|
23 | + * @return ReflectionEnumPureCase|ReflectionEnumBackedCase |
|
24 | + * @throws ReflectionException If no found single reflection object for the corresponding case |
|
25 | + */ |
|
26 | + public function getCase(string $name): ReflectionEnumUnitCase {} |
|
27 | 27 | |
28 | - /** |
|
29 | - * @return bool |
|
30 | - */ |
|
31 | - public function isBacked(): bool {} |
|
28 | + /** |
|
29 | + * @return bool |
|
30 | + */ |
|
31 | + public function isBacked(): bool {} |
|
32 | 32 | |
33 | - /** |
|
34 | - * @return ReflectionType|null |
|
35 | - */ |
|
36 | - public function getBackingType(): ?ReflectionType {} |
|
33 | + /** |
|
34 | + * @return ReflectionType|null |
|
35 | + */ |
|
36 | + public function getBackingType(): ?ReflectionType {} |
|
37 | 37 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | */ |
7 | 7 | class ReflectionEnum extends ReflectionClass |
8 | 8 | { |
9 | - public function __construct(object|string $objectOrClass) {} |
|
9 | + public function __construct(object | string $objectOrClass) {} |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param string $name |
@@ -4,8 +4,7 @@ |
||
4 | 4 | * @link https://php.net/manual/en/class.reflectionenum.php |
5 | 5 | * @since 8.1 |
6 | 6 | */ |
7 | -class ReflectionEnum extends ReflectionClass |
|
8 | -{ |
|
7 | +class ReflectionEnum extends ReflectionClass { |
|
9 | 8 | public function __construct(object|string $objectOrClass) {} |
10 | 9 | |
11 | 10 | /** |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | class ReflectionIntersectionType extends ReflectionType |
9 | 9 | { |
10 | - /** @return ReflectionType[] */ |
|
11 | - #[Pure] |
|
12 | - public function getTypes(): array {} |
|
10 | + /** @return ReflectionType[] */ |
|
11 | + #[Pure] |
|
12 | + public function getTypes(): array {} |
|
13 | 13 | } |
@@ -5,8 +5,7 @@ |
||
5 | 5 | /** |
6 | 6 | * @since 8.1 |
7 | 7 | */ |
8 | -class ReflectionIntersectionType extends ReflectionType |
|
9 | -{ |
|
8 | +class ReflectionIntersectionType extends ReflectionType { |
|
10 | 9 | /** @return ReflectionType[] */ |
11 | 10 | #[Pure] |
12 | 11 | public function getTypes(): array {} |
@@ -8,22 +8,22 @@ |
||
8 | 8 | */ |
9 | 9 | interface Reflector extends Stringable |
10 | 10 | { |
11 | - /** |
|
12 | - * Exports a class. |
|
13 | - * |
|
14 | - * @link https://php.net/manual/en/reflector.export.php |
|
15 | - * @return string|null |
|
16 | - * @removed 7.4 |
|
17 | - */ |
|
18 | - public static function export(); |
|
11 | + /** |
|
12 | + * Exports a class. |
|
13 | + * |
|
14 | + * @link https://php.net/manual/en/reflector.export.php |
|
15 | + * @return string|null |
|
16 | + * @removed 7.4 |
|
17 | + */ |
|
18 | + public static function export(); |
|
19 | 19 | |
20 | - /** |
|
21 | - * Returns the string representation of any Reflection object. |
|
22 | - * |
|
23 | - * Please note that since PHP 8.0 this method is absent in this interface |
|
24 | - * and inherits from the {@see Stringable} parent. |
|
25 | - * |
|
26 | - * @return string |
|
27 | - */ |
|
28 | - public function __toString(); |
|
20 | + /** |
|
21 | + * Returns the string representation of any Reflection object. |
|
22 | + * |
|
23 | + * Please note that since PHP 8.0 this method is absent in this interface |
|
24 | + * and inherits from the {@see Stringable} parent. |
|
25 | + * |
|
26 | + * @return string |
|
27 | + */ |
|
28 | + public function __toString(); |
|
29 | 29 | } |
@@ -6,8 +6,7 @@ |
||
6 | 6 | * |
7 | 7 | * @link https://php.net/manual/en/class.reflector.php |
8 | 8 | */ |
9 | -interface Reflector extends Stringable |
|
10 | -{ |
|
9 | +interface Reflector extends Stringable { |
|
11 | 10 | /** |
12 | 11 | * Exports a class. |
13 | 12 | * |
@@ -11,107 +11,107 @@ |
||
11 | 11 | */ |
12 | 12 | class ReflectionZendExtension implements Reflector |
13 | 13 | { |
14 | - /** |
|
15 | - * @var string Name of the extension, same as calling the {@see ReflectionZendExtension::getName()} method |
|
16 | - */ |
|
17 | - #[Immutable] |
|
18 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
19 | - public $name; |
|
14 | + /** |
|
15 | + * @var string Name of the extension, same as calling the {@see ReflectionZendExtension::getName()} method |
|
16 | + */ |
|
17 | + #[Immutable] |
|
18 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
19 | + public $name; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Constructs a ReflectionZendExtension object |
|
23 | - * |
|
24 | - * @link https://php.net/manual/en/reflectionzendextension.construct.php |
|
25 | - * @param string $name |
|
26 | - * @throws ReflectionException if the extension does not exist. |
|
27 | - * @since 5.4 |
|
28 | - */ |
|
29 | - public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} |
|
21 | + /** |
|
22 | + * Constructs a ReflectionZendExtension object |
|
23 | + * |
|
24 | + * @link https://php.net/manual/en/reflectionzendextension.construct.php |
|
25 | + * @param string $name |
|
26 | + * @throws ReflectionException if the extension does not exist. |
|
27 | + * @since 5.4 |
|
28 | + */ |
|
29 | + public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} |
|
30 | 30 | |
31 | - /** |
|
32 | - * Exports a reflected zend extension. |
|
33 | - * |
|
34 | - * @link https://php.net/manual/en/reflectionzendextension.export.php |
|
35 | - * @param string $name The reflection to export. |
|
36 | - * @param bool $return Setting to {@see true} will return the |
|
37 | - * export, as opposed to emitting it. Setting to {@see false} (the default) |
|
38 | - * will do the opposite. |
|
39 | - * @return string|null If the $return parameter is set to {@see true}, then |
|
40 | - * the export is returned as a string, otherwise {@see null} is returned. |
|
41 | - */ |
|
42 | - public static function export($name, $return = false) {} |
|
31 | + /** |
|
32 | + * Exports a reflected zend extension. |
|
33 | + * |
|
34 | + * @link https://php.net/manual/en/reflectionzendextension.export.php |
|
35 | + * @param string $name The reflection to export. |
|
36 | + * @param bool $return Setting to {@see true} will return the |
|
37 | + * export, as opposed to emitting it. Setting to {@see false} (the default) |
|
38 | + * will do the opposite. |
|
39 | + * @return string|null If the $return parameter is set to {@see true}, then |
|
40 | + * the export is returned as a string, otherwise {@see null} is returned. |
|
41 | + */ |
|
42 | + public static function export($name, $return = false) {} |
|
43 | 43 | |
44 | - /** |
|
45 | - * To string handler |
|
46 | - * |
|
47 | - * @link https://php.net/manual/en/reflectionzendextension.tostring.php |
|
48 | - * @return string |
|
49 | - * @since 5.4 |
|
50 | - */ |
|
51 | - #[TentativeType] |
|
52 | - public function __toString(): string {} |
|
44 | + /** |
|
45 | + * To string handler |
|
46 | + * |
|
47 | + * @link https://php.net/manual/en/reflectionzendextension.tostring.php |
|
48 | + * @return string |
|
49 | + * @since 5.4 |
|
50 | + */ |
|
51 | + #[TentativeType] |
|
52 | + public function __toString(): string {} |
|
53 | 53 | |
54 | - /** |
|
55 | - * Gets name |
|
56 | - * |
|
57 | - * @link https://php.net/manual/en/reflectionzendextension.getname.php |
|
58 | - * @return string |
|
59 | - * @since 5.4 |
|
60 | - */ |
|
61 | - #[Pure] |
|
62 | - #[TentativeType] |
|
63 | - public function getName(): string {} |
|
54 | + /** |
|
55 | + * Gets name |
|
56 | + * |
|
57 | + * @link https://php.net/manual/en/reflectionzendextension.getname.php |
|
58 | + * @return string |
|
59 | + * @since 5.4 |
|
60 | + */ |
|
61 | + #[Pure] |
|
62 | + #[TentativeType] |
|
63 | + public function getName(): string {} |
|
64 | 64 | |
65 | - /** |
|
66 | - * Gets version |
|
67 | - * |
|
68 | - * @link https://php.net/manual/en/reflectionzendextension.getversion.php |
|
69 | - * @return string |
|
70 | - * @since 5.4 |
|
71 | - */ |
|
72 | - #[Pure] |
|
73 | - #[TentativeType] |
|
74 | - public function getVersion(): string {} |
|
65 | + /** |
|
66 | + * Gets version |
|
67 | + * |
|
68 | + * @link https://php.net/manual/en/reflectionzendextension.getversion.php |
|
69 | + * @return string |
|
70 | + * @since 5.4 |
|
71 | + */ |
|
72 | + #[Pure] |
|
73 | + #[TentativeType] |
|
74 | + public function getVersion(): string {} |
|
75 | 75 | |
76 | - /** |
|
77 | - * Gets author |
|
78 | - * |
|
79 | - * @link https://php.net/manual/en/reflectionzendextension.getauthor.php |
|
80 | - * @return string |
|
81 | - * @since 5.4 |
|
82 | - */ |
|
83 | - #[Pure] |
|
84 | - #[TentativeType] |
|
85 | - public function getAuthor(): string {} |
|
76 | + /** |
|
77 | + * Gets author |
|
78 | + * |
|
79 | + * @link https://php.net/manual/en/reflectionzendextension.getauthor.php |
|
80 | + * @return string |
|
81 | + * @since 5.4 |
|
82 | + */ |
|
83 | + #[Pure] |
|
84 | + #[TentativeType] |
|
85 | + public function getAuthor(): string {} |
|
86 | 86 | |
87 | - /** |
|
88 | - * Gets URL |
|
89 | - * |
|
90 | - * @link https://php.net/manual/en/reflectionzendextension.geturl.php |
|
91 | - * @return string |
|
92 | - * @since 5.4 |
|
93 | - */ |
|
94 | - #[Pure] |
|
95 | - #[TentativeType] |
|
96 | - public function getURL(): string {} |
|
87 | + /** |
|
88 | + * Gets URL |
|
89 | + * |
|
90 | + * @link https://php.net/manual/en/reflectionzendextension.geturl.php |
|
91 | + * @return string |
|
92 | + * @since 5.4 |
|
93 | + */ |
|
94 | + #[Pure] |
|
95 | + #[TentativeType] |
|
96 | + public function getURL(): string {} |
|
97 | 97 | |
98 | - /** |
|
99 | - * Gets copyright |
|
100 | - * |
|
101 | - * @link https://php.net/manual/en/reflectionzendextension.getcopyright.php |
|
102 | - * @return string |
|
103 | - * @since 5.4 |
|
104 | - */ |
|
105 | - #[Pure] |
|
106 | - #[TentativeType] |
|
107 | - public function getCopyright(): string {} |
|
98 | + /** |
|
99 | + * Gets copyright |
|
100 | + * |
|
101 | + * @link https://php.net/manual/en/reflectionzendextension.getcopyright.php |
|
102 | + * @return string |
|
103 | + * @since 5.4 |
|
104 | + */ |
|
105 | + #[Pure] |
|
106 | + #[TentativeType] |
|
107 | + public function getCopyright(): string {} |
|
108 | 108 | |
109 | - /** |
|
110 | - * Clone handler |
|
111 | - * |
|
112 | - * @link https://php.net/manual/en/reflectionzendextension.clone.php |
|
113 | - * @return void |
|
114 | - * @since 5.4 |
|
115 | - */ |
|
116 | - final private function __clone(): void {} |
|
109 | + /** |
|
110 | + * Clone handler |
|
111 | + * |
|
112 | + * @link https://php.net/manual/en/reflectionzendextension.clone.php |
|
113 | + * @return void |
|
114 | + * @since 5.4 |
|
115 | + */ |
|
116 | + final private function __clone(): void {} |
|
117 | 117 | } |
@@ -9,8 +9,7 @@ |
||
9 | 9 | * @link https://secure.php.net/manual/en/class.reflectionzendextension.php |
10 | 10 | * @since 5.4 |
11 | 11 | */ |
12 | -class ReflectionZendExtension implements Reflector |
|
13 | -{ |
|
12 | +class ReflectionZendExtension implements Reflector { |
|
14 | 13 | /** |
15 | 14 | * @var string Name of the extension, same as calling the {@see ReflectionZendExtension::getName()} method |
16 | 15 | */ |
@@ -11,27 +11,27 @@ |
||
11 | 11 | */ |
12 | 12 | class Reflection |
13 | 13 | { |
14 | - /** |
|
15 | - * Gets modifier names |
|
16 | - * |
|
17 | - * @link https://php.net/manual/en/reflection.getmodifiernames.php |
|
18 | - * @param int $modifiers Bitfield of the modifiers to get. |
|
19 | - * @return array An array of modifier names. |
|
20 | - */ |
|
21 | - #[TentativeType] |
|
22 | - public static function getModifierNames(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $modifiers): array {} |
|
14 | + /** |
|
15 | + * Gets modifier names |
|
16 | + * |
|
17 | + * @link https://php.net/manual/en/reflection.getmodifiernames.php |
|
18 | + * @param int $modifiers Bitfield of the modifiers to get. |
|
19 | + * @return array An array of modifier names. |
|
20 | + */ |
|
21 | + #[TentativeType] |
|
22 | + public static function getModifierNames(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $modifiers): array {} |
|
23 | 23 | |
24 | - /** |
|
25 | - * Exports |
|
26 | - * |
|
27 | - * @link https://php.net/manual/en/reflection.export.php |
|
28 | - * @param Reflector $reflector The reflection to export. |
|
29 | - * @param bool $return Setting to {@see true} will return the export, as |
|
30 | - * opposed to emitting it. Setting to {@see false} (the default) will do the opposite. |
|
31 | - * @return string|null If the return parameter is set to {@see true}, then the |
|
32 | - * export is returned as a string, otherwise {@see null} is returned. |
|
33 | - * @removed 8.0 |
|
34 | - */ |
|
35 | - #[Deprecated(since: '7.4')] |
|
36 | - public static function export(Reflector $reflector, $return = false) {} |
|
24 | + /** |
|
25 | + * Exports |
|
26 | + * |
|
27 | + * @link https://php.net/manual/en/reflection.export.php |
|
28 | + * @param Reflector $reflector The reflection to export. |
|
29 | + * @param bool $return Setting to {@see true} will return the export, as |
|
30 | + * opposed to emitting it. Setting to {@see false} (the default) will do the opposite. |
|
31 | + * @return string|null If the return parameter is set to {@see true}, then the |
|
32 | + * export is returned as a string, otherwise {@see null} is returned. |
|
33 | + * @removed 8.0 |
|
34 | + */ |
|
35 | + #[Deprecated(since: '7.4')] |
|
36 | + public static function export(Reflector $reflector, $return = false) {} |
|
37 | 37 | } |
@@ -9,8 +9,7 @@ |
||
9 | 9 | * |
10 | 10 | * @link https://php.net/manual/en/class.reflection.php |
11 | 11 | */ |
12 | -class Reflection |
|
13 | -{ |
|
12 | +class Reflection { |
|
14 | 13 | /** |
15 | 14 | * Gets modifier names |
16 | 15 | * |
@@ -4,21 +4,21 @@ |
||
4 | 4 | |
5 | 5 | final class Type |
6 | 6 | { |
7 | - /** Event::$object was read into Event::$value */ |
|
8 | - public const Read = 1; |
|
7 | + /** Event::$object was read into Event::$value */ |
|
8 | + public const Read = 1; |
|
9 | 9 | |
10 | - /** Input for Event::$source written to Event::$object */ |
|
11 | - public const Write = 2; |
|
10 | + /** Input for Event::$source written to Event::$object */ |
|
11 | + public const Write = 2; |
|
12 | 12 | |
13 | - /** Event::$object (Channel) was closed */ |
|
14 | - public const Close = 3; |
|
13 | + /** Event::$object (Channel) was closed */ |
|
14 | + public const Close = 3; |
|
15 | 15 | |
16 | - /** Event::$object (Future) was cancelled */ |
|
17 | - public const Cancel = 5; |
|
16 | + /** Event::$object (Future) was cancelled */ |
|
17 | + public const Cancel = 5; |
|
18 | 18 | |
19 | - /** Runtime executing Event::$object (Future) was killed */ |
|
20 | - public const Kill = 6; |
|
19 | + /** Runtime executing Event::$object (Future) was killed */ |
|
20 | + public const Kill = 6; |
|
21 | 21 | |
22 | - /** Event::$object (Future) raised error */ |
|
23 | - public const Error = 4; |
|
22 | + /** Event::$object (Future) raised error */ |
|
23 | + public const Error = 4; |
|
24 | 24 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace parallel\Events\Event; |
4 | 4 | |
5 | -final class Type |
|
6 | -{ |
|
5 | +final class Type { |
|
7 | 6 | /** Event::$object was read into Event::$value */ |
8 | 7 | public const Read = 1; |
9 | 8 |
@@ -14,26 +14,26 @@ |
||
14 | 14 | */ |
15 | 15 | final class Input |
16 | 16 | { |
17 | - /** |
|
18 | - * Shall set input for the given target |
|
19 | - * |
|
20 | - * @param string $target |
|
21 | - * @param mixed $value |
|
22 | - * |
|
23 | - * @throws Input\Error\Existence if input for target already exists. |
|
24 | - * @throws Input\Error\IllegalValue if value is illegal (object, null). |
|
25 | - */ |
|
26 | - public function add(string $target, $value): void {} |
|
17 | + /** |
|
18 | + * Shall set input for the given target |
|
19 | + * |
|
20 | + * @param string $target |
|
21 | + * @param mixed $value |
|
22 | + * |
|
23 | + * @throws Input\Error\Existence if input for target already exists. |
|
24 | + * @throws Input\Error\IllegalValue if value is illegal (object, null). |
|
25 | + */ |
|
26 | + public function add(string $target, $value): void {} |
|
27 | 27 | |
28 | - /** |
|
29 | - * Shall remove input for the given target |
|
30 | - * @param string $target |
|
31 | - * @throws Input\Error\Existence if input for target does not exist. |
|
32 | - */ |
|
33 | - public function remove(string $target): void {} |
|
28 | + /** |
|
29 | + * Shall remove input for the given target |
|
30 | + * @param string $target |
|
31 | + * @throws Input\Error\Existence if input for target does not exist. |
|
32 | + */ |
|
33 | + public function remove(string $target): void {} |
|
34 | 34 | |
35 | - /** |
|
36 | - * Shall remove input for all targets |
|
37 | - */ |
|
38 | - public function clear(): void {} |
|
35 | + /** |
|
36 | + * Shall remove input for all targets |
|
37 | + */ |
|
38 | + public function clear(): void {} |
|
39 | 39 | } |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * Note: When a parallel\Events object performs a write, the target is removed from the input object as if |
13 | 13 | * @see Input::remove() were called. |
14 | 14 | */ |
15 | -final class Input |
|
16 | -{ |
|
15 | +final class Input { |
|
17 | 16 | /** |
18 | 17 | * Shall set input for the given target |
19 | 18 | * |
@@ -8,27 +8,27 @@ |
||
8 | 8 | */ |
9 | 9 | final class Event |
10 | 10 | { |
11 | - /** |
|
12 | - * Shall be one of Event\Type constants |
|
13 | - * @var int |
|
14 | - */ |
|
15 | - public $type; |
|
11 | + /** |
|
12 | + * Shall be one of Event\Type constants |
|
13 | + * @var int |
|
14 | + */ |
|
15 | + public $type; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Shall be the source of the event (target name) |
|
19 | - * @var string |
|
20 | - */ |
|
21 | - public $source; |
|
17 | + /** |
|
18 | + * Shall be the source of the event (target name) |
|
19 | + * @var string |
|
20 | + */ |
|
21 | + public $source; |
|
22 | 22 | |
23 | - /** |
|
24 | - * Shall be either Future or Channel |
|
25 | - * @var object |
|
26 | - */ |
|
27 | - public $object; |
|
23 | + /** |
|
24 | + * Shall be either Future or Channel |
|
25 | + * @var object |
|
26 | + */ |
|
27 | + public $object; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Shall be set for Read/Error events |
|
31 | - * @var mixed |
|
32 | - */ |
|
33 | - public $value; |
|
29 | + /** |
|
30 | + * Shall be set for Read/Error events |
|
31 | + * @var mixed |
|
32 | + */ |
|
33 | + public $value; |
|
34 | 34 | } |
@@ -6,8 +6,7 @@ |
||
6 | 6 | * When an Event is returned, @see Event::$object shall be removed from the loop that returned it, should the event be a |
7 | 7 | * write event the Input for @see Event::$source shall also be removed. |
8 | 8 | */ |
9 | -final class Event |
|
10 | -{ |
|
9 | +final class Event { |
|
11 | 10 | /** |
12 | 11 | * Shall be one of Event\Type constants |
13 | 12 | * @var int |
@@ -14,46 +14,46 @@ |
||
14 | 14 | */ |
15 | 15 | final class Future |
16 | 16 | { |
17 | - /* Resolution */ |
|
18 | - |
|
19 | - /** |
|
20 | - * Shall return (and if necessary wait for) return from task |
|
21 | - * |
|
22 | - * @return mixed |
|
23 | - * |
|
24 | - * @throws Future\Error if waiting failed (internal error). |
|
25 | - * @throws Future\Error\Killed if \parallel\Runtime executing task was killed. |
|
26 | - * @throws Future\Error\Cancelled if task was cancelled. |
|
27 | - * @throws Future\Error\Foreign if task raised an unrecognized uncaught exception. |
|
28 | - * @throws Throwable Shall rethrow \Throwable uncaught in task |
|
29 | - */ |
|
30 | - public function value() {} |
|
31 | - |
|
32 | - /* State */ |
|
33 | - |
|
34 | - /** |
|
35 | - * Shall indicate if the task is completed |
|
36 | - * @return bool |
|
37 | - */ |
|
38 | - public function done(): bool {} |
|
39 | - |
|
40 | - /** |
|
41 | - * Shall indicate if the task was cancelled |
|
42 | - * @return bool |
|
43 | - */ |
|
44 | - public function cancelled(): bool {} |
|
45 | - |
|
46 | - /* Cancellation */ |
|
47 | - |
|
48 | - /** |
|
49 | - * Shall try to cancel the task |
|
50 | - * Note: If task is running, it will be interrupted. |
|
51 | - * Warning: Internal function calls in progress cannot be interrupted. |
|
52 | - * |
|
53 | - * @return bool |
|
54 | - * |
|
55 | - * @throws Future\Error\Killed if \parallel\Runtime executing task was killed. |
|
56 | - * @throws Future\Error\Cancelled if task was already cancelled. |
|
57 | - */ |
|
58 | - public function cancel(): bool {} |
|
17 | + /* Resolution */ |
|
18 | + |
|
19 | + /** |
|
20 | + * Shall return (and if necessary wait for) return from task |
|
21 | + * |
|
22 | + * @return mixed |
|
23 | + * |
|
24 | + * @throws Future\Error if waiting failed (internal error). |
|
25 | + * @throws Future\Error\Killed if \parallel\Runtime executing task was killed. |
|
26 | + * @throws Future\Error\Cancelled if task was cancelled. |
|
27 | + * @throws Future\Error\Foreign if task raised an unrecognized uncaught exception. |
|
28 | + * @throws Throwable Shall rethrow \Throwable uncaught in task |
|
29 | + */ |
|
30 | + public function value() {} |
|
31 | + |
|
32 | + /* State */ |
|
33 | + |
|
34 | + /** |
|
35 | + * Shall indicate if the task is completed |
|
36 | + * @return bool |
|
37 | + */ |
|
38 | + public function done(): bool {} |
|
39 | + |
|
40 | + /** |
|
41 | + * Shall indicate if the task was cancelled |
|
42 | + * @return bool |
|
43 | + */ |
|
44 | + public function cancelled(): bool {} |
|
45 | + |
|
46 | + /* Cancellation */ |
|
47 | + |
|
48 | + /** |
|
49 | + * Shall try to cancel the task |
|
50 | + * Note: If task is running, it will be interrupted. |
|
51 | + * Warning: Internal function calls in progress cannot be interrupted. |
|
52 | + * |
|
53 | + * @return bool |
|
54 | + * |
|
55 | + * @throws Future\Error\Killed if \parallel\Runtime executing task was killed. |
|
56 | + * @throws Future\Error\Cancelled if task was already cancelled. |
|
57 | + */ |
|
58 | + public function cancel(): bool {} |
|
59 | 59 | } |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @see https://www.php.net/manual/en/class.parallel-future.php |
14 | 14 | */ |
15 | -final class Future |
|
16 | -{ |
|
15 | +final class Future { |
|
17 | 16 | /* Resolution */ |
18 | 17 | |
19 | 18 | /** |