configureOptions() public method

public configureOptions ( Symfony\Component\OptionsResolver\OptionsResolver $resolver )
$resolver Symfony\Component\OptionsResolver\OptionsResolver
 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $choiceList = function (Options $options) {
         if (isset($options['subject'])) {
             $methods = $this->resolver->getSupportedMethods($options['subject'], $options['criteria']);
         } else {
             $methods = $this->repository->findBy($options['criteria']);
         }
         if ($options['channel']) {
             $filteredMethods = [];
             foreach ($methods as $method) {
                 if ($options['channel']->hasShippingMethod($method)) {
                     $filteredMethods[] = $method;
                 }
             }
             $methods = $filteredMethods;
         }
         return new ObjectChoiceList($methods, null, [], null, 'id');
     };
     $resolver->setDefaults(['choice_list' => $choiceList, 'criteria' => [], 'channel' => null])->setAllowedTypes('channel', [ChannelInterface::class, 'null']);
 }