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:22
created

ReactPromiseAdapter::wait()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 1
crap 6
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
    public function wait(Promise $promise)
29
    {
30
        if (!static::isThenable($promise)) {
31
            return;
32
        }
33
        $resolvedValue = null;
34
        $promise->then(function ($values) use (&$resolvedValue) {
35
            $resolvedValue = $values;
36
        });
37
38
        return $resolvedValue;
39
    }
40
}
41