original_string: public function getWeight(array $order, array &$cart)
      {
          $result = null;
          $this->hook->attach('order.weight.get.before', $order, $cart, $result, $this);
  
          if (isset($result)) {
              return (float) $result;
          }
  
          $total = 0.0;
          foreach ($cart['items'] as &$item) {
              $this->sumTotalWeight($total, $item, $order);
          }
  
          $result = round($total, 2);
          $this->hook->attach('order.weight.get.after', $order, $cart, $result, $this);
          return (float) $result;
      }
code: public function getWeight(array $order, array &$cart)
      {
          $result = null;
          $this->hook->attach('order.weight.get.before', $order, $cart, $result, $this);
  
          if (isset($result)) {
              return (float) $result;
          }
  
          $total = 0.0;
          foreach ($cart['items'] as &$item) {
              $this->sumTotalWeight($total, $item, $order);
          }
  
          $result = round($total, 2);
          $this->hook->attach('order.weight.get.after', $order, $cart, $result, $this);
          return (float) $result;
      }
code_tokens: public function getWeight ( array $ order , array & $ cart ) { $ result = null ; $ this -> hook -> attach ( 'order.weight.get.before' , $ order , $ cart , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( float ) $ result ; } $ total = 0.0 ; foreach ( $ cart [ 'items' ] as & $ item ) { $ this -> sumTotalWeight ( $ total , $ item , $ order ) ; } $ result = round ( $ total , 2 ) ; $ this -> hook -> attach ( 'order.weight.get.after' , $ order , $ cart , $ result , $ this ) ; return ( float ) $ result ; }
docstring: Returns a total weight of all products in the order
  @param array $order
  @param array $cart
  @return float|null
docstring_tokens: Returns a total weight of all products in the order