function UserCancelMethodsConstraint::create

Overrides ContainerFactoryPluginInterface::create

File

core/modules/user/src/Plugin/Validation/Constraint/UserCancelMethodsConstraint.php, line 22

Class

UserCancelMethodsConstraint

Namespace

Drupal\user\Plugin\Validation\Constraint

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) : Choice {
    $configuration['choices'] = array_keys(user_cancel_methods()['#options']);
    return new Choice($configuration);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.