@@ -37,12 +37,12 @@ |
||
37 | 37 | { |
38 | 38 | $this->configure(); |
39 | 39 | |
40 | - $this->app->singleton(FormerHelperContract::class, function ($app) { |
|
41 | - return new FormerHelper($app['view'], $app['translator'], $app['config'], $app['url']); |
|
40 | + $this->app->singleton(FormerHelperContract::class, function($app) { |
|
41 | + return new FormerHelper($app[ 'view' ], $app[ 'translator' ], $app[ 'config' ], $app[ 'url' ]); |
|
42 | 42 | }); |
43 | 43 | |
44 | - $this->app->singleton(FormerContract::class, function ($app) { |
|
45 | - return new Former($app[FormerHelperContract::class]); |
|
44 | + $this->app->singleton(FormerContract::class, function($app) { |
|
45 | + return new Former($app[ FormerHelperContract::class ]); |
|
46 | 46 | }); |
47 | 47 | } |
48 | 48 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @var array |
42 | 42 | */ |
43 | - protected $ruleMap = []; |
|
43 | + protected $ruleMap = [ ]; |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Get the name of field. |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | $ruleMap = $this->ruleMap; |
130 | 130 | |
131 | 131 | // If "required" is not exists, add it for default. |
132 | - if (!isset($ruleMap['required'])) { |
|
133 | - $ruleMap['required'] = 'required'; |
|
132 | + if (!isset($ruleMap[ 'required' ])) { |
|
133 | + $ruleMap[ 'required' ] = 'required'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | foreach ($this->ruleMap as $rule => $map) |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | if (preg_match("/^{$rule}\:/", $fieldRule)) { |
149 | 149 | $explode = explode(':', $fieldRule); |
150 | 150 | |
151 | - $html .= " {$mapAttribute}=\"{$explode[$index]}\""; |
|
151 | + $html .= " {$mapAttribute}=\"{$explode[ $index ]}\""; |
|
152 | 152 | break; |
153 | 153 | } |
154 | 154 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param null $theme |
38 | 38 | * @return Form |
39 | 39 | */ |
40 | - public function make(array $formRules, Model $model = null, array $types = [], $theme = null) |
|
40 | + public function make(array $formRules, Model $model = null, array $types = [ ], $theme = null) |
|
41 | 41 | { |
42 | 42 | $form = new Form( |
43 | 43 | $model, $this->helper |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | $form->addField( |
56 | - isset($types[$name]) ? $this->helper->getFieldClassFromType($types[$name]) : $this->helper->getFieldClassFromRules($rules), |
|
56 | + isset($types[ $name ]) ? $this->helper->getFieldClassFromType($types[ $name ]) : $this->helper->getFieldClassFromRules($rules), |
|
57 | 57 | $name, |
58 | 58 | $rules |
59 | 59 | ); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @param string|null $theme |
17 | 17 | * @return Form |
18 | 18 | */ |
19 | - public function make(array $rules, Model $model = null, array $types = [], $theme = null); |
|
19 | + public function make(array $rules, Model $model = null, array $types = [ ], $theme = null); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Make a form instance by using the form request. |