Test Setup Failed
Push — master ( d2d35e...d3f276 )
by Александр
01:35
created
src/relatedProperties/models/RelatedPropertyModel.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             //[['code'], 'string', 'max' => 64],
138 138
             [
139 139
                 ['code'],
140
-                function ($attribute) {
140
+                function($attribute) {
141 141
                     if (!preg_match('/^[a-zA-Z]{1}[a-zA-Z0-9]{1,255}$/',
142 142
                         $this->$attribute))
143 143
                         //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute))
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             [
154 154
                 'code',
155 155
                 'default',
156
-                'value' => function ($model, $attribute) {
156
+                'value' => function($model, $attribute) {
157 157
                     return "property" . StringHelper::ucfirst(md5(rand(1, 10) . time()));
158 158
                 }
159 159
             ],
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,13 +139,14 @@
 block discarded – undo
139 139
                 ['code'],
140 140
                 function ($attribute) {
141 141
                     if (!preg_match('/^[a-zA-Z]{1}[a-zA-Z0-9]{1,255}$/',
142
-                        $this->$attribute))
143
-                        //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute))
142
+                        $this->$attribute)) {
143
+                                            //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute))
144 144
                     {
145 145
                         $this->addError($attribute, \Yii::t('skeeks/cms',
146 146
                             'Use only letters of the alphabet in lower or upper case and numbers, the first character of the letter (Example {code})',
147 147
                             ['code' => 'code1']));
148 148
                     }
149
+                    }
149 150
                 }
150 151
             ],
151 152
 
Please login to merge, or discard this patch.