@@ -104,7 +104,7 @@ |
||
104 | 104 | public static function ensureHttp($url, $https = false) |
105 | 105 | { |
106 | 106 | if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
107 | - $url = ($https ? "https://" : "http://") . $url; |
|
107 | + $url = ($https ? "https://" : "http://").$url; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return $url; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public static function toManager($route, array $params = [], $scheme = false) |
68 | 68 | { |
69 | - trigger_error('Deprecated method us Url::toRoute() instead.', E_USER_DEPRECATED); |
|
69 | + trigger_error('Deprecated method us Url::toRoute() instead.', E_USER_DEPRECATED); |
|
70 | 70 | |
71 | 71 | $routeParams = [$route]; |
72 | 72 | foreach ($params as $key => $value) { |
@@ -63,7 +63,7 @@ |
||
63 | 63 | public function getWebroot() |
64 | 64 | { |
65 | 65 | if ($this->_webroot === null) { |
66 | - $this->_webroot = realpath(realpath($this->basePath) . DIRECTORY_SEPARATOR . $this->webrootDirectory); |
|
66 | + $this->_webroot = realpath(realpath($this->basePath).DIRECTORY_SEPARATOR.$this->webrootDirectory); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $this->_webroot; |
@@ -114,9 +114,9 @@ |
||
114 | 114 | $_file = $exception->getFile(); |
115 | 115 | $_line = $exception->getLine(); |
116 | 116 | } elseif (is_string($exception)) { |
117 | - $_message = 'exception string: ' . $exception; |
|
117 | + $_message = 'exception string: '.$exception; |
|
118 | 118 | } elseif (is_array($exception)) { |
119 | - $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: ' . print_r($exception, true); |
|
119 | + $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: '.print_r($exception, true); |
|
120 | 120 | $_file = isset($exception['file']) ? $exception['file'] : __FILE__; |
121 | 121 | $_line = isset($exception['line']) ? $exception['line'] : __LINE__; |
122 | 122 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | if (!is_object($this->tags[$tag])) { |
64 | 64 | $this->tags[$tag] = Yii::createObject($this->tags[$tag]); |
65 | - Yii::trace('tag parser object generated for:'. $tag, __CLASS__); |
|
65 | + Yii::trace('tag parser object generated for:'.$tag, __CLASS__); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $value = isset($context['value']) ? $context['value'] : false; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function parse($value, $sub) |
17 | 17 | { |
18 | - return Html::a(empty($sub) ? $value : $sub, 'tel:' . $this->ensureNumber($value)); |
|
18 | + return Html::a(empty($sub) ? $value : $sub, 'tel:'.$this->ensureNumber($value)); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | private function ensureNumber($number) |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function parse($value, $sub) |
28 | 28 | { |
29 | 29 | if (substr($value, 0, 2) == '//') { |
30 | - $value = StringHelper::replaceFirst('//', Url::base(true) . '/', $value); |
|
30 | + $value = StringHelper::replaceFirst('//', Url::base(true).'/', $value); |
|
31 | 31 | $external = false; |
32 | 32 | } else { |
33 | 33 | $external = true; |
@@ -70,14 +70,14 @@ |
||
70 | 70 | */ |
71 | 71 | public function run() |
72 | 72 | { |
73 | - $class = 'lazy-image ' . $this->extraClass; |
|
73 | + $class = 'lazy-image '.$this->extraClass; |
|
74 | 74 | |
75 | 75 | if ($this->attributesOnly) { |
76 | 76 | return "class=\"{$class}\" data-src=\"$this->src\" data-width=\"$this->width\" data-height=\"$this->height\" data-as-background=\"1\""; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $tag = Html::tag('img', '', ['class' => $class, 'data-src' => $this->src, 'data-width' => $this->width, 'data-height' => $this->height]); |
80 | - $tag.= '<noscript><img class="'.$class.'" src="'.$this->src.'" /></noscript>'; |
|
80 | + $tag .= '<noscript><img class="'.$class.'" src="'.$this->src.'" /></noscript>'; |
|
81 | 81 | return $tag; |
82 | 82 | } |
83 | 83 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | } |
75 | 75 | $rules = []; |
76 | 76 | foreach ($types as $type => $columns) { |
77 | - $rules[] = "[['" . implode("', '", $columns) . "'], '$type']"; |
|
77 | + $rules[] = "[['".implode("', '", $columns)."'], '$type']"; |
|
78 | 78 | } |
79 | 79 | foreach ($lengths as $length => $columns) { |
80 | - $rules[] = "[['" . implode("', '", $columns) . "'], 'string', 'max' => $length]"; |
|
80 | + $rules[] = "[['".implode("', '", $columns)."'], 'string', 'max' => $length]"; |
|
81 | 81 | } |
82 | 82 | $db = $this->getDbConnection(); |
83 | 83 | // Unique indexes rules |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | if (!$this->isColumnAutoIncremental($table, $uniqueColumns)) { |
89 | 89 | $attributesCount = count($uniqueColumns); |
90 | 90 | if ($attributesCount === 1) { |
91 | - $rules[] = "[['" . $uniqueColumns[0] . "'], 'unique']"; |
|
91 | + $rules[] = "[['".$uniqueColumns[0]."'], 'unique']"; |
|
92 | 92 | } elseif ($attributesCount > 1) { |
93 | 93 | $labels = array_intersect_key($this->generateLabels($table), array_flip($uniqueColumns)); |
94 | 94 | $lastLabel = array_pop($labels); |
95 | 95 | $columnsList = implode("', '", $uniqueColumns); |
96 | - $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of " . implode(', ', $labels) . " and $lastLabel has already been taken.']"; |
|
96 | + $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of ".implode(', ', $labels)." and $lastLabel has already been taken.']"; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $fullTableName = $tableName; |
137 | 137 | if (($pos = strrpos($tableName, '.')) !== false) { |
138 | 138 | if (($useSchemaName === null && $this->useSchemaName) || $useSchemaName) { |
139 | - $schemaName = substr($tableName, 0, $pos) . '_'; |
|
139 | + $schemaName = substr($tableName, 0, $pos).'_'; |
|
140 | 140 | } |
141 | 141 | $tableName = substr($tableName, $pos + 1); |
142 | 142 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (($pos = strrpos($pattern, '.')) !== false) { |
150 | 150 | $pattern = substr($pattern, $pos + 1); |
151 | 151 | } |
152 | - $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/'; |
|
152 | + $patterns[] = '/^'.str_replace('*', '(\w+)', $pattern).'$/'; |
|
153 | 153 | } |
154 | 154 | $className = $tableName; |
155 | 155 | foreach ($patterns as $pattern) { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } else { |
194 | 194 | $label = Inflector::camel2words($column->name); |
195 | 195 | if (!empty($label) && substr_compare($label, ' id', -3, 3, true) === 0) { |
196 | - $label = substr($label, 0, -3) . ' ID'; |
|
196 | + $label = substr($label, 0, -3).' ID'; |
|
197 | 197 | } |
198 | 198 | $labels[$column->name] = $label; |
199 | 199 | } |
@@ -88,8 +88,8 @@ |
||
88 | 88 | { |
89 | 89 | return [ |
90 | 90 | <?php foreach ($extras as $extra):?> |
91 | - <?= $extra;?> |
|
92 | -<?php endforeach;?> |
|
91 | + <?= $extra; ?> |
|
92 | +<?php endforeach; ?> |
|
93 | 93 | |
94 | 94 | ]; |
95 | 95 | } |