@@ -105,8 +105,9 @@ |
||
105 | 105 | public function getItemsDisplay() |
106 | 106 | { |
107 | 107 | $items = $this->getItems(); |
108 | - foreach ($items as $key => $value) |
|
109 | - $items[$key] = '<span class="neonField_labelText">'.$value.'</span>'; |
|
108 | + foreach ($items as $key => $value) { |
|
109 | + $items[$key] = '<span class="neonField_labelText">'.$value.'</span>'; |
|
110 | + } |
|
110 | 111 | return $items; |
111 | 112 | } |
112 | 113 |
@@ -153,7 +153,7 @@ |
||
153 | 153 | * Assumes a single value for the choice |
154 | 154 | * @return string |
155 | 155 | */ |
156 | - public function getValueDisplay($context='') |
|
156 | + public function getValueDisplay($context = '') |
|
157 | 157 | { |
158 | 158 | $items = $this->getItems(); |
159 | 159 | return isset($items[$this->getValue()]) ? $items[$this->getValue()] : ''; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * @inheritdoc |
92 | 92 | */ |
93 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
93 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
94 | 94 | { |
95 | 95 | $searchData = ($searchData === null) ? $this->getData() : $searchData; |
96 | 96 | if ($searchData !== '') { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | $value = parent::getValue(); |
128 | 128 | // the result must be an array with 'from'=> and 'to'=> |
129 | - if ( is_array($value) && isset($value['from'], $value['to']) ) { |
|
129 | + if (is_array($value) && isset($value['from'], $value['to'])) { |
|
130 | 130 | return [ |
131 | 131 | 'from' => $this->_isDateValid($value['from']) ? $value['from'] : '', |
132 | 132 | 'to' => $this->_isDateValid($value['to']) ? $value['to'] : '' |
@@ -96,10 +96,12 @@ |
||
96 | 96 | if ($searchData !== '') { |
97 | 97 | $dateFrom = Arr::get($searchData, 'from'); |
98 | 98 | $dateTo = Arr::get($searchData, 'to'); |
99 | - if ($dateFrom) |
|
100 | - $query->where($this->getDataKey(), '>=', $dateFrom); |
|
101 | - if ($dateTo) |
|
102 | - $query->where($this->getDataKey(), '<=', $dateTo); |
|
99 | + if ($dateFrom) { |
|
100 | + $query->where($this->getDataKey(), '>=', $dateFrom); |
|
101 | + } |
|
102 | + if ($dateTo) { |
|
103 | + $query->where($this->getDataKey(), '<=', $dateTo); |
|
104 | + } |
|
103 | 105 | } |
104 | 106 | } |
105 | 107 |
@@ -96,8 +96,9 @@ discard block |
||
96 | 96 | public function getItems() |
97 | 97 | { |
98 | 98 | // if we haven't or can't map a map request we can't have any values |
99 | - if (empty($this->dataMapKey)) |
|
100 | - return []; |
|
99 | + if (empty($this->dataMapKey)) { |
|
100 | + return []; |
|
101 | + } |
|
101 | 102 | |
102 | 103 | $provider = $this->getProviderService(); |
103 | 104 | $format = false; |
@@ -119,8 +120,9 @@ discard block |
||
119 | 120 | $concat = isset($format['concat']) ? $format['concat'] : ' '; |
120 | 121 | $prefix = isset($format['prefix']) ? $format['prefix'] : ''; |
121 | 122 | $postfix = isset($format['postfix']) ? $format['postfix'] : ''; |
122 | - foreach ($items as $k=>$i) |
|
123 | - $items[$k] = $prefix.implode($concat, is_array($i) ? $i : [$i]).$postfix; |
|
123 | + foreach ($items as $k=>$i) { |
|
124 | + $items[$k] = $prefix.implode($concat, is_array($i) ? $i : [$i]).$postfix; |
|
125 | + } |
|
124 | 126 | } |
125 | 127 | return $items; |
126 | 128 | } |
@@ -184,8 +186,9 @@ discard block |
||
184 | 186 | public function setValueFromDb($value) |
185 | 187 | { |
186 | 188 | parent::setValueFromDb($value); |
187 | - if (!empty($value)) |
|
188 | - $this->makeMapRequest($value); |
|
189 | + if (!empty($value)) { |
|
190 | + $this->makeMapRequest($value); |
|
191 | + } |
|
189 | 192 | return $this; |
190 | 193 | } |
191 | 194 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * Any filters you want to apply to a data map selection. |
64 | 64 | * @var array field=>value |
65 | 65 | */ |
66 | - public $dataMapFilters=[]; |
|
66 | + public $dataMapFilters = []; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Any fields you want to return in a data map selection if not the default. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * string (otherwise with a space) and prefix postfix arguments will be |
75 | 75 | * applied to it. |
76 | 76 | */ |
77 | - public $dataMapFields=[]; |
|
77 | + public $dataMapFields = []; |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * @inheritdoc |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return array |
131 | 131 | * @throws \Exception |
132 | 132 | */ |
133 | - public function getMapObjects($query=null, $start=0, $length=100) |
|
133 | + public function getMapObjects($query = null, $start = 0, $length = 100) |
|
134 | 134 | { |
135 | 135 | $provider = $this->getProviderService(); |
136 | 136 | $format = ['prefix'=>'', 'concat'=>' ', 'postfix' => '']; |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @inheritdoc |
164 | 164 | */ |
165 | - public function getValueDisplay($context='') |
|
165 | + public function getValueDisplay($context = '') |
|
166 | 166 | { |
167 | 167 | $items = $this->getItems(); |
168 | 168 | if (is_array($this->value)) { |
169 | 169 | $values = array_intersect_key($items, array_flip($this->value)); |
170 | - return implode(', ',$values); |
|
170 | + return implode(', ', $values); |
|
171 | 171 | } else if (isset($items[$this->value])) { |
172 | 172 | return $items[$this->value]; |
173 | 173 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | /** |
201 | 201 | * @inheritdoc |
202 | 202 | */ |
203 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
203 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
204 | 204 | { |
205 | 205 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
206 | 206 | if ($searchData !== '') { |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public function getComponentDetails() |
244 | 244 | { |
245 | 245 | return [ |
246 | - 'name' => 'Link One', 'icon' => 'fa fa-link', 'group' => 'Table Links', |
|
246 | + 'name' => 'Link One', 'icon' => 'fa fa-link', 'group' => 'Table Links', |
|
247 | 247 | ]; |
248 | 248 | } |
249 | 249 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | public function setValue($value) |
54 | 54 | { |
55 | 55 | if ($value === 'true' || $value === true) |
56 | - $this->getForm()->submittedButton=$this->getName(); |
|
56 | + $this->getForm()->submittedButton = $this->getName(); |
|
57 | 57 | return $this; |
58 | 58 | } |
59 | 59 | } |
60 | 60 | \ No newline at end of file |
@@ -52,8 +52,9 @@ |
||
52 | 52 | */ |
53 | 53 | public function setValue($value) |
54 | 54 | { |
55 | - if ($value === 'true' || $value === true) |
|
56 | - $this->getForm()->submittedButton=$this->getName(); |
|
55 | + if ($value === 'true' || $value === true) { |
|
56 | + $this->getForm()->submittedButton=$this->getName(); |
|
57 | + } |
|
57 | 58 | return $this; |
58 | 59 | } |
59 | 60 | } |
60 | 61 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * @inheritdoc |
37 | 37 | */ |
38 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
38 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
39 | 39 | { |
40 | 40 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
41 | 41 | if (!empty($searchData)) { |
@@ -50,8 +50,9 @@ |
||
50 | 50 | { |
51 | 51 | $guesser = new \Faker\Guesser\Name(faker()); |
52 | 52 | $guess = $guesser->guessFormat($this->getName(), 150); |
53 | - if (is_callable($guess)) |
|
54 | - return $guess(); |
|
53 | + if (is_callable($guess)) { |
|
54 | + return $guess(); |
|
55 | + } |
|
55 | 56 | return faker()->realText(mt_rand(10, 150)); |
56 | 57 | } |
57 | 58 |
@@ -21,9 +21,9 @@ |
||
21 | 21 | */ |
22 | 22 | public function getFieldHtml() |
23 | 23 | { |
24 | - return Html::tag('neon-core-form-fields-guidance', [ |
|
25 | - 'text' => $this->getText(), |
|
26 | - ]); |
|
24 | + return Html::tag('neon-core-form-fields-guidance', [ |
|
25 | + 'text' => $this->getText(), |
|
26 | + ]); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -31,8 +31,9 @@ |
||
31 | 31 | public function getValue() |
32 | 32 | { |
33 | 33 | $value = parent::getValue(); |
34 | - if (is_array($value)) |
|
35 | - return $value; |
|
34 | + if (is_array($value)) { |
|
35 | + return $value; |
|
36 | + } |
|
36 | 37 | return ['from' => '', 'to' => '']; |
37 | 38 | } |
38 | 39 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | /** |
61 | 61 | * @inheritdoc |
62 | 62 | */ |
63 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
63 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
64 | 64 | { |
65 | 65 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
66 | 66 | if ($searchData !== '') { |
@@ -66,10 +66,12 @@ discard block |
||
66 | 66 | if ($searchData !== '') { |
67 | 67 | $dateFrom = Arr::get($searchData, 'from'); |
68 | 68 | $dateTo = Arr::get($searchData, 'to'); |
69 | - if ($dateFrom) |
|
70 | - $query->where($this->getDataKey(), '>=', $dateFrom); |
|
71 | - if ($dateTo) |
|
72 | - $query->where($this->getDataKey(), '<=', $dateTo); |
|
69 | + if ($dateFrom) { |
|
70 | + $query->where($this->getDataKey(), '>=', $dateFrom); |
|
71 | + } |
|
72 | + if ($dateTo) { |
|
73 | + $query->where($this->getDataKey(), '<=', $dateTo); |
|
74 | + } |
|
73 | 75 | } |
74 | 76 | } |
75 | 77 | |
@@ -87,8 +89,9 @@ discard block |
||
87 | 89 | public function getValue() |
88 | 90 | { |
89 | 91 | $value = parent::getValue(); |
90 | - if (is_array($value)) |
|
91 | - return $value; |
|
92 | + if (is_array($value)) { |
|
93 | + return $value; |
|
94 | + } |
|
92 | 95 | return ['from' => '', 'to' => '']; |
93 | 96 | } |
94 | 97 | } |
95 | 98 | \ No newline at end of file |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function getProperties() |
27 | 27 | { |
28 | - return array_merge(parent::getProperties(), ['decimal', 'height', 'vertical', 'min', 'max'] ); |
|
28 | + return array_merge(parent::getProperties(), ['decimal', 'height', 'vertical', 'min', 'max']); |
|
29 | 29 | } |
30 | 30 | /** |
31 | 31 | * @inheritdoc |