1 | <?php namespace Anomaly\ConfigurationModule\Configuration\Form; |
||
12 | class ConfigurationFormBuilder extends FormBuilder |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * The configuration scope. |
||
17 | * |
||
18 | * @var null|string |
||
19 | */ |
||
20 | protected $scope = null; |
||
21 | |||
22 | /** |
||
23 | * No model needed. |
||
24 | * |
||
25 | * @var bool |
||
26 | */ |
||
27 | protected $model = false; |
||
28 | |||
29 | /** |
||
30 | * The form fields. |
||
31 | * |
||
32 | * @var ConfigurationFormFields |
||
33 | */ |
||
34 | protected $fields = ConfigurationFormFields::class; |
||
35 | |||
36 | /** |
||
37 | * The form actions handler. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $actions = [ |
||
42 | 'save', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * The form buttons handler. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $buttons = [ |
||
51 | 'cancel', |
||
52 | ]; |
||
53 | |||
54 | /** |
||
55 | * Fired when the builder is ready to build. |
||
56 | * |
||
57 | * @throws \Exception |
||
58 | */ |
||
59 | public function onReady() |
||
65 | |||
66 | /** |
||
67 | * Get the scope. |
||
68 | * |
||
69 | * @return null|string |
||
70 | */ |
||
71 | public function getScope() |
||
75 | |||
76 | /** |
||
77 | * Set the scope. |
||
78 | * |
||
79 | * @param $scope |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function setScope($scope) |
||
88 | } |
||
89 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: