Passed
Pull Request — master (#408)
by Alexander
02:27
created

ArrayOfUpdates::fromResponse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
abstract class ArrayOfUpdates
6
{
7 3
    public static function fromResponse($data)
8
    {
9 3
        $arrayOfUpdates = [];
10 3
        foreach ($data as $update) {
11 3
            $arrayOfUpdates[] = Update::fromResponse($update);
12 3
        }
13
14 3
        return $arrayOfUpdates;
15
    }
16
}
17