@@ -17,7 +17,7 @@ |
||
17 | 17 | * |
18 | 18 | * @var ComparableForm[] |
19 | 19 | */ |
20 | - private $comparableForm = []; |
|
20 | + private $comparableForm = [ ]; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Context constructor. |
@@ -21,7 +21,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -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. |
@@ -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'); |
@@ -72,16 +72,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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, |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @var InsertElement[] |
30 | 30 | */ |
31 | - private $insertedElements = []; |
|
31 | + private $insertedElements = [ ]; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Возвращает элементы добавленной коллекции |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * |
28 | 28 | * @var DeleteElement[] |
29 | 29 | */ |
30 | - private $deletedElements = []; |
|
30 | + private $deletedElements = [ ]; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Возвращает элементы удаленной коллекции |
@@ -13,7 +13,7 @@ |
||
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 | ]; |
@@ -70,7 +70,7 @@ |
||
70 | 70 | return array_merge_recursive( |
71 | 71 | include __DIR__ . '/config/module.config.php', |
72 | 72 | include __DIR__ . '/config/serviceManager.config.php', |
73 | - include __DIR__ .'/config/viewManager.config.php' |
|
73 | + include __DIR__ . '/config/viewManager.config.php' |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 |