@@ -26,11 +26,11 @@ 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 | $thumbnailModel = $this->getThumbnailModel(); |
32 | 32 | |
33 | - if (null === $thumbnailModel){ |
|
33 | + if (null === $thumbnailModel) { |
|
34 | 34 | return null; |
35 | 35 | } |
36 | 36 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | return null; |
41 | 41 | } |
42 | 42 | |
43 | - if (empty($options['alt'])) { |
|
44 | - $options['alt'] = $thumbnailModel->alt; |
|
43 | + if (empty($options[ 'alt' ])) { |
|
44 | + $options[ 'alt' ] = $thumbnailModel->alt; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | return Html::img($url, $options); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 'exist', |
138 | 138 | 'skipOnError' => true, |
139 | 139 | 'targetClass' => Position::class, |
140 | - 'targetAttribute' => ['position_id' => 'id'] |
|
140 | + 'targetAttribute' => [ 'position_id' => 'id' ] |
|
141 | 141 | ], |
142 | 142 | ]; |
143 | 143 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function getFullName(): string |
309 | 309 | { |
310 | - return $this->first_name . ' ' . $this->last_name; |
|
310 | + return $this->first_name.' '.$this->last_name; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | */ |
433 | 433 | public function moveOrder(int $order): void |
434 | 434 | { |
435 | - if ($order == $this->order){ |
|
435 | + if ($order == $this->order) { |
|
436 | 436 | return; |
437 | 437 | } |
438 | 438 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | ]) |
444 | 444 | ->one(); |
445 | 445 | $future->detachBehavior('mediafile'); |
446 | - $future->order = $order > $this->order ? $order-1 : $order+1; |
|
446 | + $future->order = $order > $this->order ? $order - 1 : $order + 1; |
|
447 | 447 | $future->save(); |
448 | 448 | |
449 | 449 | $this->detachBehavior('mediafile'); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | */ |
459 | 459 | public function beforeSave($insert) |
460 | 460 | { |
461 | - if ($this->isNewRecord){ |
|
461 | + if ($this->isNewRecord) { |
|
462 | 462 | $this->order = $this->maxOrder == null ? 1 : $this->maxOrder + 1; |
463 | 463 | } |
464 | 464 |
@@ -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 | } |