code: public function add($item)
      {
          if ($item instanceof ShippingMethodInterface) {
              $this->items[] = $item;
          } else {
              $this->items[] = new Item($item);
          }
      }
docs: Add an item to the bag
  
  @see Item
  
  @param ShippingMethodInterface|array $item An existing item, or associative array of item parameters