Skip to content

Commit 5dfe5e3

Browse files
committed
MSI-1542: Provide MSI support for Shipment Web API endpoint
1 parent 3947aa2 commit 5dfe5e3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Sales/Model/Order/ShipmentDocumentFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function __construct(
6868
}
6969

7070
/**
71+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
72+
*
7173
* @param OrderInterface $order
7274
* @param ShipmentItemCreationInterface[] $items
7375
* @param ShipmentTrackCreationInterface[] $tracks
@@ -97,7 +99,9 @@ public function create(
9799
$shipmentItems
98100
);
99101

100-
$this->extensionAttributesProcessor->execute($shipment, $arguments);
102+
if (null !== $arguments) {
103+
$this->extensionAttributesProcessor->execute($shipment, $arguments);
104+
}
101105

102106
foreach ($tracks as $track) {
103107
$hydrator = $this->hydratorPool->getHydrator(

app/code/Magento/Sales/Model/Order/ShipmentDocumentFactory/ExtensionAttributesProcessor.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ public function __construct(
4848
*/
4949
public function execute(
5050
ShipmentInterface $shipment,
51-
ShipmentCreationArgumentsInterface $arguments = null
51+
ShipmentCreationArgumentsInterface $arguments
5252
): void {
53-
if (null === $arguments) {
54-
return;
55-
}
5653
$shipmentExtensionAttributes = [];
5754
if (null !== $shipment->getExtensionAttributes()) {
5855
$shipmentExtensionAttributes = $this->extensionAttributesProcessor->buildOutputDataArray(

0 commit comments

Comments
 (0)