diff --git a/app/code/Magento/Customer/Model/Options.php b/app/code/Magento/Customer/Model/Options.php index 7747e309d82a6..b4e9b6cb10528 100644 --- a/app/code/Magento/Customer/Model/Options.php +++ b/app/code/Magento/Customer/Model/Options.php @@ -9,6 +9,11 @@ use Magento\Customer\Helper\Address as AddressHelper; use Magento\Framework\Escaper; +/** + * Class Options + * + * @package Magento\Customer\Model + */ class Options { /** @@ -38,7 +43,7 @@ public function __construct( /** * Retrieve name prefix dropdown options * - * @param null $store + * @param string|null $store * @return array|bool */ public function getNamePrefixOptions($store = null) @@ -52,7 +57,7 @@ public function getNamePrefixOptions($store = null) /** * Retrieve name suffix dropdown options * - * @param null $store + * @param string|null $store * @return array|bool */ public function getNameSuffixOptions($store = null) @@ -64,7 +69,9 @@ public function getNameSuffixOptions($store = null) } /** - * @param $options + * Prepare Name Suffix Options + * + * @param string|null $options * @param bool $isOptional * @return array|bool * @@ -78,6 +85,7 @@ protected function _prepareNamePrefixSuffixOptions($options, $isOptional = false /** * Unserialize and clear name prefix or suffix options + * * If field is optional, add an empty first option. * * @param string $options @@ -95,6 +103,7 @@ private function prepareNamePrefixSuffixOptions($options, $isOptional = false) foreach ($options as $value) { $value = $this->escaper->escapeHtml(trim($value)); $result[$value] = $value; + $result = array_filter($result); } if ($isOptional && trim(current($options))) { $result = array_merge([' ' => ' '], $result);