Completed
Push — master ( 70f96e...85b25a )
by Andrey
02:36
created
src/Context/Context.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      *
18 18
      * @var ComparableForm[]
19 19
      */
20
-    private $comparableForm = [];
20
+    private $comparableForm = [ ];
21 21
 
22 22
     /**
23 23
      * Context constructor.
Please login to merge, or discard this patch.
src/Context/ContextBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @var ComparableForm[]
23 23
      */
24
-    private $comparableForm = [];
24
+    private $comparableForm = [ ];
25 25
 
26 26
     /**
27 27
      * @var FormElementManager
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function addComparableForm(FormInterface $sourceForm, FormInterface $targetForm)
81 81
     {
82
-        $this->comparableForm[] = new ComparableForm($sourceForm, $targetForm);
82
+        $this->comparableForm[ ] = new ComparableForm($sourceForm, $targetForm);
83 83
     }
84 84
 
85 85
     /**
Please login to merge, or discard this patch.
src/Comparator/Diff/UpdateCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      *
35 35
      * @var AbstractDiff[]
36 36
      */
37
-    private $diff = [];
37
+    private $diff = [ ];
38 38
 
39 39
 //    /**
40 40
 //     * UpdateElement constructor.
Please login to merge, or discard this patch.
src/Comparator/CollectionDiffService/HashElementBuilder.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @var array
23 23
      */
24
-    private $hashParts = [];
24
+    private $hashParts = [ ];
25 25
 
26 26
 
