code: private function findMatchingShipmentItem(InvoiceLineInterface $line, ShipmentInterface $shipment)
      {
          $saleItem = $line->getSaleItem();
  
          foreach ($shipment->getItems() as $shipmentItem) {
              if ($saleItem === $shipmentItem->getSaleItem()) {
                  return $shipmentItem;
              }
          }
  
          return null;
      }
docs: Finds the shipment item matching the invoice line.
  
  @param InvoiceLineInterface $line
  @param ShipmentInterface    $shipment
  
  @return \Ekyna\Component\Commerce\Shipment\Model\ShipmentItemInterface|null