Skip to content

Commit a63c121

Browse files
committed
MAGETWO-62486: Refactor Layout to store data from object only and restore object
- change code style
1 parent 8e928d6 commit a63c121

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/internal/Magento/Framework/View/Layout/ScheduledStructure.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ScheduledStructure
2424
*
2525
* @var array
2626
*/
27-
private $propertyMap = [
27+
private $serializableProperties = [
2828
'scheduledStructure',
2929
'scheduledData',
3030
'scheduledElements',
@@ -550,7 +550,7 @@ public function flushScheduledStructure()
550550
public function __toArray()
551551
{
552552
$result = [];
553-
foreach ($this->propertyMap as $property) {
553+
foreach ($this->serializableProperties as $property) {
554554
$result[$property] = $this->{$property};
555555
}
556556

@@ -566,7 +566,7 @@ public function __toArray()
566566
*/
567567
public function populateWithArray(array $data)
568568
{
569-
foreach ($this->propertyMap as $property) {
569+
foreach ($this->serializableProperties as $property) {
570570
$this->{$property} = $this->getDataValue($property, $data);
571571
}
572572
}
@@ -578,7 +578,8 @@ public function populateWithArray(array $data)
578578
* @param array $data
579579
* @return array
580580
*/
581-
private function getDataValue($name, array $data) {
581+
private function getDataValue($name, array $data)
582+
{
582583
return isset($data[$name]) ? $data[$name] : [];
583584
}
584585
}

lib/internal/Magento/Framework/View/Page/Config/Structure.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Structure
1717
*
1818
* @var array
1919
*/
20-
private $propertyMap = [
20+
private $serializableProperties = [
2121
'assets',
2222
'removeAssets',
2323
'title',
@@ -220,7 +220,7 @@ public function getAssets()
220220
public function __toArray()
221221
{
222222
$result = [];
223-
foreach ($this->propertyMap as $property) {
223+
foreach ($this->serializableProperties as $property) {
224224
$result[$property] = $this->{$property};
225225
}
226226

@@ -236,7 +236,7 @@ public function __toArray()
236236
*/
237237
public function populateWithArray(array $data)
238238
{
239-
foreach ($this->propertyMap as $property) {
239+
foreach ($this->serializableProperties as $property) {
240240
$this->{$property} = $this->getDataValue($property, $data);
241241
}
242242
}
@@ -248,7 +248,8 @@ public function populateWithArray(array $data)
248248
* @param array $data
249249
* @return array
250250
*/
251-
private function getDataValue($name, array $data) {
251+
private function getDataValue($name, array $data)
252+
{
252253
return isset($data[$name]) ? $data[$name] : [];
253254
}
254255
}

0 commit comments

Comments
 (0)