27 27
     /**
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function hash(ElementInterface $element)
34 34
     {
35
-        $this->hashParts = [];
35
+        $this->hashParts = [ ];
36 36
 
37 37
         $this->buildHash($element);
38 38
 
39 39
         ksort($this->hashParts, SORT_STRING);
40 40
 
41 41
 
42
-        $hashStack = [];
42
+        $hashStack = [ ];
43 43
         foreach ($this->hashParts as $key => $value) {
44
-            $hashStack[] = $key . '=' . $value;
44
+            $hashStack[ ] = $key . '=' . $value;
45 45
         }
46 46
 
47 47
         return implode('|', $hashStack);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 $this->buildHash($childElementOrFieldset, $elementName);
67 67
             }
68 68
         } else {
69
-            $this->hashParts[$elementName] = $this->normalizeValue($element->getValue());
69
+            $this->hashParts[ $elementName ] = $this->normalizeValue($element->getValue());
70 70
         }
71 71
     }
72 72
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
 
84 84
         if ($rawValue instanceof \DateTimeInterface) {
85
-            $value = (string)$rawValue->getTimestamp();
85
+            $value = (string) $rawValue->getTimestamp();
86 86
         } else {
87 87
             $value = $rawValue;
88 88
             $resultConvert = @settype($value, 'string');
Please login to merge, or discard this patch.
src/Comparator/CollectionDiffService.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
 
73 73
         $collectionElementsInfo = $this->buildInfoForCollectionElements($insertedCollection, $prefixPath);
74 74
 
75
-        $diff = [];
75
+        $diff = [ ];
76 76
 
77 77
         foreach ($collectionElementsInfo  as $rowUniqueId => $info) {
78 78
             $builder = $this->diffCollectionElementBuilderFactory(DiffCollectionElementBuilder::INSERT_ELEMENT_MODE);
79
-            $builder->setSourceHash($info['hash'])
80
-                ->setRowIndex($info['rowIndex'])
81
-                ->setSourceCollectionElement($info['element'])
82
-                ->setUniqueRowId($info['rowUniqueId'])
83
-                ->setPathToElement($info['pathToElement']);
84
-            $diff[] = $builder->build();
79
+            $builder->setSourceHash($info[ 'hash' ])
80
+                ->setRowIndex($info[ 'rowIndex' ])
81
+                ->setSourceCollectionElement($info[ 'element' ])
82
+                ->setUniqueRowId($info[ 'rowUniqueId' ])
83
+                ->setPathToElement($info[ 'pathToElement' ]);
84
+            $diff[ ] = $builder->build();
85 85
         }
86 86
 
87 87
         return $diff;
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 
105 105
         $collectionElementsInfo = $this->buildInfoForCollectionElements($deletedCollection, $prefixPath);
106 106
 
107
-        $diff = [];
107
+        $diff = [ ];
108 108
 
109 109
         foreach ($collectionElementsInfo  as $rowUniqueId => $info) {
110 110
             $builder = $this->diffCollectionElementBuilderFactory(DiffCollectionElementBuilder::DELETE_ELEMENT_MODE);
111
-            $builder->setSourceHash($info['hash'])
112
-                ->setRowIndex($info['rowIndex'])
113
-                ->setSourceCollectionElement($info['element'])
114
-                ->setUniqueRowId($info['rowUniqueId'])
115
-                ->setPathToElement($info['pathToElement']);
116
-            $diff[] = $builder->build();
111
+            $builder->setSourceHash($info[ 'hash' ])
112
+                ->setRowIndex($info[ 'rowIndex' ])
113
+                ->setSourceCollectionElement($info[ 'element' ])
114
+                ->setUniqueRowId($info[ 'rowUniqueId' ])
115
+                ->setPathToElement($info[ 'pathToElement' ]);
116
+            $diff[ ] = $builder->build();
117 117
         }
118 118
 
119 119
         return $diff;
@@ -141,41 +141,41 @@  discard block
 block discarded – undo
141 141
         $targetCollectionElementsInfo = $this->buildInfoForCollectionElements($targetCollection, $prefixPath);
142 142
 
143 143
 
144
-        $diff = [];
144
+        $diff = [ ];
145 145
         foreach ($sourceCollectionElementsInfo as $rowUniqueId => $sourceInfo) {
146 146
             if (array_key_exists($rowUniqueId, $targetCollectionElementsInfo)) {
147
-                $targetInfo = $targetCollectionElementsInfo[$rowUniqueId];
148
-                if ($sourceInfo['hash'] !== $targetInfo['hash']) {
147
+                $targetInfo = $targetCollectionElementsInfo[ $rowUniqueId ];
148
+                if ($sourceInfo[ 'hash' ] !== $targetInfo[ 'hash' ]) {
149 149
                     $builder = $this->diffCollectionElementBuilderFactory(DiffCollectionElementBuilder::UPDATE_ELEMENT_MODE);
150
-                    $builder->setSourceHash($sourceInfo['hash'])
151
-                            ->setTargetHash($targetInfo['hash'])
152
-                            ->setRowIndex($sourceInfo['rowIndex'])
153
-                            ->setSourceCollectionElement($sourceInfo['element'])
154
-                            ->setTargetCollectionElement($targetInfo['element'])
155
-                            ->setUniqueRowId($targetInfo['rowUniqueId'])
156
-                            ->setPathToElement($targetInfo['pathToElement']);
157
-                    $diff[] = $builder->build();
150
+                    $builder->setSourceHash($sourceInfo[ 'hash' ])
151
+                            ->setTargetHash($targetInfo[ 'hash' ])
152
+                            ->setRowIndex($sourceInfo[ 'rowIndex' ])
153
+                            ->setSourceCollectionElement($sourceInfo[ 'element' ])
154
+                            ->setTargetCollectionElement($targetInfo[ 'element' ])
155
+                            ->setUniqueRowId($targetInfo[ 'rowUniqueId' ])
156
+                            ->setPathToElement($targetInfo[ 'pathToElement' ]);
157
+                    $diff[ ] = $builder->build();
158 158
                 }
159 159
             } else {
160 160
                 $builder = $this->diffCollectionElementBuilderFactory(DiffCollectionElementBuilder::DELETE_ELEMENT_MODE);
161
-                $builder->setSourceHash($sourceInfo['hash'])
162
-                    ->setRowIndex($sourceInfo['rowIndex'])
163
-                    ->setSourceCollectionElement($sourceInfo['element'])
164
-                    ->setUniqueRowId($sourceInfo['rowUniqueId'])
165
-                    ->setPathToElement($sourceInfo['pathToElement']);
166
-                $diff[] = $builder->build();
161
+                $builder->setSourceHash($sourceInfo[ 'hash' ])
162
+                    ->setRowIndex($sourceInfo[ 'rowIndex' ])
163
+                    ->setSourceCollectionElement($sourceInfo[ 'element' ])
164
+                    ->setUniqueRowId($sourceInfo[ 'rowUniqueId' ])
165
+                    ->setPathToElement($sourceInfo[ 'pathToElement' ]);
166
+                $diff[ ] = $builder->build();
167 167
             }
168 168
         }
169 169
 
170 170
         foreach ($targetCollectionElementsInfo as $rowUniqueId => $targetInfo) {
171 171
             if (!array_key_exists($rowUniqueId, $sourceCollectionElementsInfo)) {
172 172
                 $builder = $this->diffCollectionElementBuilderFactory(DiffCollectionElementBuilder::INSERT_ELEMENT_MODE);
173
-                $builder->setSourceHash($targetInfo['hash'])
174
-                    ->setRowIndex($targetInfo['rowIndex'])
175
-                    ->setSourceCollectionElement($targetInfo['element'])
176
-                    ->setUniqueRowId($targetInfo['rowUniqueId'])
177
-                    ->setPathToElement($targetInfo['pathToElement']);
178
-                $diff[] = $builder->build();
173
+                $builder->setSourceHash($targetInfo[ 'hash' ])
174
+                    ->setRowIndex($targetInfo[ 'rowIndex' ])
175
+                    ->setSourceCollectionElement($targetInfo[ 'element' ])
176
+                    ->setUniqueRowId($targetInfo[ 'rowUniqueId' ])
177
+                    ->setPathToElement($targetInfo[ 'pathToElement' ]);
178
+                $diff[ ] = $builder->build();
179 179
             }
180 180
         }
181 181
 
@@ -195,13 +195,13 @@  discard block
 block discarded – undo
195 195
     protected function buildInfoForCollectionElements(Collection $collection, $prefixPath)
196 196
     {
197 197
         $rowUniqueId = 0;
198
-        $hashForCollectionElements = [];
198
+        $hashForCollectionElements = [ ];
199 199
         $hashElementBuilder = $this->getHashElementBuilder();
200 200
 
201 201
         foreach ($collection->getIterator() as $elementOrFieldset) {
202 202
             /** @var ElementInterface $elementOrFieldset */
