updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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