/** * @throws \LogicException * To be called from validate() when packages have to have 3 dimensions and weight */ protected function validatePackages() { foreach ($this->shipment->getPackages() as $package) { Validator::checkIfNull($package->getWeight(), 'weight'); Validator::checkIfNull($package->getLength(), 'length'); Validator::checkIfNull($package->getHeight(), 'height'); Validator::checkIfNull($package->getWidth(), 'width'); } }