Completed
Push — master ( a42159...a36541 )
by Pavel
04:22
created
src/SortableBehavior.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $currentCondition = [];
78 78
         /** @var ActiveRecord $owner */
79 79
         $owner = $this->owner;
80
-        foreach ((array)$this->conditionAttributes as $attribute) {
80
+        foreach ((array) $this->conditionAttributes as $attribute) {
81 81
             if (!$owner->hasAttribute($attribute)) {
82 82
                 continue;
83 83
             }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         }
146 146
         $owner = $this->owner;
147 147
         $condition = $this->getCondition();
148
-        $newSort = $owner->{$this->sortAttribute} + $value;
148
+        $newSort = $owner->{$this->sortAttribute} +$value;
149 149
         if ($value > 0) {
150 150
             // move up
151 151
             $max = $this->getMaxSort();
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
             [$this->sortAttribute => new Expression('(@sortingCount:=(@sortingCount+1))')],
196 196
             $this->getCondition(),
197 197
             $params
198
-        ) . ' ' . $builder->buildOrderBy($orderFields);
199
-        $db->createCommand('set @sortingCount=-1;' . $query, $params)->execute();
198
+        ).' '.$builder->buildOrderBy($orderFields);
199
+        $db->createCommand('set @sortingCount=-1;'.$query, $params)->execute();
200 200
         // update in current record
201 201
         if (!$owner->getIsNewRecord()) {
202 202
             $owner->{$this->sortAttribute} = $owner->findOne($owner->getPrimaryKey())->{$this->sortAttribute};
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         if ($this->_condition === null) {
224 224
             $this->_condition = ['and'];
225
-            foreach ((array)$this->conditionAttributes as $attribute) {
225
+            foreach ((array) $this->conditionAttributes as $attribute) {
226 226
                 if ($this->owner->hasAttribute($attribute)) {
227 227
                     $this->_condition[] = [$attribute => $this->owner->$attribute];
228 228
                 }
Please login to merge, or discard this patch.