@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ->first(); |
69 | 69 | |
70 | 70 | if ($row !== null) { |
71 | - return $this->createItem((array)$row); |
|
71 | + return $this->createItem((array) $row); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return null; |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | { |
140 | 140 | $rows = $this->conn->table($this->table) |
141 | 141 | ->where('siteKey', $item->siteKey) |
142 | - ->whereRaw("'" . $item->name . "' like concat(`name`, '.', '%')") |
|
142 | + ->whereRaw("'".$item->name."' like concat(`name`, '.', '%')") |
|
143 | 143 | ->where('name', '<>', $item->name)->get(); |
144 | 144 | |
145 | 145 | $items = []; |
146 | 146 | foreach ($rows as $row) { |
147 | - $items[] = $this->createItem((array)$row); |
|
147 | + $items[] = $this->createItem((array) $row); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | return $items; |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | { |
161 | 161 | $rows = $this->conn->table($this->table) |
162 | 162 | ->where('siteKey', $item->siteKey) |
163 | - ->where('name', 'like', $item->name . '.%') |
|
163 | + ->where('name', 'like', $item->name.'.%') |
|
164 | 164 | ->where('name', '<>', $item->name)->get(); |
165 | 165 | |
166 | 166 | $items = []; |
167 | 167 | foreach ($rows as $row) { |
168 | - $items[] = $this->createItem((array)$row); |
|
168 | + $items[] = $this->createItem((array) $row); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $items; |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | { |
184 | 184 | $query = $this->conn->table($this->table) |
185 | 185 | ->where('siteKey', $item->siteKey) |
186 | - ->where(function ($query) use ($item) { |
|
186 | + ->where(function($query) use ($item) { |
|
187 | 187 | $query->where('name', $item->name) |
188 | - ->orWhere('name', 'like', $item->name . '.%'); |
|
188 | + ->orWhere('name', 'like', $item->name.'.%'); |
|
189 | 189 | }); |
190 | 190 | |
191 | 191 | $arr = explode('.', $item->name); |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | if ($to !== null) { |
213 | 213 | $this->conn->table($this->table) |
214 | 214 | ->where('siteKey', $item->siteKey) |
215 | - ->where(function ($query) use ($item) { |
|
215 | + ->where(function($query) use ($item) { |
|
216 | 216 | $query->where('name', $item->name) |
217 | - ->orWhere('name', 'like', $item->name . '.%'); |
|
217 | + ->orWhere('name', 'like', $item->name.'.%'); |
|
218 | 218 | }) |
219 | 219 | ->update(['name' => $this->conn->raw("concat('{$to}', '.', `name`)")]); |
220 | 220 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | protected function makeKeyForLoaded($siteKey, $name) |
173 | 173 | { |
174 | - return $siteKey .'-'. $name; |
|
174 | + return $siteKey.'-'.$name; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | protected function setAncestor(Permission $permission) |
200 | 200 | { |
201 | 201 | $ancestors = $this->repo->fetchAncestor($permission); |
202 | - usort($ancestors, function (Permission $a, Permission $b) { |
|
202 | + usort($ancestors, function(Permission $a, Permission $b) { |
|
203 | 203 | if ($a->getDepth() == $b->getDepth()) { |
204 | 204 | return 0; |
205 | 205 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $permission = $this->loaded[$this->makeKeyForLoaded($siteKey, $name)]; |
307 | 307 | $descendants = $this->repo->fetchDescendant($permission); |
308 | 308 | |
309 | - usort($descendants, function (Permission $a, Permission $b) { |
|
309 | + usort($descendants, function(Permission $a, Permission $b) { |
|
310 | 310 | if ($a->getDepth() == $b->getDepth()) { |
311 | 311 | return 0; |
312 | 312 | } |
@@ -133,7 +133,7 @@ |
||
133 | 133 | |
134 | 134 | protected function isAllowType($type) |
135 | 135 | { |
136 | - $constName = __CLASS__ . '::' . strtoupper($type) . '_TYPE'; |
|
136 | + $constName = __CLASS__.'::'.strtoupper($type).'_TYPE'; |
|
137 | 137 | |
138 | 138 | return defined($constName); |
139 | 139 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return $id; |
182 | 182 | } |
183 | 183 | |
184 | - $userKeyHead = $this->userKeyPrefix . '::'; |
|
184 | + $userKeyHead = $this->userKeyPrefix.'::'; |
|
185 | 185 | if (substr($id, 0, strlen($userKeyHead)) == $userKeyHead) { |
186 | 186 | return ''; |
187 | 187 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $sentence = $this->choice($id, $number, $parameters, $locale); |
209 | 209 | |
210 | 210 | if ($sentence == $id) { |
211 | - return $number . ' ' . $this->makeUnknownSentence($id); |
|
211 | + return $number.' '.$this->makeUnknownSentence($id); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | return $sentence; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | protected function sortReplacements(array $replace) |
308 | 308 | { |
309 | - return (new Collection($replace))->sortBy(function ($value, $key) { |
|
309 | + return (new Collection($replace))->sortBy(function($value, $key) { |
|
310 | 310 | return mb_strlen($key) * -1; |
311 | 311 | }); |
312 | 312 | } |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function getSelector() |
363 | 363 | { |
364 | - if (! isset($this->selector)) { |
|
364 | + if (!isset($this->selector)) { |
|
365 | 365 | $this->selector = new MessageSelector; |
366 | 366 | } |
367 | 367 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | public function genUserKey() |
377 | 377 | { |
378 | - return $this->userKeyPrefix . '::' . $this->keyGen->generate(); |
|
378 | + return $this->userKeyPrefix.'::'.$this->keyGen->generate(); |
|
379 | 379 | } |
380 | 380 | |
381 | 381 | /** |
@@ -550,7 +550,7 @@ |
||
550 | 550 | $componentsFetched = []; |
551 | 551 | array_walk( |
552 | 552 | $componentList, |
553 | - function ($info, $key) use (&$componentsFetched, $type) { |
|
553 | + function($info, $key) use (&$componentsFetched, $type) { |
|
554 | 554 | $componentType = $this->getComponentType($key); |
555 | 555 | if ($componentType === $type) { |
556 | 556 | $componentsFetched[$key] = $info; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public function has($group, $id) |
265 | 265 | { |
266 | - return $this->configHandler->get($group, $id) === null? false : true; |
|
266 | + return $this->configHandler->get($group, $id) === null ? false : true; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | $rules = []; |
321 | 321 | foreach ($type->getRules() as $columnName => $rule) { |
322 | - $key = camel_case($config->get('id') . '_' . $columnName); |
|
322 | + $key = camel_case($config->get('id').'_'.$columnName); |
|
323 | 323 | $rules[$key] = $rule; |
324 | 324 | } |
325 | 325 |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | public function add(Blueprint $table, $prefix = '') |
128 | 128 | { |
129 | 129 | // make all names to camel case |
130 | - $this->{'name'} = camel_case($prefix . $this->{'name'}); |
|
130 | + $this->{'name'} = camel_case($prefix.$this->{'name'}); |
|
131 | 131 | |
132 | 132 | if (method_exists($table, $this->{'dataType'}) === false) { |
133 | 133 | throw new Exceptions\InvalidColumnEntityException; |
@@ -158,6 +158,6 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function drop(Blueprint $table, $prefix = '') |
160 | 160 | { |
161 | - $table->dropColumn(camel_case($prefix . $this->{'name'})); |
|
161 | + $table->dropColumn(camel_case($prefix.$this->{'name'})); |
|
162 | 162 | } |
163 | 163 | } |
@@ -121,7 +121,7 @@ |
||
121 | 121 | |
122 | 122 | $this->group = $this->options['table']; |
123 | 123 | if (isset($this->options['id'])) { |
124 | - $this->group = $this->options['table'] . '_' . $this->options['id']; |
|
124 | + $this->group = $this->options['table'].'_'.$this->options['id']; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | if (isset($this->options['group'])) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | { |
129 | 129 | foreach ($this->register->get(self::FIELD_TYPE) as $id => $type) { |
130 | 130 | /** @var \Xpressengine\DynamicField\AbstractSkin $skin */ |
131 | - foreach ($this->register->get($id . PluginRegister::KEY_DELIMITER . self::FIELD_SKIN) as $skin) { |
|
131 | + foreach ($this->register->get($id.PluginRegister::KEY_DELIMITER.self::FIELD_SKIN) as $skin) { |
|
132 | 132 | yield $this->getType($handler, $skin::getId()); |
133 | 133 | } |
134 | 134 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public function getSkinsByType(Handler $handler, $id) |
146 | 146 | { |
147 | 147 | /** @var \Xpressengine\DynamicField\AbstractSkin $skin */ |
148 | - foreach ($this->register->get($id . PluginRegister::KEY_DELIMITER . self::FIELD_SKIN) as $skin) { |
|
148 | + foreach ($this->register->get($id.PluginRegister::KEY_DELIMITER.self::FIELD_SKIN) as $skin) { |
|
149 | 149 | yield $this->getSkin($handler, $skin::getId()); |
150 | 150 | } |
151 | 151 | } |