Passed
Push — master ( 97d330...e7fc5b )
by Jason
01:48
created

OrderDetail   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCMSFields() 0 5 1
1
<?php
2
3
namespace Dynamic\Foxy\Orders\Model;
4
5
use SilverStripe\CMS\Model\SiteTree;
6
use SilverStripe\ORM\DataObject;
7
8
class OrderDetail extends DataObject
9
{
10
    /**
11
     * @var array
12
     */
13
    private static $db = array(
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
14
        'Quantity' => 'Int',
15
        'Price' => 'Currency',
16
        'ProductName' => 'Varchar(255)',
17
        'ProductCode' => 'Varchar(100)',
18
        'ProductImage' => 'Text',
19
        'ProductCategory' => 'Varchar(100)',
20
    );
21
22
    /**
23
     * @var array
24
     */
25
    private static $has_one = array(
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
26
        'Product' => SiteTree::class,
27
        'Order' => Order::class,
28
    );
29
30
    /**
31
     * @var array
32
     */
33
    private static $has_many = array(
0 ignored issues
show
introduced by
The private property $has_many is not used, and could be removed.
Loading history...
34
        'OrderOptions' => OrderOption::class,
35
    );
36
37
    /**
38
     * @var array
39
     */
40
    private static $summary_fields = array(
0 ignored issues
show
introduced by
The private property $summary_fields is not used, and could be removed.
Loading history...
41
        'Product.Title',
42
        'Quantity',
43
        'Price.Nice',
44
    );
45
46
    /**
47
     * @var string
48
     */
49
    private static $table_name = 'FoxyOrderDetail';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
50
51
    /**
52
     * @return FieldList
0 ignored issues
show
Bug introduced by
The type Dynamic\Foxy\Orders\Model\FieldList was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
53
     */
54
    public function getCMSFields()
55
    {
56
        $fields = parent::getCMSFields();
57
58
        return $fields;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $fields returns the type SilverStripe\Forms\FieldList which is incompatible with the documented return type Dynamic\Foxy\Orders\Model\FieldList.
Loading history...
59
    }
60
}
61