Completed
Pull Request — master (#4)
by ARCANEDEV
01:52
created

LegCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 2
1
<?php namespace Arcanedev\GeoLocation\Google\Directions\Entities;
2
3
use Illuminate\Support\Collection;
4
5
/**
6
 * Class     LegCollection
7
 *
8
 * @package  Arcanedev\GeoLocation\Google\Directions\Entities
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class LegCollection extends Collection
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Load the legs data.
20
     *
21
     * @param  array  $legs
22
     *
23
     * @return self
24
     */
25
    public static function load(array $legs)
26
    {
27
        $collect = new static;
28
29
        foreach ($legs as $leg) {
30
            $collect->push(new Leg($leg));
31
        }
32
33
        return $collect;
34
    }
35
}
36