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

NoShippingDriver::calculate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
eloc 1
nc 1
nop 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