GuzzleFactoryHelper::createResolvedPromise()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 3
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of forecast.it.fill project.
7
 * (c) Patrick Jaja <[email protected]>
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace ForecastAutomationTests\GuzzleClient\Shared;
13
14
use GuzzleHttp\Promise\Promise;
15
use GuzzleHttp\Promise\PromiseInterface;
16
use PHPUnit\Framework\TestCase;
17
18
/**
19
 * @internal
20
 * @coversNothing
21
 */
22
class GuzzleFactoryHelper extends TestCase
23
{
24
    public function createResolvedPromise($data): PromiseInterface
25
    {
26
        $resolvedPromise = new Promise(function () use (&$resolvedPromise, $data) {
27
            $resolvedPromise->resolve($data);
28
        });
29
30
        return $resolvedPromise;
31
    }
32
}
33