@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param FormInterface $sourceForm |
48 | 48 | * @param FormInterface $targetForm |
49 | 49 | * |
50 | - * @return array |
|
50 | + * @return AbstractDiff[] |
|
51 | 51 | * @throws \Nnx\FormComparator\Comparator\Exception\RuntimeException |
52 | 52 | * @throws \Nnx\FormComparator\Comparator\Exception\IncorrectElementTypeException |
53 | 53 | */ |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | /** |
208 | 208 | * @param FieldsetInterface $sourceFieldset |
209 | 209 | * @param FieldsetInterface $targetFieldset |
210 | - * @param $prefixPath |
|
210 | + * @param string $prefixPath |
|
211 | 211 | * |
212 | 212 | * @throws \Nnx\FormComparator\Comparator\Exception\IncorrectElementTypeException |
213 | 213 | */ |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | /** |
317 | 317 | * Путь до элемента |
318 | 318 | * |
319 | - * @param $elementName |
|
319 | + * @param string $elementName |
|
320 | 320 | * @param null|string $prefixPath |
321 | 321 | * |
322 | 322 | * @return string |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * |
354 | 354 | * @param ElementInterface $sourceElement |
355 | 355 | * @param ElementInterface $targetElement |
356 | - * @param $prefixPath |
|
356 | + * @param string $prefixPath |
|
357 | 357 | * |
358 | 358 | * @throws \Nnx\FormComparator\Comparator\Exception\IncorrectElementTypeException |
359 | 359 | */ |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * зависимости от типа элемента |
383 | 383 | * |
384 | 384 | * @param ElementInterface $deletedElement |
385 | - * @param $prefixPath |
|
385 | + * @param string $prefixPath |
|
386 | 386 | */ |
387 | 387 | protected function runDeleteElementStrategy(ElementInterface $deletedElement, $prefixPath) |
388 | 388 | { |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | * с добавлением элемента в форму |
402 | 402 | * |
403 | 403 | * @param ElementInterface $insertedElement |
404 | - * @param $prefixPath |
|
404 | + * @param string $prefixPath |
|
405 | 405 | */ |
406 | 406 | protected function runInsertedElementStrategy(ElementInterface $insertedElement, $prefixPath) |
407 | 407 | { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @var AbstractDiff[] |
41 | 41 | */ |
42 | - private $diff = []; |
|
42 | + private $diff = [ ]; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Определение элементов которые отличаются в формах |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $this->runBuildDiffFieldset($sourceForm, $targetForm); |
72 | 72 | $diff = $this->diff; |
73 | - $this->diff = []; |
|
73 | + $this->diff = [ ]; |
|
74 | 74 | |
75 | 75 | $this->sourceForm = null; |
76 | 76 | $this->targetForm = null; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | ->setTargetElement($insertedElement) |
171 | 171 | ->setSourceLabel($insertedElement->getLabel()); |
172 | 172 | |
173 | - $this->diff[] = $builder->build(); |
|
173 | + $this->diff[ ] = $builder->build(); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | ->setSourceElement($sourceElement) |
200 | 200 | ->setTargetElement($targetElement); |
201 | 201 | |
202 | - $this->diff[] = $builder->build(); |
|
202 | + $this->diff[ ] = $builder->build(); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | ->setSourceElement($deletedElement) |
310 | 310 | ->setSourceLabel($deletedElement->getLabel()); |
311 | 311 | |
312 | - $this->diff[] = $builder->build(); |
|
312 | + $this->diff[ ] = $builder->build(); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * @var AbstractDiff[] |
36 | 36 | */ |
37 | - private $diff = []; |
|
37 | + private $diff = [ ]; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Определяет путь до элементов которые в данный момент сравниваются |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->source = $source; |
90 | 90 | $this->target = $target; |
91 | 91 | |
92 | - if (null !== $source && null !== $target) { |
|
92 | + if (null !== $source && null !== $target) { |
|
93 | 93 | $sourceName = $this->source->getName(); |
94 | 94 | $targetName = $this->target->getName(); |
95 | 95 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function addDiff(AbstractDiff $diff) |
165 | 165 | { |
166 | - $this->diff[] = $diff; |
|
166 | + $this->diff[ ] = $diff; |
|
167 | 167 | |
168 | 168 | return $this; |
169 | 169 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @var DeleteElement[] |
30 | 30 | */ |
31 | - private $deletedElement = []; |
|
31 | + private $deletedElement = [ ]; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Возвращает элементы удаленной коллекции |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * |
35 | 35 | * @var AbstractDiff[] |
36 | 36 | */ |
37 | - private $diff = []; |
|
37 | + private $diff = [ ]; |
|
38 | 38 | |
39 | 39 | // /** |
40 | 40 | // * UpdateElement constructor. |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @var InsertElement[] |
30 | 30 | */ |
31 | - private $insertedElement = []; |
|
31 | + private $insertedElement = [ ]; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Возвращает элементы добавленной коллекции |
@@ -87,13 +87,13 @@ |
||
87 | 87 | protected function buildHashForCollectionElements(Collection $collection) |
88 | 88 | { |
89 | 89 | $order = 0; |
90 | - $hashForCollectionElements = []; |
|
90 | + $hashForCollectionElements = [ ]; |
|
91 | 91 | $hashElementBuilder = $this->getHashElementBuilder(); |
92 | 92 | |
93 | 93 | foreach ($collection->getIterator() as $elementOrFieldset) { |
94 | 94 | /** @var ElementInterface $elementOrFieldset */ |
95 | 95 | Assert::isInstanceOf($elementOrFieldset, ElementInterface::class); |
96 | - $hashForCollectionElements[$order] = $hashElementBuilder->hash($elementOrFieldset); |
|
96 | + $hashForCollectionElements[ $order ] = $hashElementBuilder->hash($elementOrFieldset); |
|
97 | 97 | $order++; |
98 | 98 | } |
99 | 99 |
@@ -21,7 +21,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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'); |