Helper/VariantHelper.php
public function getAttributes(ProductInterface $product) : array
    {
        $attributes = [];
        
        $product->getVariants()->map(function (VariantInterface $variant) use (&$attributes) {
            if ($variant->isEnabled()) {
                $this->extractAttributesData($variant, $attributes);
            }
        });
        
        return $attributes;
    }
public function getAttributes(ProductInterface $product) : array
    {
        $attributes = [];
        
        $product->getVariants()->map(function (VariantInterface $variant) use (&$attributes) {
            if ($variant->isEnabled()) {
                $this->extractAttributesData($variant, $attributes);
            }
        });
        
        return $attributes;
    }
{@inheritdoc}