Shipment/Model/ShipmentDataTrait.php
public function addLabel(ShipmentLabelInterface $label)
    {
        if (!$this->hasLabel($label)) {
            $this->labels->add($label);

            if ($this instanceof ShipmentInterface) {
                $label->setShipment($this)->setParcel(null);
            } else {
                $label->setParcel($this)->setShipment(null);
            }
        }

        return $this;
    }
public function addLabel(ShipmentLabelInterface $label)
    {
        if (!$this->hasLabel($label)) {
            $this->labels->add($label);

            if ($this instanceof ShipmentInterface) {
                $label->setShipment($this)->setParcel(null);
            } else {
                $label->setParcel($this)->setShipment(null);
            }
        }

        return $this;
    }
Adds the label.

@param ShipmentLabelInterface $label

@return $this|ShipmentDataInterface