File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed
app/code/Magento/OneTouchOrdering Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Framework \Controller \Result \Json as JsonResult ;
11
11
use Magento \Framework \Controller \ResultFactory ;
12
12
use Magento \OneTouchOrdering \Model \Config ;
13
- use Magento \OneTouchOrdering \Model \CustomerAddressesFormater ;
13
+ use Magento \OneTouchOrdering \Model \CustomerAddressesFormatter ;
14
14
use Magento \OneTouchOrdering \Model \OneTouchOrdering ;
15
15
use Magento \Customer \Model \Session ;
16
16
@@ -25,7 +25,7 @@ class Available extends Action
25
25
*/
26
26
private $ customerSession ;
27
27
/**
28
- * @var CustomerAddressesFormater
28
+ * @var CustomerAddressesFormatter
29
29
*/
30
30
private $ customerAddressesFormater ;
31
31
/**
@@ -37,7 +37,7 @@ public function __construct(
37
37
Context $ context ,
38
38
OneTouchOrdering $ oneTouchOrdering ,
39
39
Session $ customerSession ,
40
- CustomerAddressesFormater $ customerAddressesFormater ,
40
+ CustomerAddressesFormatter $ customerAddressesFormater ,
41
41
Config $ oneTouchOrderingConfig
42
42
) {
43
43
parent ::__construct ($ context );
Original file line number Diff line number Diff line change 12
12
* Class CustomerAddresses
13
13
* @package Magento\OneTouchOrdering\Model
14
14
*/
15
- class CustomerAddressesFormater
15
+ class CustomerAddressesFormatter
16
16
{
17
17
18
+ /**
19
+ * @param Customer $customer
20
+ * @return array
21
+ */
18
22
public function getFormattedAddresses (Customer $ customer ): array
19
23
{
20
24
$ addresses = $ customer ->getAddresses ();
@@ -33,7 +37,11 @@ public function getFormattedAddresses(Customer $customer): array
33
37
return $ addressesFormatted ;
34
38
}
35
39
36
- private function format (Address $ address )
40
+ /**
41
+ * @param Address $address
42
+ * @return string
43
+ */
44
+ private function format (Address $ address ): string
37
45
{
38
46
return sprintf (
39
47
"%s, %s, %s, %s %s, %s " ,
Original file line number Diff line number Diff line change 12
12
use Magento \Customer \Model \Customer ;
13
13
use Magento \Directory \Model \Country ;
14
14
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
15
- use Magento \OneTouchOrdering \Model \CustomerAddressesFormater ;
15
+ use Magento \OneTouchOrdering \Model \CustomerAddressesFormatter ;
16
16
use PHPUnit \Framework \TestCase ;
17
17
18
- class CustomerAddressesFormaterTest extends TestCase
18
+ class CustomerAddressesFormatterTest extends TestCase
19
19
{
20
20
/**
21
21
* @var \PHPUnit_Framework_MockObject_MockObject|Customer
@@ -26,7 +26,7 @@ class CustomerAddressesFormaterTest extends TestCase
26
26
*/
27
27
protected $ address ;
28
28
/**
29
- * @var CustomerAddressesFormater
29
+ * @var CustomerAddressesFormatter
30
30
*/
31
31
protected $ customerAddresses ;
32
32
@@ -39,7 +39,7 @@ public function setUp()
39
39
->disableOriginalConstructor ()
40
40
->setMethods (['getCountryModel ' , 'getId ' , 'getName ' ])
41
41
->getMock ();
42
- $ this ->customerAddresses = $ objectManager ->getObject (CustomerAddressesFormater ::class);
42
+ $ this ->customerAddresses = $ objectManager ->getObject (CustomerAddressesFormatter ::class);
43
43
}
44
44
45
45
public function testGetFormattedAddresses ()
You can’t perform that action at this time.
0 commit comments