8
8
use Magento \Config \Model \Config \Source \Nooptreq as NooptreqSource ;
9
9
use Magento \Customer \Helper \Address as AddressHelper ;
10
10
use Magento \Framework \Escaper ;
11
+ use Magento \Store \Api \Data \StoreInterface ;
11
12
13
+ /**
14
+ * Customer Options.
15
+ */
12
16
class Options
13
17
{
14
18
/**
@@ -38,7 +42,7 @@ public function __construct(
38
42
/**
39
43
* Retrieve name prefix dropdown options
40
44
*
41
- * @param null $store
45
+ * @param null|string|bool|int|StoreInterface $store
42
46
* @return array|bool
43
47
*/
44
48
public function getNamePrefixOptions ($ store = null )
@@ -52,7 +56,7 @@ public function getNamePrefixOptions($store = null)
52
56
/**
53
57
* Retrieve name suffix dropdown options
54
58
*
55
- * @param null $store
59
+ * @param null|string|bool|int|StoreInterface $store
56
60
* @return array|bool
57
61
*/
58
62
public function getNameSuffixOptions ($ store = null )
@@ -64,7 +68,9 @@ public function getNameSuffixOptions($store = null)
64
68
}
65
69
66
70
/**
67
- * @param $options
71
+ * Unserialize and clear name prefix or suffix options.
72
+ *
73
+ * @param string $options
68
74
* @param bool $isOptional
69
75
* @return array|bool
70
76
*
@@ -78,6 +84,7 @@ protected function _prepareNamePrefixSuffixOptions($options, $isOptional = false
78
84
79
85
/**
80
86
* Unserialize and clear name prefix or suffix options
87
+ *
81
88
* If field is optional, add an empty first option.
82
89
*
83
90
* @param string $options
@@ -91,7 +98,7 @@ private function prepareNamePrefixSuffixOptions($options, $isOptional = false)
91
98
return false ;
92
99
}
93
100
$ result = [];
94
- $ options = explode ('; ' , $ options );
101
+ $ options = array_filter ( explode ('; ' , $ options) );
95
102
foreach ($ options as $ value ) {
96
103
$ value = $ this ->escaper ->escapeHtml (trim ($ value ));
97
104
$ result [$ value ] = $ value ;
0 commit comments