Skip to content

Commit d6d6596

Browse files
committed
fix: declare $optionCollection property to silence PHP 8.2 dynamic-property deprecation
$optionCollection was used as a lazy-loaded per-attribute-id cache in loadOptionCollection() but was never declared as a class property. PHP 8.2 deprecated dynamic property creation; Magento's strict error handler promotes that deprecation to an exception, causing exit code 1 in CI. Declare it as `private array $optionCollection = []`.
1 parent e85f2c5 commit d6d6596

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Component/Attributes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class Attributes implements ComponentInterface
5959

6060
protected array $swatchMap = [];
6161

62+
private array $optionCollection = [];
63+
6264
public function __construct(
6365
protected readonly EavSetup $eavSetup,
6466
protected readonly AttributeRepositoryInterface $attributeRepository,

0 commit comments

Comments
 (0)