ProductQuestion_ProductAttributeValues   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 3 1
A onAfterWrite() 0 6 2
1
<?php
2
3
4
5
/**
6
 * adds functionality to Products
7
 *
8
 *
9
 *
10
 */
11
class ProductQuestion_ProductAttributeValues extends DataExtension
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...
12
{
13
    private static $many_many = array(
0 ignored issues
show
Unused Code introduced by
The property $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...
14
        'ProductQuestions' => 'ProductQuestion'
15
    );
16
17
    public function updateCMSFields(FieldList $fields)
18
    {
19
    }
20
21
    public function onAfterWrite()
22
    {
23
        foreach ($this->ProductQuestions() as $question) {
0 ignored issues
show
Bug introduced by
The method ProductQuestions() does not seem to exist on object<ProductQuestion_ProductAttributeValues>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
24
            $question->write();
25
        }
26
    }
27
}
28