ProductWishListForm::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Dynamic\Wishlist\Form;
4
5
use Dynamic\Wishlist\Model\ProductWishList;
6
use SilverStripe\Control\Controller;
7
use SilverStripe\Core\Injector\Injector;
8
use SilverStripe\Forms\Form;
9
10
/**
11
 * Class ProductWishListForm
12
 */
13
class ProductWishListForm extends Form
14
{
15
16
    /**
17
     * ProductWishListForm constructor.
18
     *
19
     * @param Controller $controller
20
     * @param string $name
21
     */
22
    public function __construct(Controller $controller, $name = 'WishListForm')
23
    {
24
        $wishList = Injector::inst()->get(ProductWishList::class);
25
26
        $fields = $wishList->getFrontEndFields();
27
        $actions = $wishList->getFrontEndActions();
28
        $validator = $wishList->getFrontEndRequiredFields();
29
30
        parent::__construct($controller, $name, $fields, $actions, $validator);
31
    }
32
33
}
34