@@ -104,7 +104,7 @@ |
||
104 | 104 | $e->sender->formModels['dm'] = $dm; |
105 | 105 | }, |
106 | 106 | |
107 | - 'on beforeSave' => function (Event $e) { |
|
107 | + 'on beforeSave' => function(Event $e) { |
|
108 | 108 | /** |
109 | 109 | * @var $action BackendModelUpdateAction; |
110 | 110 | * @var $model CmsUser; |
@@ -315,12 +315,12 @@ |
||
315 | 315 | |
316 | 316 | protected function _run() |
317 | 317 | { |
318 | - $key = $this->getCacheKey().'run'; |
|
318 | + $key = $this->getCacheKey() . 'run'; |
|
319 | 319 | |
320 | 320 | $dependency = new TagDependency([ |
321 | 321 | 'tags' => |
322 | 322 | [ |
323 | - $this->className().(string)$this->namespace, |
|
323 | + $this->className() . (string)$this->namespace, |
|
324 | 324 | (new Tree())->getTableCacheTag(), |
325 | 325 | ], |
326 | 326 | ]); |
@@ -121,15 +121,15 @@ discard block |
||
121 | 121 | $this->initDataProvider(); |
122 | 122 | |
123 | 123 | if ($this->createdBy) { |
124 | - $this->dataProvider->query->andWhere([$className::tableName().'.created_by' => $this->createdBy]); |
|
124 | + $this->dataProvider->query->andWhere([$className::tableName() . '.created_by' => $this->createdBy]); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | if ($this->active) { |
128 | - $this->dataProvider->query->andWhere([$className::tableName().'.active' => $this->active]); |
|
128 | + $this->dataProvider->query->andWhere([$className::tableName() . '.active' => $this->active]); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | if ($this->content_ids) { |
132 | - $this->dataProvider->query->andWhere([$className::tableName().'.content_id' => $this->content_ids]); |
|
132 | + $this->dataProvider->query->andWhere([$className::tableName() . '.content_id' => $this->content_ids]); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($this->limit) { |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | $query->andWhere( |
179 | 179 | [ |
180 | 180 | 'or', |
181 | - [$className::tableName().'.tree_id' => $treeIds], |
|
182 | - [CmsContentElementTree::tableName().'.tree_id' => $treeIds], |
|
181 | + [$className::tableName() . '.tree_id' => $treeIds], |
|
182 | + [CmsContentElementTree::tableName() . '.tree_id' => $treeIds], |
|
183 | 183 | ] |
184 | 184 | ); |
185 | 185 | } else { |
186 | - $query->andWhere([$className::tableName().'.tree_id' => $treeIds]); |
|
186 | + $query->andWhere([$className::tableName() . '.tree_id' => $treeIds]); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | } |
@@ -193,14 +193,14 @@ discard block |
||
193 | 193 | |
194 | 194 | if ($this->enabledActiveTime == Cms::BOOL_Y) { |
195 | 195 | $this->dataProvider->query->andWhere( |
196 | - ["<=", $className::tableName().'.published_at', \Yii::$app->formatter->asTimestamp(time())] |
|
196 | + ["<=", $className::tableName() . '.published_at', \Yii::$app->formatter->asTimestamp(time())] |
|
197 | 197 | ); |
198 | 198 | |
199 | 199 | $this->dataProvider->query->andWhere( |
200 | 200 | [ |
201 | 201 | 'or', |
202 | - [">=", $className::tableName().'.published_to', \Yii::$app->formatter->asTimestamp(time())], |
|
203 | - [CmsContentElement::tableName().'.published_to' => null], |
|
202 | + [">=", $className::tableName() . '.published_to', \Yii::$app->formatter->asTimestamp(time())], |
|
203 | + [CmsContentElement::tableName() . '.published_to' => null], |
|
204 | 204 | ] |
205 | 205 | ); |
206 | 206 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $this->dataProvider->query->with($this->with); |
213 | 213 | } |
214 | 214 | |
215 | - $this->dataProvider->query->groupBy([$className::tableName().'.id']); |
|
215 | + $this->dataProvider->query->groupBy([$className::tableName() . '.id']); |
|
216 | 216 | |
217 | 217 | if ($this->activeQueryCallback && is_callable($this->activeQueryCallback)) { |
218 | 218 | $callback = $this->activeQueryCallback; |
@@ -516,12 +516,12 @@ discard block |
||
516 | 516 | } |
517 | 517 | protected function _run() |
518 | 518 | { |
519 | - $cacheKey = $this->getCacheKey().'run'; |
|
519 | + $cacheKey = $this->getCacheKey() . 'run'; |
|
520 | 520 | |
521 | 521 | $dependency = new TagDependency([ |
522 | 522 | 'tags' => |
523 | 523 | [ |
524 | - $this->className().(string)$this->namespace, |
|
524 | + $this->className() . (string)$this->namespace, |
|
525 | 525 | (new CmsContentElement())->getTableCacheTag(), |
526 | 526 | ], |
527 | 527 | ]); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | public function renderConfigForm(ActiveForm $form) |
143 | 143 | { |
144 | - echo \Yii::$app->view->renderFile(__DIR__.'/cms/_form.php', [ |
|
144 | + echo \Yii::$app->view->renderFile(__DIR__ . '/cms/_form.php', [ |
|
145 | 145 | 'form' => $form, |
146 | 146 | 'model' => $this, |
147 | 147 | ], $this); |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | $this->noImageUrl = CmsAsset::getAssetUrl('img/image-not-found.jpg'); |
239 | 239 | } |
240 | 240 | |
241 | - \Yii::$app->view->on(View::EVENT_BEGIN_PAGE, function (Event $e) { |
|
241 | + \Yii::$app->view->on(View::EVENT_BEGIN_PAGE, function(Event $e) { |
|
242 | 242 | if (!\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) { |
243 | 243 | \Yii::$app->response->getHeaders()->setDefault('X-Powered-CMS', |
244 | - $this->descriptor->name." {$this->descriptor->homepage}"); |
|
244 | + $this->descriptor->name . " {$this->descriptor->homepage}"); |
|
245 | 245 | |
246 | 246 | /** |
247 | 247 | * @var $view View |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | if (!isset($view->metaTags[self::$_huck])) { |
251 | 251 | $view->registerMetaTag([ |
252 | 252 | "name" => base64_decode(self::$_huck), |
253 | - "content" => $this->descriptor->name." — {$this->descriptor->homepage}", |
|
253 | + "content" => $this->descriptor->name . " — {$this->descriptor->homepage}", |
|
254 | 254 | ], self::$_huck); |
255 | 255 | } |
256 | 256 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | } |
264 | 264 | }); |
265 | 265 | |
266 | - \Yii::$app->user->on(\yii\web\User::EVENT_AFTER_LOGIN, function (UserEvent $e) { |
|
266 | + \Yii::$app->user->on(\yii\web\User::EVENT_AFTER_LOGIN, function(UserEvent $e) { |
|
267 | 267 | $e->identity->logged_at = \Yii::$app->formatter->asTimestamp(time()); |
268 | 268 | $e->identity->save(false); |
269 | 269 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | 'fields' => [ |
372 | 372 | 'access' => [ |
373 | 373 | 'class' => HtmlBlock::class, |
374 | - 'content' => function (HtmlBlock $htmlBlock) { |
|
374 | + 'content' => function(HtmlBlock $htmlBlock) { |
|
375 | 375 | $content = \yii\bootstrap\Alert::widget([ |
376 | 376 | 'options' => [ |
377 | 377 | 'class' => 'alert-warning', |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $this->_autoColumns[(string)$name] = [ |
142 | 142 | 'attribute' => $name, |
143 | 143 | 'format' => 'raw', |
144 | - 'value' => function ($model, $key, $index) use ($name) { |
|
144 | + 'value' => function($model, $key, $index) use ($name) { |
|
145 | 145 | if (is_array($model->{$name})) { |
146 | 146 | return implode(",", $model->{$name}); |
147 | 147 | } else { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | 'visibleColumns' => [ |
279 | 279 | 'class' => SelectField::class, |
280 | 280 | 'multiple' => true, |
281 | - 'on beforeRender' => function ($e) { |
|
281 | + 'on beforeRender' => function($e) { |
|
282 | 282 | /** |
283 | 283 | * @var $selectField SelectField |
284 | 284 | */ |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | } |
356 | 356 | |
357 | 357 | if ($result && in_array($label, array_values($result))) { |
358 | - $result[$code] = $label." ({$code})"; |
|
358 | + $result[$code] = $label . " ({$code})"; |
|
359 | 359 | } else { |
360 | 360 | $result[$code] = $label; |
361 | 361 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | { |
191 | 191 | $this->_callAttributes = $this->attributes; |
192 | 192 | |
193 | - \Yii::beginProfile("Init: ".static::class); |
|
193 | + \Yii::beginProfile("Init: " . static::class); |
|
194 | 194 | |
195 | 195 | if (!\Yii::$app instanceof Application) { |
196 | 196 | if ($this->cmsSite === null && isset(\Yii::$app->currentSite) && \Yii::$app->currentSite->site) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $this->_initSettings(); |
206 | 206 | $this->trigger(self::EVENT_INIT); |
207 | 207 | |
208 | - \Yii::endProfile("Init: ".static::class); |
|
208 | + \Yii::endProfile("Init: " . static::class); |
|
209 | 209 | |
210 | 210 | |
211 | 211 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | } catch (\Exception $e) { |
224 | 224 | \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings', |
225 | - ['cms' => 'Cms']).': '.$e->getMessage()); |
|
225 | + ['cms' => 'Cms']) . ': ' . $e->getMessage()); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | return $this; |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | */ |
734 | 734 | public function getCallableId() |
735 | 735 | { |
736 | - return $this->settingsId.'-callable'; |
|
736 | + return $this->settingsId . '-callable'; |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | /** |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | public function getSettingsId($autoGenerate = true) |
745 | 745 | { |
746 | 746 | if ($autoGenerate && $this->_settingsId === null) { |
747 | - $this->_settingsId = static::$autoSettingsIdPrefix.static::$counterSettings++; |
|
747 | + $this->_settingsId = static::$autoSettingsIdPrefix . static::$counterSettings++; |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | return $this->_settingsId; |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | if (isset($this->{$name})) { |
829 | 829 | $this->{$name} = $value; |
830 | 830 | } else { |
831 | - throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".'); |
|
831 | + throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
832 | 832 | } |
833 | 833 | } |
834 | 834 | |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) { |
879 | 879 | $this->_oldAttributes[$name] = $value; |
880 | 880 | } else { |
881 | - throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".'); |
|
881 | + throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
882 | 882 | } |
883 | 883 | } |
884 | 884 |