code: private function getPackage(Order $order)
      {
          $packages = $order->getPackages();
  
          if (empty($packages)) {
              return null;
          }
  
          return array_shift($packages);
      }
docs: @param Order $order
  
  @return null|Package