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
10:20
created

GraphQLPromiseAdapter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 24
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isThenable() 0 6 3
A convertThenable() 0 8 2
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\Promise\Adapter\SyncPromise;
15
use GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter as BaseSyncPromiseAdapter;
16
use GraphQL\Executor\Promise\Promise;
17
use Overblog\GraphQLBundle\Executor\Promise\PromiseAdapterInterface;
18
19
class GraphQLPromiseAdapter extends BaseSyncPromiseAdapter implements PromiseAdapterInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 34
    public function isThenable($value)
25
    {
26 34
        $valueOrPromise = $value instanceof Promise ? $value->adoptedPromise : $value;
27
28 34
        return parent::isThenable($valueOrPromise) || $valueOrPromise instanceof SyncPromise;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 8
    public function convertThenable($thenable)
35
    {
36 8
        if ($thenable instanceof Promise) {
37 8
            return $thenable;
38
        }
39
40
        return parent::convertThenable($thenable);
41
    }
42
}
43