EcommerceCustomDeliveryPostalCode   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCMSFields() 0 6 1
1
<?php
2
3
class EcommerceCustomDeliveryPostalCode extends DataObject
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    private static $db = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
6
        'Title' => 'Varchar(255)',
7
        'PostalCodeLowestNumber' => 'Int',
8
        'PostalCodeHighestNumber' => 'Int',
9
        'PriceWithoutApplicableProducts' => 'Currency',
10
        'PriceWithApplicableProducts' => 'Currency'
11
    );
12
13
    private static $singular_name = "Postal Code Special Delivery Zone";
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $singular_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
14
15
    private static $belongs_many_many = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $belongs_many_many is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
16
        "EcommerceDBConfigs" => "EcommerceDBConfig"
17
    );
18
19
    private static $summary_fields = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $summary_fields is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
20
        'Title' => 'Title',
21
        'PostalCodeLowestNumber' => 'Postal Code From ',
22
        'PostalCodeHighestNumber' => 'Postal Code To',
23
        'PriceWithoutApplicableProducts' => 'w/out Special Products',
24
        'PriceWithApplicableProducts' => 'w/ Special Products'
25
    );
26
    private static $field_labels = array(
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $field_labels is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
27
        'PostalCodeLowestNumber' => 'Lowest postal code (e.g. 2011)',
28
        'PostalCodeHighestNumber' => 'Highest postal code (e.g. 2015)',
29
        'PriceWithoutApplicableProducts' => 'Delivery charge for orders without special products',
30
        'PriceWithApplicableProducts' => 'Delivery charge for orders with special products'
31
    );
32
33
    public function getCMSFields()
34
    {
35
        $fields = parent::getCMSFields();
36
        $fields->removeFieldFromTab("Root", "EcommerceDBConfigs");
37
        return $fields;
38
    }
39
}
40