@@ -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', |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | { |
| 196 | 196 | $this->_callAttributes = $this->attributes; |
| 197 | 197 | |
| 198 | - \Yii::beginProfile("Init: ".static::class); |
|
| 198 | + \Yii::beginProfile("Init: " . static::class); |
|
| 199 | 199 | |
| 200 | 200 | if (!\Yii::$app instanceof Application) { |
| 201 | 201 | if ($this->cmsSite === null && isset(\Yii::$app->currentSite) && \Yii::$app->currentSite->site) { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | $this->_initSettings(); |
| 211 | 211 | |
| 212 | - \Yii::endProfile("Init: ".static::class); |
|
| 212 | + \Yii::endProfile("Init: " . static::class); |
|
| 213 | 213 | |
| 214 | 214 | $this->trigger(self::EVENT_INIT); |
| 215 | 215 | $this->trigger(self::EVENT_READY); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | } catch (\Exception $e) { |
| 229 | 229 | \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings', |
| 230 | - ['cms' => 'Cms']).': '.$e->getMessage()); |
|
| 230 | + ['cms' => 'Cms']) . ': ' . $e->getMessage()); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | return $this; |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | */ |
| 740 | 740 | public function getCallableId() |
| 741 | 741 | { |
| 742 | - return $this->settingsId.'-callable'; |
|
| 742 | + return $this->settingsId . '-callable'; |
|
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | /** |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | public function getSettingsId($autoGenerate = true) |
| 751 | 751 | { |
| 752 | 752 | if ($autoGenerate && $this->_settingsId === null) { |
| 753 | - $this->_settingsId = static::$autoSettingsIdPrefix.static::$counterSettings++; |
|
| 753 | + $this->_settingsId = static::$autoSettingsIdPrefix . static::$counterSettings++; |
|
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | return $this->_settingsId; |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | if (isset($this->{$name})) { |
| 835 | 835 | $this->{$name} = $value; |
| 836 | 836 | } else { |
| 837 | - throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".'); |
|
| 837 | + throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
| 838 | 838 | } |
| 839 | 839 | } |
| 840 | 840 | |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) { |
| 885 | 885 | $this->_oldAttributes[$name] = $value; |
| 886 | 886 | } else { |
| 887 | - throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".'); |
|
| 887 | + throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
| 888 | 888 | } |
| 889 | 889 | } |
| 890 | 890 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | BlameableBehavior::className() => |
| 44 | 44 | [ |
| 45 | 45 | 'class' => BlameableBehavior::className(), |
| 46 | - 'value' => function ($event) { |
|
| 46 | + 'value' => function($event) { |
|
| 47 | 47 | if (\Yii::$app instanceof \yii\console\Application) { |
| 48 | 48 | return null; |
| 49 | 49 | } else { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | public function asText() |
| 138 | 138 | { |
| 139 | - return (string) $this; |
|
| 139 | + return (string)$this; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | public function asHtml() |
@@ -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 | } |