original_string: public function delete($cart_id)
      {
          $result = array();
          $this->hook->attach('cart.delete.item.before', $cart_id, $result, $this);
  
          if (!empty($result)) {
              return (array) $result;
          }
  
          $cart = $this->cart->get($cart_id);
  
          if (empty($cart) || !$this->cart->delete($cart_id)) {
              return $this->getResultError();
          }
  
          $result = $this->getResultDelete($cart);
          $this->hook->attach('cart.delete.item.after', $cart_id, $result, $this);
          return $result;
      }
code: public function delete($cart_id)
      {
          $result = array();
          $this->hook->attach('cart.delete.item.before', $cart_id, $result, $this);
  
          if (!empty($result)) {
              return (array) $result;
          }
  
          $cart = $this->cart->get($cart_id);
  
          if (empty($cart) || !$this->cart->delete($cart_id)) {
              return $this->getResultError();
          }
  
          $result = $this->getResultDelete($cart);
          $this->hook->attach('cart.delete.item.after', $cart_id, $result, $this);
          return $result;
      }
code_tokens: public function delete ( $ cart_id ) { $ result = array ( ) ; $ this -> hook -> attach ( 'cart.delete.item.before' , $ cart_id , $ result , $ this ) ; if ( ! empty ( $ result ) ) { return ( array ) $ result ; } $ cart = $ this -> cart -> get ( $ cart_id ) ; if ( empty ( $ cart ) || ! $ this -> cart -> delete ( $ cart_id ) ) { return $ this -> getResultError ( ) ; } $ result = $ this -> getResultDelete ( $ cart ) ; $ this -> hook -> attach ( 'cart.delete.item.after' , $ cart_id , $ result , $ this ) ; return $ result ; }
docstring: Deletes a cart item
  @param int $cart_id
  @return array
docstring_tokens: Deletes a cart item