Skip to content

Commit 3641423

Browse files
committed
#2082: Minor coding style fixes
1 parent d54b03c commit 3641423

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

InventoryInStorePickup/Model/ResourceModel/OrderPickupLocation/GetPickupLocationByOrderId.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*/
1515
class GetPickupLocationByOrderId
1616
{
17-
private const ORDER_ID = 'order_id';
17+
private const ORDER_ID = 'order_id';
18+
1819
private const PICKUP_LOCATION_CODE = 'pickup_location_code';
1920

2021
/**
@@ -23,8 +24,6 @@ class GetPickupLocationByOrderId
2324
private $connection;
2425

2526
/**
26-
* GetPickupLocationByOrderId constructor.
27-
*
2827
* @param \Magento\Framework\App\ResourceConnection $connection
2928
*/
3029
public function __construct(
@@ -40,15 +39,13 @@ public function __construct(
4039
*
4140
* @return string|null
4241
*/
43-
public function execute(int $orderId):?string
42+
public function execute(int $orderId): ?string
4443
{
4544
$connection = $this->connection->getConnection();
4645
$table = $this->connection->getTableName('inventory_pickup_location_order');
4746

4847
$select = $connection->select()
49-
->from($table, [
50-
self::PICKUP_LOCATION_CODE => self::PICKUP_LOCATION_CODE
51-
])
48+
->from($table, [self::PICKUP_LOCATION_CODE => self::PICKUP_LOCATION_CODE])
5249
->where(self::ORDER_ID . '= ?', $orderId)
5350
->limit(1);
5451

InventoryInStorePickup/Model/ResourceModel/OrderPickupLocation/SaveOrderPickupLocation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class SaveOrderPickupLocation
1616
{
17-
private const ORDER_ID = 'order_id';
17+
private const ORDER_ID = 'order_id';
1818
private const PICKUP_LOCATION_CODE = 'pickup_location_code';
1919

2020
/**
@@ -41,7 +41,7 @@ public function __construct(
4141
*
4242
* @return void
4343
*/
44-
public function execute(int $orderId, string $pickupLocationCode):void
44+
public function execute(int $orderId, string $pickupLocationCode): void
4545
{
4646
$connection = $this->connection->getConnection();
4747
$table = $this->connection->getTableName('inventory_pickup_location_order');

InventoryInStorePickup/Plugin/Sales/Order/GetPickupLocationForOrderPlugin.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ class GetPickupLocationForOrderPlugin
2828
private $getPickupLocationByOrderId;
2929

3030
/**
31-
* GetPickupLocationForOrderPlugin constructor.
32-
*
33-
* @param OrderExtensionFactory $orderExtensionFactory
31+
* @param OrderExtensionFactory $orderExtensionFactory
3432
* @param GetPickupLocationByOrderId $getPickupLocationByOrderId
3533
*/
3634
public function __construct(
@@ -42,16 +40,16 @@ public function __construct(
4240
}
4341

4442
/**
43+
* Add Pickup Location Code extension attribute when loading Order with OrderRepository.
44+
*
4545
* @param OrderRepositoryInterface $orderRepository
46-
* @param OrderInterface $order
46+
* @param OrderInterface $order
4747
*
4848
* @return OrderInterface
4949
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5050
*/
51-
public function afterGet(
52-
OrderRepositoryInterface $orderRepository,
53-
OrderInterface $order
54-
):OrderInterface {
51+
public function afterGet(OrderRepositoryInterface $orderRepository, OrderInterface $order): OrderInterface
52+
{
5553
$extension = $order->getExtensionAttributes();
5654

5755
if (empty($extension)) {

InventoryInStorePickup/Plugin/Sales/Order/SavePickupLocationForOrderPlugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class SavePickupLocationForOrderPlugin
2222
private $saveOrderPickupLocation;
2323

2424
/**
25-
* SavePickupLocationForOrderPlugin constructor.
26-
*
2725
* @param SaveOrderPickupLocation $saveOrderPickupLocation
2826
*/
2927
public function __construct(SaveOrderPickupLocation $saveOrderPickupLocation)
@@ -32,9 +30,11 @@ public function __construct(SaveOrderPickupLocation $saveOrderPickupLocation)
3230
}
3331

3432
/**
33+
* Save Order to Pickup Location relation when saving the order.
34+
*
3535
* @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
36-
* @param \Magento\Sales\Api\Data\OrderInterface $result
37-
* @param \Magento\Sales\Api\Data\OrderInterface $entity
36+
* @param \Magento\Sales\Api\Data\OrderInterface $result
37+
* @param \Magento\Sales\Api\Data\OrderInterface $entity
3838
*
3939
* @return \Magento\Sales\Api\Data\OrderInterface
4040
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

0 commit comments

Comments
 (0)