Completed
Push — master ( 141c37...4e2b2d )
by Scott
04:28
created

NoShippingDriver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 36
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A driverDetails() 0 6 1
A calculate() 0 3 1
A getFormFields() 0 6 1
1
<?php namespace Bedard\Shop\Drivers;
2
3
use Bedard\Shop\Models\Cart;
4
use October\Rain\Parse\Yaml;
5
use Bedard\Shop\Interfaces\ShippingDriverInterface;
6
7
class NoShippingDriver implements ShippingDriverInterface
8
{
9
    /**
10
     * Return details about this driver.
11
     *
12
     * @return array
13
     */
14
    public function driverDetails()
15
    {
16
        return [
17
            'name' => 'No shipping',
18
        ];
19
    }
20
21
    /**
22
     * Calculate the shipping for a cart.
23
     *
24
     * @param  Cart   $cart
25
     * @return float
26
     */
27
    public function calculate(Cart $cart)
28
    {
29
    }
30
31
    /**
32
     * Return the form fields for this driver.
33
     *
34
     * @return array
35
     */
36
    public function getFormFields()
37
    {
38
        $yaml = new Yaml;
39
40
        return $yaml->parseFile(__DIR__ . '/noshipping/fields.yaml');
41
    }
42
}
43