203 203
             Assert::isInstanceOf($elementOrFieldset, ElementInterface::class);
204
-            $hashForCollectionElements[$rowUniqueId] = [
204
+            $hashForCollectionElements[ $rowUniqueId ] = [
205 205
                 'hash' => $hashElementBuilder->hash($elementOrFieldset),
206 206
                 'element' => $elementOrFieldset,
207 207
                 'rowUniqueId' => $rowUniqueId,
Please login to merge, or discard this patch.
src/Comparator/Diff/InsertCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      *
29 29
      * @var InsertElement[]
30 30
      */
31
-    private $insertedElements = [];
31
+    private $insertedElements = [ ];
32 32
 
33 33
     /**
34 34
      * Возвращает элементы добавленной коллекции
Please login to merge, or discard this patch.
src/Comparator/Diff/DeleteCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      *
28 28
      * @var DeleteElement[]
29 29
      */
30
-    private $deletedElements = [];
30
+    private $deletedElements = [ ];
31 31
 
32 32
     /**
33 33
      * Возвращает элементы удаленной коллекции
Please login to merge, or discard this patch.
src/Comparator/FormDiffService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      *
40 40
      * @var AbstractDiff[]
41 41
      */
42
-    private $diff = [];
42
+    private $diff = [ ];
43 43
 
44 44
     /**
45 45
      * Определение элементов которые отличаются в формах
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         $this->runBuildDiffFieldset($sourceForm, $targetForm);
74 74
         $diff = $this->diff;
75
-        $this->diff = [];
75
+        $this->diff = [ ];
76 76
 
77 77
         $this->sourceForm = null;
78 78
         $this->targetForm = null;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             ->setTargetElement($insertedElement)
180 180
             ->setSourceLabel($insertedElement->getLabel());
181 181
 
182
-        $this->diff[] = $builder->build();
182
+        $this->diff[ ] = $builder->build();
183 183
     }
184 184
 
185 185
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                 ->setSourceElement($sourceElement)
212 212
                 ->setTargetElement($targetElement);
213 213
 
214
-            $this->diff[] = $builder->build();
214
+            $this->diff[ ] = $builder->build();
215 215
         }
216 216
     }
217 217
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             ->setSourceElement($deletedElement)
333 333
             ->setSourceLabel($deletedElement->getLabel());
334 334
 
335
-        $this->diff[] = $builder->build();
335
+        $this->diff[ ] = $builder->build();
336 336
     }
337 337
 
338 338
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 ->setTargetElement($targetElement)
394 394
                 ->setSourceLabel($sourceElement->getLabel())
395 395
                 ->setPathToElement($prefixPath);
396
-            $this->diff[] = $builder->build();
396
+            $this->diff[ ] = $builder->build();
397 397
 
398 398
         } elseif ($sourceElement instanceof FieldsetInterface && $targetElement instanceof FieldsetInterface) {
399 399
             $this->buildDiffFieldset($sourceElement, $targetElement, $prefixPath);
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
             $builder->setSourceElement($deletedElement)
420 420
                 ->setSourceLabel($deletedElement->getLabel())
421 421
                 ->setPathToElement($prefixPath);
422
-            $this->diff[] = $builder->build();
422
+            $this->diff[ ] = $builder->build();
423 423
         } elseif ($deletedElement instanceof FieldsetInterface) {
424 424
             $this->markNestedElementsAsDeletedInFieldset($deletedElement, $prefixPath);
425 425
         } else {
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             $builder->setSourceElement($insertedElement)
446 446
                 ->setSourceLabel($insertedElement->getLabel())
447 447
                 ->setPathToElement($prefixPath);
448
-            $this->diff[] = $builder->build();
448
+            $this->diff[ ] = $builder->build();
449 449
         } elseif ($insertedElement instanceof FieldsetInterface) {
450 450
             $this->markNestedElementsAsInsertedInFieldset($insertedElement, $prefixPath);
451 451
         } else {
Please login to merge, or discard this patch.
config/viewManager.config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             [
14 14
                 'form-comparator/default-diff' => __DIR__ . '/../view/form-comparator/default-diff.phtml',
15 15
             ],
16
-            file_exists(__DIR__ . '/../template_map.php') ? include __DIR__ . '/../template_map.php' : []
16
+            file_exists(__DIR__ . '/../template_map.php') ? include __DIR__ . '/../template_map.php' : [ ]
17 17
         )
18 18
     ]
19 19
 ];
Please login to merge, or discard this patch.