Completed
Pull Request — master (#99)
by thomas
18:19
created

OutputsNormalizer::readArrayFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Blocktrail\SDK;
4
5
class OutputsNormalizer
6
{
7
    private function readArrayFormat() {
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
8
    }
9
10
    private function readKeyedFormat() {
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
11
    }
12
13
    public function normalize(array $outputs) {
14
        if (empty($outputs)) {
15
            return [];
16
        }
17
18
        $keys = array_keys($outputs);
19
        if ($keys[count($keys) - 1]) {
0 ignored issues
show
Unused Code introduced by
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
20
        }
21
    }
22
}
23