@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public function __construct($name, $type = 'accordion', $config = []) |
8 | 8 | { |
9 | - parent::__construct($name, $type, $config); |
|
9 | + parent::__construct($name, $type, $config); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | public function setOpen($value = 1) |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function transform($config) |
33 | 33 | { |
34 | - foreach ($config as $key => $value ) { |
|
34 | + foreach ($config as $key => $value) { |
|
35 | 35 | if ($this->shouldTransformValue($key, $config)) { |
36 | 36 | $config = $this->transformConfig($config); |
37 | 37 | $config[$key] = $this->transformValue($value); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $config['_has_custom_collapsed_key'] = true; |
46 | 46 | } else { |
47 | 47 | $fieldKey = preg_replace('/^field_/', '', $fieldKey); |
48 | - $config['collapsed'] = $this->getName() . '_' . $fieldKey; |
|
48 | + $config['collapsed'] = $this->getName().'_'.$fieldKey; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | return $config; |
@@ -74,6 +74,6 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function getDefaultButtonLabel() |
76 | 76 | { |
77 | - return 'Add ' . $this->singularize($this->getLabel()); |
|
77 | + return 'Add '.$this->singularize($this->getLabel()); |
|
78 | 78 | } |
79 | 79 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | return $this->getBuilder()->getField($value)->getKey(); |
35 | 35 | } |
36 | 36 | |
37 | - return $value; |
|
37 | + return $value; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function transformConfig($config) |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public function transformValue($value) |
32 | 32 | { |
33 | - if ($this->getBuilder()->fieldExists($value)){ |
|
33 | + if ($this->getBuilder()->fieldExists($value)) { |
|
34 | 34 | return $this->getBuilder()->getField($value)->getKey(); |
35 | 35 | } |
36 | 36 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | private function buildLayouts() |
49 | 49 | { |
50 | - return array_map(function ($layout) { |
|
50 | + return array_map(function($layout) { |
|
51 | 51 | $layout = ($layout instanceof Builder) ? $layout->build() : $layout; |
52 | 52 | return $this->transformLayout($layout); |
53 | 53 | }, $this->getLayouts()); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | private function getDefaultButtonLabel() |
177 | 177 | { |
178 | - return 'Add ' . $this->singularize($this->getLabel()); |
|
178 | + return 'Add '.$this->singularize($this->getLabel()); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | public function removeLayout($name) |
@@ -223,8 +223,7 @@ |
||
223 | 223 | } elseif ($modify instanceof \Closure) { |
224 | 224 | throw new \Exception('FieldsBuilder can\'t be modified with a closure.'); |
225 | 225 | } |
226 | - } |
|
227 | - else if (is_array($modify)) { |
|
226 | + } else if (is_array($modify)) { |
|
228 | 227 | $this->updateConfig($modify); |
229 | 228 | } elseif ($modify instanceof \Closure) { |
230 | 229 | throw new \Exception('FlexibleContentBuilder can\'t be modified with a closure.'); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | private function namespaceGroupKey($key) |
100 | 100 | { |
101 | 101 | if (strpos($key, 'group_') !== 0) { |
102 | - $key = 'group_' . $key; |
|
102 | + $key = 'group_'.$key; |
|
103 | 103 | } |
104 | 104 | return $key; |
105 | 105 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | private function buildFields() |
126 | 126 | { |
127 | - $fields = array_map(function ($field) { |
|
127 | + $fields = array_map(function($field) { |
|
128 | 128 | return ($field instanceof Builder) ? $field->build() : $field; |
129 | 129 | }, $this->getFields()); |
130 | 130 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | */ |
559 | 559 | public function addMessage($label, $message, array $args = []) |
560 | 560 | { |
561 | - $name = $this->generateName($label) . '_message'; |
|
561 | + $name = $this->generateName($label).'_message'; |
|
562 | 562 | $args = array_merge([ |
563 | 563 | 'label' => $label, |
564 | 564 | 'message' => $message, |
@@ -49,9 +49,9 @@ |
||
49 | 49 | if ($groupName) { |
50 | 50 | // remove field_ or group_ if already at the begining of the key |
51 | 51 | $value = preg_replace('/^field_|^group_/', '', $value); |
52 | - $namespace .= str_replace(' ', '_', $groupName) . '_'; |
|
52 | + $namespace .= str_replace(' ', '_', $groupName).'_'; |
|
53 | 53 | } |
54 | - return strtolower($namespace . $value); |
|
54 | + return strtolower($namespace.$value); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | public function shouldTransformValue($key, $config) |
@@ -140,7 +140,7 @@ |
||
140 | 140 | public function setKey($key) |
141 | 141 | { |
142 | 142 | if (!preg_match('/^field_/', $key)) { |
143 | - $key = 'field_' . $key; |
|
143 | + $key = 'field_'.$key; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $this->setConfig('key', $key); |