Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea 1...
1
<?php
1
<?php
Línea -... Línea 2...
-
 
2
 
-
 
3
declare(strict_types=1);
2
 
4
 
Línea 3... Línea 5...
3
namespace GuzzleHttp\Promise;
5
namespace GuzzleHttp\Promise;
4
 
6
 
5
final class Is
7
final class Is
6
{
8
{
7
    /**
-
 
8
     * Returns true if a promise is pending.
-
 
9
     *
9
    /**
10
     * @return bool
10
     * Returns true if a promise is pending.
11
     */
11
     */
12
    public static function pending(PromiseInterface $promise)
12
    public static function pending(PromiseInterface $promise): bool
13
    {
13
    {
Línea 14... Línea 14...
14
        return $promise->getState() === PromiseInterface::PENDING;
14
        return $promise->getState() === PromiseInterface::PENDING;
15
    }
15
    }
16
 
-
 
17
    /**
-
 
18
     * Returns true if a promise is fulfilled or rejected.
16
 
19
     *
17
    /**
20
     * @return bool
18
     * Returns true if a promise is fulfilled or rejected.
21
     */
19
     */
22
    public static function settled(PromiseInterface $promise)
20
    public static function settled(PromiseInterface $promise): bool
Línea 23... Línea 21...
23
    {
21
    {
24
        return $promise->getState() !== PromiseInterface::PENDING;
22
        return $promise->getState() !== PromiseInterface::PENDING;
25
    }
-
 
26
 
-
 
27
    /**
23
    }
28
     * Returns true if a promise is fulfilled.
24
 
29
     *
25
    /**
30
     * @return bool
26
     * Returns true if a promise is fulfilled.
31
     */
27
     */
Línea 32... Línea 28...
32
    public static function fulfilled(PromiseInterface $promise)
28
    public static function fulfilled(PromiseInterface $promise): bool
33
    {
29
    {
34
        return $promise->getState() === PromiseInterface::FULFILLED;
-
 
35
    }
-
 
36
 
30
        return $promise->getState() === PromiseInterface::FULFILLED;
37
    /**
31
    }
38
     * Returns true if a promise is rejected.
32
 
39
     *
33
    /**
40
     * @return bool
34
     * Returns true if a promise is rejected.
41
     */
35
     */