Skip to content

Commit b9f487e

Browse files
committed
MC-5824: Remove data migration from main Page Builder module
- Resolve static failures - Resolve CR comments
1 parent 48d990e commit b9f487e

File tree

14 files changed

+63
-30
lines changed

14 files changed

+63
-30
lines changed

app/code/Magento/PageBuilder/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
"description": "Page Builder module",
44
"require": {
55
"magento/framework": "*",
6-
"magento/module-eav": "*",
76
"magento/module-store": "*",
87
"magento/module-backend": "*",
98
"magento/module-cms": "*",
109
"magento/module-catalog": "*",
1110
"magento/module-config": "*",
1211
"magento/module-ui": "*",
13-
"magento/module-search": "*",
1412
"magento/module-widget": "*",
1513
"magento/module-catalog-widget": "*",
1614
"magento/module-rule": "*",
1715
"magento/module-directory": "*",
1816
"php": "~7.1.3||~7.2.0"
1917
},
18+
"suggest": {
19+
"magento/module-page-builder-data-migration": "*"
20+
},
2021
"conflict": {
2122
"gene/bluefoot": "*"
2223
},

app/code/Magento/PageBuilderDataMigration/Model/Attribute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Class Attribute
15+
*
16+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1517
*/
1618
class Attribute extends \Magento\Eav\Model\Attribute
1719
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Magento_PageBuilderDataMigration module
22

3-
The Magento_PageBuilderDataMigration module provides data migration capabilities from BlueFoot to Page Builder.
3+
The Magento_PageBuilderDataMigration module provides data migration capabilities from BlueFoot to PageBuilder.

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/ChildrenRendererInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface ChildrenRendererInterface
1717
* Render children for element
1818
*
1919
* @param array $children
20-
* @param $renderChildCallback
20+
* @param \Closure $renderChildCallback
2121
*
2222
* @return string
2323
*/

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/ColorConverter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Magento\PageBuilderDataMigration\Setup\DataConverter;
99

10+
/**
11+
* Class ColorConverter
12+
*/
1013
class ColorConverter
1114
{
1215
/**

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/ConfigurableEavAttributeLoader.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use Magento\Framework\Exception\NoSuchEntityException;
1313

1414
/**
15+
* Class ConfigurableEavAttributeLoader
16+
*
1517
* Using dependency injection, a virtual type can extend this class and be used by your renderer, to configure
1618
* additional attributes that you want to extract from the EAV during hydration.
1719
*
@@ -34,6 +36,11 @@ class ConfigurableEavAttributeLoader implements EavAttributeLoaderInterface
3436
*/
3537
private $attributeFactory;
3638

39+
/**
40+
* @param EntityFactory $entityFactory
41+
* @param AttributeFactory $attributeFactory
42+
* @param array $additionalEavAttributes
43+
*/
3744
public function __construct(
3845
EntityFactory $entityFactory,
3946
AttributeFactory $attributeFactory,
@@ -49,6 +56,8 @@ public function __construct(
4956

5057
/**
5158
* @inheritdoc
59+
*
60+
* @throws \Magento\Framework\Exception\LocalizedException
5261
*/
5362
public function load($entityId) : array
5463
{

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/Renderer/Product.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
/**
2222
* Render product to PageBuilder format
23+
*
24+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2325
*/
2426
class Product implements RendererInterface
2527
{

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/StyleExtractor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class StyleExtractor implements StyleExtractorInterface
2424
*/
2525
private $colorConverter;
2626

27+
/**
28+
* @param Json $serializer
29+
* @param ColorConverter $colorConverter
30+
*/
2731
public function __construct(
2832
Json $serializer,
2933
ColorConverter $colorConverter

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/TreeConverter.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ public function __construct(
6565
/**
6666
* Render JSON format to new master format
6767
*
68-
* @param $string
68+
* @param string $string
6969
*
7070
* @return string
71-
* @throws UnableMigrateWithOutParentException
7271
*/
7372
public function convert(string $string) : string
7473
{
@@ -86,13 +85,13 @@ public function convert(string $string) : string
8685
/**
8786
* Convert content type item
8887
*
89-
* @param $itemData
88+
* @param array $itemData
9089
* @param array $additionalData
9190
* @param array $children
91+
*
9292
* @return string
93-
* @throws UnableMigrateWithOutParentException
9493
*/
95-
private function convertTreeItem($itemData, $additionalData = [], $children = [])
94+
private function convertTreeItem(array $itemData, array $additionalData = [], array $children = []) : string
9695
{
9796
$contentType = isset($itemData['type']) ? $itemData['type'] : $itemData['contentType'];
9897
$renderer = $this->rendererPool->getRenderer($contentType);
@@ -151,11 +150,14 @@ function ($childItem, $childIndex, $children = []) use ($additionalData) {
151150
* @param RendererInterface $renderer
152151
* @param array $itemData
153152
* @param array $itemAdditionalData
153+
*
154154
* @return string
155-
* @throws UnableMigrateWithOutParentException
156155
*/
157-
private function processItemRendering($renderer, array $itemData, array $itemAdditionalData = []) : string
158-
{
156+
private function processItemRendering(
157+
RendererInterface $renderer,
158+
array $itemData,
159+
array $itemAdditionalData = []
160+
) : string {
159161
$defaultRenderer = $this->rendererPool->getRenderer('default');
160162

161163
try {
@@ -186,8 +188,10 @@ function () use ($itemData) {
186188
}
187189

188190
/**
189-
* Handle render exception. Migrate as html if content type can be migrated without parent,
190-
* otherwise throw UnableMigrateWithOutParentException
191+
* Handle a render exception
192+
*
193+
* Migrate as html if content type can be migrated without parent, otherwise throw
194+
* UnableMigrateWithOutParentException.
191195
*
192196
* @param \Exception $exception
193197
* @param RendererInterface $defaultRenderer
@@ -212,8 +216,10 @@ private function handleRenderException(
212216
}
213217

214218
/**
215-
* Check whether content type is unseparatable, can not be part of another content type and parent content type
216-
* can not contain content types of different type
219+
* Check whether content type is un-separatable
220+
*
221+
* It can not be part of another content type and parent content type can not contain content types of different
222+
* type
217223
*
218224
* @param array $itemData
219225
* @return bool

app/code/Magento/PageBuilderDataMigration/Setup/DataConverter/Validator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
use Magento\Framework\Serialize\Serializer\Json;
1111

12+
/**
13+
* Class Validator
14+
*/
1215
class Validator
1316
{
1417
/**

0 commit comments

Comments
 (0)