@@ -76,12 +76,12 @@ |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $dataProvider = new ActiveDataProvider([ |
| 79 | - 'query' => Content::find()->joinWith(['type', 'flow'])->where([Flow::tableName() . '.id' => $id]), |
|
| 79 | + 'query' => Content::find()->joinWith(['type', 'flow'])->where([Flow::tableName().'.id' => $id]), |
|
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | 82 | $dataProvider->sort->attributes['type.name'] = [ |
| 83 | - 'asc' => [ContentType::tableName() . '.id' => SORT_ASC], |
|
| 84 | - 'desc' => [ContentType::tableName() . '.id' => SORT_DESC], |
|
| 83 | + 'asc' => [ContentType::tableName().'.id' => SORT_ASC], |
|
| 84 | + 'desc' => [ContentType::tableName().'.id' => SORT_DESC], |
|
| 85 | 85 | ]; |
| 86 | 86 | |
| 87 | 87 | return $this->render('view', [ |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | ]); |
| 52 | 52 | |
| 53 | 53 | $dataProvider->sort->attributes['template'] = [ |
| 54 | - 'asc' => [ScreenTemplate::tableName() . '.name' => SORT_ASC], |
|
| 55 | - 'desc' => [ScreenTemplate::tableName() . '.name' => SORT_DESC], |
|
| 54 | + 'asc' => [ScreenTemplate::tableName().'.name' => SORT_ASC], |
|
| 55 | + 'desc' => [ScreenTemplate::tableName().'.name' => SORT_DESC], |
|
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | return $this->render('index', [ |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function actionView($id) |
| 71 | 71 | { |
| 72 | - $model = Screen::find()->where([Screen::tableName() . '.id' => $id])->joinWith('template')->one(); |
|
| 72 | + $model = Screen::find()->where([Screen::tableName().'.id' => $id])->joinWith('template')->one(); |
|
| 73 | 73 | if ($model === null) { |
| 74 | 74 | throw new NotFoundHttpException(Yii::t('app', 'The requested screen does not exist.')); |
| 75 | 75 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $this->redirect(['view', 'id' => $model->id]); |
| 104 | 104 | } else { |
| 105 | 105 | $templates = ScreenTemplate::find()->all(); |
| 106 | - $templatesArray = array_reduce($templates, function ($a, $t) { |
|
| 106 | + $templatesArray = array_reduce($templates, function($a, $t) { |
|
| 107 | 107 | $a[$t->id] = $t->name; |
| 108 | 108 | |
| 109 | 109 | return $a; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return $this->redirect(['view', 'id' => $model->id]); |
| 133 | 133 | } else { |
| 134 | 134 | $templates = ScreenTemplate::find()->all(); |
| 135 | - $templatesArray = array_reduce($templates, function ($a, $t) { |
|
| 135 | + $templatesArray = array_reduce($templates, function($a, $t) { |
|
| 136 | 136 | $a[$t->id] = $t->name; |
| 137 | 137 | |
| 138 | 138 | return $a; |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | ]); |
| 58 | 58 | |
| 59 | 59 | $dataProvider->sort->attributes['type.name'] = [ |
| 60 | - 'asc' => [ContentType::tableName() . '.id' => SORT_ASC], |
|
| 61 | - 'desc' => [ContentType::tableName() . '.id' => SORT_DESC], |
|
| 60 | + 'asc' => [ContentType::tableName().'.id' => SORT_ASC], |
|
| 61 | + 'desc' => [ContentType::tableName().'.id' => SORT_DESC], |
|
| 62 | 62 | ]; |
| 63 | 63 | |
| 64 | 64 | $dataProvider->sort->attributes['flow.name'] = [ |
| 65 | - 'asc' => [Flow::tableName() . '.id' => SORT_ASC], |
|
| 66 | - 'desc' => [Flow::tableName() . '.id' => SORT_DESC], |
|
| 65 | + 'asc' => [Flow::tableName().'.id' => SORT_ASC], |
|
| 66 | + 'desc' => [Flow::tableName().'.id' => SORT_DESC], |
|
| 67 | 67 | ]; |
| 68 | 68 | |
| 69 | 69 | return $this->render('index', [ |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | // Latitude & longitude |
| 135 | 135 | case ContentType::KINDS['TEXT']: |
| 136 | 136 | // Same as URL, text doesn't require processing |
| 137 | - return $this->render('type/' . $contentType->input, [ |
|
| 137 | + return $this->render('type/'.$contentType->input, [ |
|
| 138 | 138 | 'type' => $contentType, |
| 139 | 139 | 'model' => $model, |
| 140 | 140 | 'uploadUrl' => Url::to(['content/upload', 'type' => $type]), |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $data = $this->data; |
| 145 | 145 | if ($this->type->appendParams) { |
| 146 | - $data .= (strpos($data, '#') === false ? '#' : ';') . $this->type->appendParams; |
|
| 146 | + $data .= (strpos($data, '#') === false ? '#' : ';').$this->type->appendParams; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $data = $this->processData($data); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | if ($this->type->input == ContentType::KINDS['FILE']) { |
| 201 | 201 | return self::find() |
| 202 | 202 | ->joinWith(['type']) |
| 203 | - ->where([ContentType::tableName() . '.id' => ContentType::getAllFileTypeIds()]) |
|
| 203 | + ->where([ContentType::tableName().'.id' => ContentType::getAllFileTypeIds()]) |
|
| 204 | 204 | ->andWhere(['data' => $this->data]) |
| 205 | 205 | ->count() == 0; |
| 206 | 206 | } |
@@ -237,6 +237,6 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function getRealFilepath() |
| 239 | 239 | { |
| 240 | - return \Yii::getAlias('@app/') . 'web/' . $this->getFilepath(); |
|
| 240 | + return \Yii::getAlias('@app/').'web/'.$this->getFilepath(); |
|
| 241 | 241 | } |
| 242 | 242 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public static function fromType($typeId) |
| 98 | 98 | { |
| 99 | - $className = self::SUB_PATH . $typeId; |
|
| 99 | + $className = self::SUB_PATH.$typeId; |
|
| 100 | 100 | if (!class_exists($className)) { |
| 101 | 101 | throw new ServerErrorHttpException(Yii::t('app', 'The requested content type has no class.')); |
| 102 | 102 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | { |
| 143 | 143 | $types = self::find()->all(); |
| 144 | 144 | |
| 145 | - return array_filter($types, function ($t) use ($selfUpdate, $usableOnly) { |
|
| 145 | + return array_filter($types, function($t) use ($selfUpdate, $usableOnly) { |
|
| 146 | 146 | return ($selfUpdate === null || $t->selfUpdate == $selfUpdate) && (!$usableOnly || ($t->usable && $t->enabled)); |
| 147 | 147 | }); |
| 148 | 148 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | $types = self::find()->all(); |
| 179 | 179 | |
| 180 | - return array_filter(array_map(function ($t) { |
|
| 180 | + return array_filter(array_map(function($t) { |
|
| 181 | 181 | return $t->input == self::KINDS['FILE'] ? $t->id : null; |
| 182 | 182 | }, $types)); |
| 183 | 183 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function hasCache($key) |
| 220 | 220 | { |
| 221 | - return \Yii::$app->cache->exists($this->id . $key); |
|
| 221 | + return \Yii::$app->cache->exists($this->id.$key); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | public function fromCache($key) |
| 232 | 232 | { |
| 233 | 233 | $cache = \Yii::$app->cache; |
| 234 | - $cacheKey = $this->id . $key; |
|
| 234 | + $cacheKey = $this->id.$key; |
|
| 235 | 235 | |
| 236 | 236 | return $cache->get($cacheKey); |
| 237 | 237 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | public function toCache($key, $content) |
| 246 | 246 | { |
| 247 | 247 | $cache = \Yii::$app->cache; |
| 248 | - $cacheKey = $this->id . $key; |
|
| 248 | + $cacheKey = $this->id.$key; |
|
| 249 | 249 | $cache->set($cacheKey, $content, static::BASE_CACHE_TIME); |
| 250 | 250 | } |
| 251 | 251 | |