Conditions | 1 |
Paths | 1 |
Total Lines | 34 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function __construct() |
||
14 | { |
||
15 | $license = "You must accept the <a href=http://opensource.org/licenses/GPL-3.0>license agreement</a>."; |
||
16 | |||
17 | parent::__construct( |
||
18 | [], |
||
19 | [ |
||
20 | "accept_mail" => [ |
||
21 | "type" => "checkbox", |
||
22 | "label" => "It´s great if you send me product information by mail.", |
||
23 | "checked" => false, |
||
24 | ], |
||
25 | |||
26 | "accept_phone" => [ |
||
27 | "type" => "checkbox", |
||
28 | "label" => "You may call me to try and sell stuff.", |
||
29 | "checked" => true, |
||
30 | ], |
||
31 | |||
32 | "accept_agreement" => [ |
||
33 | "type" => "checkbox", |
||
34 | "label" => $license, |
||
35 | "required" => true, |
||
36 | "validation" => ["must_accept"], |
||
37 | ], |
||
38 | |||
39 | "submit" => [ |
||
40 | "type" => "submit", |
||
41 | "value" => "Submit", |
||
42 | "callback" => [$this, "callbackSubmit"] |
||
43 | ], |
||
44 | ] |
||
45 | ); |
||
46 | } |
||
47 | |||
62 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.