Completed
Pull Request — master (#4)
by ARCANEDEV
05:31
created

StepCollection::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php namespace Arcanedev\GeoLocation\Google\Directions\Entities;
2
3
use Illuminate\Support\Collection;
4
5
/**
6
 * Class     StepCollection
7
 *
8
 * @package  Arcanedev\GeoLocation\Google\Directions\Entities
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class StepCollection extends Collection
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Load the steps data into the collection.
20
     *
21
     * @param  array  $steps
22
     *
23
     * @return self
24
     */
25 21
    public static function load(array $steps)
26
    {
27 21
        $collect = new static();
28
29 21
        foreach ($steps as $step) {
30 21
            $collect->push(new Step($step));
31 7
        }
32 21
        return $collect;
33
    }
34
}
35