You are here

public static function FedEx::enumToList in Commerce FedEx 8

Convert a FedEx API enum array to an options list.

Parameters

array $enums: The FedEx API enum array.

Return value

array The options list.

1 call to FedEx::enumToList()
FedEx::buildConfigurationForm in src/Plugin/Commerce/ShippingMethod/FedEx.php
Form constructor.

File

src/Plugin/Commerce/ShippingMethod/FedEx.php, line 571

Class

FedEx
Provides the FedEx shipping method.

Namespace

Drupal\commerce_fedex\Plugin\Commerce\ShippingMethod

Code

public static function enumToList(array $enums) {
  return array_combine($enums, array_map(function ($d) {
    return ucwords(strtolower(str_replace('_', ' ', $d)));
  }, $enums));
}