Completed
Push — master ( ceb9a8...527314 )
by ARCANEDEV
14s
created

ElevationCollection::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

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