Skip to content

Commit 57f3499

Browse files
committed
fixed php coding standard issues
1 parent 2786e92 commit 57f3499

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

app/code/Meta/Catalog/Setup/MetaCatalogAttributes.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
class MetaCatalogAttributes
1111
{
1212
/**
13+
* Returns array of product attributes to be created
14+
*
1315
* @return array[]
1416
*/
1517
public function execute(): array
@@ -20,7 +22,7 @@ public function execute(): array
2022
'type' => 'varchar',
2123
'label' => 'Google Product Category',
2224
'input' => 'select',
23-
'source' => 'Meta\Catalog\Model\Config\Source\Product\GoogleProductCategory',
25+
'source' => Meta\Catalog\Model\Config\Source\Product\GoogleProductCategory::class,
2426
'required' => false,
2527
'sort_order' => 10,
2628
'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
@@ -35,7 +37,7 @@ public function execute(): array
3537
'type' => 'int',
3638
'label' => 'Sync to Facebook Catalog',
3739
'input' => 'boolean',
38-
'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
40+
'source' => Magento\Eav\Model\Entity\Attribute\Source\Boolean::class,
3941
'visible' => true,
4042
'default' => "1",
4143
'required' => false,

app/code/Meta/Catalog/Setup/Patch/Data/AddProductAttributes.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function __construct(
4444
}
4545

4646
/**
47+
* Get dependencies for the data patch
48+
*
4749
* @return array
4850
*/
4951
public static function getDependencies(): array
@@ -52,6 +54,8 @@ public static function getDependencies(): array
5254
}
5355

5456
/**
57+
* Get alias for the data patch
58+
*
5559
* @return array
5660
*/
5761
public function getAliases(): array
@@ -60,6 +64,8 @@ public function getAliases(): array
6064
}
6165

6266
/**
67+
* Create product attributes
68+
*
6369
* @return void
6470
*/
6571
public function apply(): void
@@ -88,6 +94,8 @@ public function apply(): void
8894
}
8995

9096
/**
97+
* Revert the created product attributes
98+
*
9199
* @return void
92100
*/
93101
public function revert(): void
@@ -97,7 +105,7 @@ public function revert(): void
97105
/** @var EavSetup $eavSetup */
98106
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
99107

100-
foreach ($catalogAttributes as $attributeCode => $attributeData) {
108+
foreach (array_keys($catalogAttributes) as $attributeCode) {
101109
$eavSetup->removeAttribute(Product::ENTITY, $attributeCode);
102110
}
103111

0 commit comments

Comments
 (0)