Test Failed
Push — master ( 5878a7...1a655d )
by Alexey
05:08
created

DeliveryProvider::availablePayTypeGroups()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * INJI
4
 *
5
 * @author Alexey Krupskiy <[email protected]>
6
 * @link http://inji.ru/
7
 * @copyright 2017 Alexey Krupskiy
8
 * @license https://github.com/injitools/Inji/blob/master/LICENSE
9
 */
10
11
namespace Ecommerce;
12
13
14
class DeliveryProvider {
15
    static $name = 'Unnamed';
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $name.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
16
17
    static function calcPrice($cart) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
18
        return new \Money\Sums([]);
19
    }
20
21
    static function deliveryTime($cart) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
22
        return [
23
            'min' => 0,
24
            'max' => 0
25
        ];
26
    }
27
28
    static function config() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
29
30
        $provider = \Ecommerce\Delivery\Provider::get((new \ReflectionClass(get_called_class()))->getShortName(), 'object');
31
        $config = [];
32
        foreach ($provider->configs as $item) {
33
            $config[$item->name] = $item->value;
34
        }
35
        return $config;
36
    }
37
38
    static function availablePayTypeGroups($cart) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
39
        return ['*'];
40
    }
41
}