GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

functions.php ➔ arrayToValuePromises()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 2
rs 9.4285
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of PhuninNode.
6
 *
7
 ** (c) 2013 - 2016 Cees-Jan Kiewiet
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace WyriHaximus\PhuninNode;
14
15
use React\Promise\PromiseInterface;
16
use function React\Promise\all;
17
use function React\Promise\resolve;
18
19
/**
20
 * @param array $promises
21
 * @return PromiseInterface
22
 */
23
function metricPromisesToObjectStorage(array $promises): PromiseInterface
24
{
25
    return all($promises)->then(function ($values) {
26 9
        $storage = new \SplObjectStorage();
27 9
        foreach ($values as $value) {
28 9
            $storage->attach($value);
29
        }
30 9
        return resolve($storage);
31 9
    });
32
}
33
34
/**
35
 * @param array $array
36
 * @return \Generator
37
 */
38
function arrayToValuePromises(array $array): \Generator
39
{
40 1
    foreach ($array as $key => $value) {
41 1
        yield resolve(new Value($key, $value));
42
    }
43 1
}
44
45
/**
46
 * @param array $array
47
 * @return \Generator
48
 */
49
function arrayToMetricPromises(array $array): \Generator
50
{
51 2
    foreach ($array as $key => $value) {
52 2
        yield resolve(new Metric($key, $value));
53
    }
54
}
55