10
10
use Magento \Directory \Model \CountryFactory ;
11
11
use Magento \Eav \Model \Config as EavConfig ;
12
12
use Magento \Framework \App \ObjectManager ;
13
+ use Magento \Framework \Exception \LocalizedException ;
13
14
use Magento \Sales \Model \Order \Address ;
14
15
15
16
/**
@@ -66,7 +67,7 @@ public function __construct(
66
67
/**
67
68
* Validate address.
68
69
*
69
- * @param \Magento\Sales\Model\Order\ Address $address
70
+ * @param Address $address
70
71
* @return array
71
72
*/
72
73
public function validate (Address $ address )
@@ -93,7 +94,7 @@ public function validate(Address $address)
93
94
if (!filter_var ($ address ->getEmail (), FILTER_VALIDATE_EMAIL )) {
94
95
$ warnings [] = 'Email has a wrong format ' ;
95
96
}
96
- if (!filter_var ( in_array ($ address ->getAddressType (), [Address::TYPE_BILLING , Address::TYPE_SHIPPING ]) )) {
97
+ if (!in_array ($ address ->getAddressType (), [Address::TYPE_BILLING , Address::TYPE_SHIPPING ])) {
97
98
$ warnings [] = 'Address type doesn \'t match required options ' ;
98
99
}
99
100
return $ warnings ;
@@ -200,7 +201,7 @@ protected function isStateRequired($countryId)
200
201
* Check whether telephone is required for address.
201
202
*
202
203
* @return bool
203
- * @throws \Magento\Framework\Exception\ LocalizedException
204
+ * @throws LocalizedException
204
205
*/
205
206
protected function isTelephoneRequired ()
206
207
{
@@ -211,7 +212,7 @@ protected function isTelephoneRequired()
211
212
* Check whether company is required for address.
212
213
*
213
214
* @return bool
214
- * @throws \Magento\Framework\Exception\ LocalizedException
215
+ * @throws LocalizedException
215
216
*/
216
217
protected function isCompanyRequired ()
217
218
{
@@ -222,7 +223,7 @@ protected function isCompanyRequired()
222
223
* Check whether telephone is required for address.
223
224
*
224
225
* @return bool
225
- * @throws \Magento\Framework\Exception\ LocalizedException
226
+ * @throws LocalizedException
226
227
*/
227
228
protected function isFaxRequired ()
228
229
{
0 commit comments