src/Form/Extension/ShippingMethodChoiceTypeExtension.php
public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefault(
            'choice_attr',
            function ($choiceValue, $key, $value) {
                /** @var ShippingMethod $choiceValue */
                $calculatorName = $choiceValue->getCalculator();

                /** @var PickupCalculatorInterface $calculator */
                $calculator = $this->calculatorRegistry->get($calculatorName);

                $attr = [];
                if ($calculator instanceof PickupCalculatorInterface) {
                    $attr['class'] = 'pickup';
                }

                return $attr;
            }
        );
    }
public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefault(
            'choice_attr',
            function ($choiceValue, $key, $value) {
                /** @var ShippingMethod $choiceValue */
                $calculatorName = $choiceValue->getCalculator();

                /** @var PickupCalculatorInterface $calculator */
                $calculator = $this->calculatorRegistry->get($calculatorName);

                $attr = [];
                if ($calculator instanceof PickupCalculatorInterface) {
                    $attr['class'] = 'pickup';
                }

                return $attr;
            }
        );
    }
{@inheritdoc}