I'm struggling with PHP 8.2 and some Magento modules I inherited with a site.

I believe the errors are specifically because of PHP 8.2

For example: main.CRITICAL: Exception: Deprecated Functionality: Creation of dynamic property Something\Something\Helper\Index::$attributeRepository is deprecated in

This is the line of code that it specifically references in the error

this->attributeRepository = $attributeRepository;

How do you even start to debug this? Can I add logging in to see where the error is? I believe it's down to dynamic attributes but I could be wrong?

1 Answer 1


Create in your Something\Something\Helper\Index class a property called attributeRepository

private $attributeRepository;

Or even better type hint it also

private \ClassName\Here $attributeRepository;

replace \ClassName\Here with the real class name of your attribute repository.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.