@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @var array |
48 | 48 | */ |
49 | - public $albums = []; |
|
49 | + public $albums = [ ]; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Initialize. |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | 'exist', |
109 | 109 | 'skipOnError' => true, |
110 | 110 | 'targetClass' => Page::class, |
111 | - 'targetAttribute' => ['pageId' => 'id'] |
|
111 | + 'targetAttribute' => [ 'pageId' => 'id' ] |
|
112 | 112 | ], |
113 | 113 | [ |
114 | 114 | UploadModelInterface::FILE_TYPE_THUMB, |
115 | - function($attribute){ |
|
116 | - if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})){ |
|
115 | + function($attribute) { |
|
116 | + if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})) { |
|
117 | 117 | $this->addError($attribute, 'Tumbnail content must be a numeric or string.'); |
118 | 118 | } |
119 | 119 | }, |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | [ |
132 | 132 | 'albums', |
133 | 133 | 'each', |
134 | - 'rule' => ['integer'], |
|
134 | + 'rule' => [ 'integer' ], |
|
135 | 135 | ], |
136 | 136 | ]; |
137 | 137 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @var array |
43 | 43 | */ |
44 | - public $albums = []; |
|
44 | + public $albums = [ ]; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @var int |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | ], |
102 | 102 | [ |
103 | 103 | UploadModelInterface::FILE_TYPE_THUMB, |
104 | - function($attribute){ |
|
105 | - if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})){ |
|
104 | + function($attribute) { |
|
105 | + if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})) { |
|
106 | 106 | $this->addError($attribute, 'Tumbnail content must be a numeric or string.'); |
107 | 107 | } |
108 | 108 | }, |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | [ |
112 | 112 | 'albums', |
113 | 113 | 'each', |
114 | - 'rule' => ['integer'], |
|
114 | + 'rule' => [ 'integer' ], |
|
115 | 115 | ], |
116 | 116 | ]; |
117 | 117 | } |
@@ -96,8 +96,8 @@ |
||
96 | 96 | { |
97 | 97 | $scenarios = parent::scenarios(); |
98 | 98 | |
99 | - $scenarios[ModelInterface::SCENARIO_CREATE][] = 'about'; |
|
100 | - $scenarios[ModelInterface::SCENARIO_UPDATE][] = 'about'; |
|
99 | + $scenarios[ ModelInterface::SCENARIO_CREATE ][ ] = 'about'; |
|
100 | + $scenarios[ ModelInterface::SCENARIO_UPDATE ][ ] = 'about'; |
|
101 | 101 | |
102 | 102 | return $scenarios; |
103 | 103 | } |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | { |
108 | 108 | $scenarios = parent::scenarios(); |
109 | 109 | |
110 | - $scenarios[self::SCENARIO_CREATE][] = 'about'; |
|
111 | - $scenarios[self::SCENARIO_UPDATE][] = 'about'; |
|
110 | + $scenarios[ self::SCENARIO_CREATE ][ ] = 'about'; |
|
111 | + $scenarios[ self::SCENARIO_UPDATE ][ ] = 'about'; |
|
112 | 112 | |
113 | 113 | return $scenarios; |
114 | 114 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function afterSave($insert, $changedAttributes) |
155 | 155 | { |
156 | - $this->linkWithAbout(empty($this->about) ? [] : $this->about); |
|
156 | + $this->linkWithAbout(empty($this->about) ? [ ] : $this->about); |
|
157 | 157 | |
158 | 158 | parent::afterSave($insert, $changedAttributes); |
159 | 159 | } |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | { |
105 | 105 | $scenarios = parent::scenarios(); |
106 | 106 | |
107 | - $scenarios[self::SCENARIO_CREATE][] = 'contacts'; |
|
108 | - $scenarios[self::SCENARIO_UPDATE][] = 'contacts'; |
|
107 | + $scenarios[ self::SCENARIO_CREATE ][ ] = 'contacts'; |
|
108 | + $scenarios[ self::SCENARIO_UPDATE ][ ] = 'contacts'; |
|
109 | 109 | |
110 | 110 | return $scenarios; |
111 | 111 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function afterSave($insert, $changedAttributes) |
153 | 153 | { |
154 | - $this->linkWithContacts(empty($this->contacts) ? [] : $this->contacts); |
|
154 | + $this->linkWithContacts(empty($this->contacts) ? [ ] : $this->contacts); |
|
155 | 155 | |
156 | 156 | parent::afterSave($insert, $changedAttributes); |
157 | 157 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return mixed |
28 | 28 | */ |
29 | - public function getDefaultThumbImage(array $options = []) |
|
29 | + public function getDefaultThumbImage(array $options = [ ]) |
|
30 | 30 | { |
31 | 31 | $url = $this->getDefaultThumbUrl(); |
32 | 32 | |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | return null; |
35 | 35 | } |
36 | 36 | |
37 | - if (empty($options['alt'])) { |
|
38 | - $options['alt'] = $this->thumbnailModel->alt; |
|
37 | + if (empty($options[ 'alt' ])) { |
|
38 | + $options[ 'alt' ] = $this->thumbnailModel->alt; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | return Html::img($url, $options); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function getDefaultThumbUrl() |
50 | 50 | { |
51 | - if (null == $this->getThumbnailModel()){ |
|
51 | + if (null == $this->getThumbnailModel()) { |
|
52 | 52 | return null; |
53 | 53 | } |
54 | 54 |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$params = require __DIR__ . '/params.php'; |
|
4 | -$db = require __DIR__ . '/db.php'; |
|
5 | -$translations = require __DIR__ . '/translations.php'; |
|
3 | +$params = require __DIR__.'/params.php'; |
|
4 | +$db = require __DIR__.'/db.php'; |
|
5 | +$translations = require __DIR__.'/translations.php'; |
|
6 | 6 | |
7 | 7 | $config = [ |
8 | 8 | 'id' => 'yii2_template_multilanguage', |
9 | 9 | 'version' => '1.0.0', |
10 | 10 | 'basePath' => dirname(__DIR__), |
11 | 11 | 'homeUrl' => YII_DEBUG ? 'http://yii2-template-multilanguage' : 'http://yii2-template-multilanguage', |
12 | - 'bootstrap' => ['log'], |
|
12 | + 'bootstrap' => [ 'log' ], |
|
13 | 13 | 'language' => 'en-US', |
14 | 14 | 'aliases' => [ |
15 | 15 | '@bower' => '@vendor/bower-asset', |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'targets' => [ |
52 | 52 | [ |
53 | 53 | 'class' => 'yii\log\FileTarget', |
54 | - 'levels' => ['error', 'warning'], |
|
54 | + 'levels' => [ 'error', 'warning' ], |
|
55 | 55 | ], |
56 | 56 | ], |
57 | 57 | ], |
@@ -101,18 +101,18 @@ discard block |
||
101 | 101 | |
102 | 102 | if (YII_ENV_DEV) { |
103 | 103 | // configuration adjustments for 'dev' environment |
104 | - $config['bootstrap'][] = 'debug'; |
|
105 | - $config['modules']['debug'] = [ |
|
104 | + $config[ 'bootstrap' ][ ] = 'debug'; |
|
105 | + $config[ 'modules' ][ 'debug' ] = [ |
|
106 | 106 | 'class' => 'yii\debug\Module', |
107 | 107 | // uncomment the following to add your IP if you are not connecting from localhost. |
108 | - 'allowedIPs' => ['127.0.0.1', '::1', '*'], |
|
108 | + 'allowedIPs' => [ '127.0.0.1', '::1', '*' ], |
|
109 | 109 | ]; |
110 | 110 | |
111 | - $config['bootstrap'][] = 'gii'; |
|
112 | - $config['modules']['gii'] = [ |
|
111 | + $config[ 'bootstrap' ][ ] = 'gii'; |
|
112 | + $config[ 'modules' ][ 'gii' ] = [ |
|
113 | 113 | 'class' => 'yii\gii\Module', |
114 | 114 | // uncomment the following to add your IP if you are not connecting from localhost. |
115 | - 'allowedIPs' => ['127.0.0.1', '::1', '*'], |
|
115 | + 'allowedIPs' => [ '127.0.0.1', '::1', '*' ], |
|
116 | 116 | ]; |
117 | 117 | } |
118 | 118 |