Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#73)
by Jérémiah
05:28
created

ReactPromiseAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 31
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A wait() 0 19 3
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Executor\Promise\Adapter;
13
14
use GraphQL\Executor\ExecutionResult;
15
use GraphQL\Executor\Promise\Adapter\ReactPromiseAdapter as BaseReactPromiseAdapter;
16
use GraphQL\Executor\Promise\Promise;
17
use Overblog\GraphQLBundle\Executor\Promise\PromiseAdapterInterface;
18
19
class ReactPromiseAdapter extends BaseReactPromiseAdapter implements PromiseAdapterInterface
20
{
21
    /**
22
     * Synchronously wait when promise completes.
23
     *
24
     * @param Promise $promise
25
     *
26
     * @return ExecutionResult
27
     *
28
     * @throws \Exception
29
     */
30
    public function wait(Promise $promise)
31
    {
32
        if (!static::isThenable($promise)) {
33
            return;
34
        }
35
        $resolvedValue = null;
36
        $exception = null;
37
        $promise->then(function ($values) use (&$resolvedValue) {
38
            $resolvedValue = $values;
39
        }, function ($reason) use (&$exception) {
40
            $exception = $reason;
41
        });
42
43
        if ($exception instanceof \Exception) {
44
            throw $exception;
45
        }
46
47
        return $resolvedValue;
48
    }
49
}
50