Passed
Pull Request — master (#20)
by Jason
01:32
created

PurchasableExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 19
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A AddToCartForm() 0 7 1
1
<?php
2
3
namespace Dynamic\Foxy\Extension;
4
5
use Dynamic\Foxy\Form\AddToCartForm;
6
use SilverStripe\Core\Extension;
7
8
class PurchasableExtension extends Extension
9
{
10
    /**
11
     * @var array
12
     */
13
    private static $allowed_actions = array(
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
14
        'AddToCartForm',
15
    );
16
17
    /**
18
     * @return FoxyStripePurchaseForm
0 ignored issues
show
Bug introduced by
The type Dynamic\Foxy\Extension\FoxyStripePurchaseForm 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...
19
     */
20
    public function AddToCartForm()
21
    {
22
        $form = AddToCartForm::create($this->owner, __FUNCTION__, null, null, null, $this->owner->data());
23
24
        $this->owner->extend('updateAddToCartForm', $form);
25
26
        return $form;
27
    }
28
}
29