Shipment/EventListener/ShipmentMethodListener.php
private function getShipmentMethodFromEvent(ResourceEventInterface $event)
    {
        $resource = $event->getResource();

        if (!$resource instanceof ShipmentMethodInterface) {
            throw new InvalidArgumentException('Expected instance of ' . ShipmentMethodInterface::class);
        }

        return $resource;
    }
private function getShipmentMethodFromEvent(ResourceEventInterface $event)
    {
        $resource = $event->getResource();

        if (!$resource instanceof ShipmentMethodInterface) {
            throw new InvalidArgumentException('Expected instance of ' . ShipmentMethodInterface::class);
        }

        return $resource;
    }
Returns the shipment method from the event.

@param ResourceEventInterface $event

@return ShipmentMethodInterface
@throws InvalidArgumentException