original_string: public function summarizeGoodsList()
      {
          $amount = 0;
          if (!is_array($this->goodsList)) {
              return $amount;
          }
          foreach ($this->goodsList as $goods) {
              $price = $goods['goods']['price'];
  
              // Add VAT if price is Excluding VAT
              if (($goods['goods']['flags'] & KlarnaFlags::INC_VAT) === 0) {
                  $vat = $goods['goods']['vat'] / 100.0;
                  $price *= (1.0 + $vat);
              }
  
              // Reduce discounts
              if ($goods['goods']['discount'] > 0) {
                  $discount = $goods['goods']['discount'] / 100.0;
                  $price *= (1.0 - $discount);
              }
  
              $amount += $price * (int)$goods['qty'];
          }
          return $amount;
      }
code: public function summarizeGoodsList()
      {
          $amount = 0;
          if (!is_array($this->goodsList)) {
              return $amount;
          }
          foreach ($this->goodsList as $goods) {
              $price = $goods['goods']['price'];
  
              // Add VAT if price is Excluding VAT
              if (($goods['goods']['flags'] & KlarnaFlags::INC_VAT) === 0) {
                  $vat = $goods['goods']['vat'] / 100.0;
                  $price *= (1.0 + $vat);
              }
  
              // Reduce discounts
              if ($goods['goods']['discount'] > 0) {
                  $discount = $goods['goods']['discount'] / 100.0;
                  $price *= (1.0 - $discount);
              }
  
              $amount += $price * (int)$goods['qty'];
          }
          return $amount;
      }
code_tokens: public function summarizeGoodsList ( ) { $ amount = 0 ; if ( ! is_array ( $ this -> goodsList ) ) { return $ amount ; } foreach ( $ this -> goodsList as $ goods ) { $ price = $ goods [ 'goods' ] [ 'price' ] ; // Add VAT if price is Excluding VAT if ( ( $ goods [ 'goods' ] [ 'flags' ] & KlarnaFlags :: INC_VAT ) === 0 ) { $ vat = $ goods [ 'goods' ] [ 'vat' ] / 100.0 ; $ price *= ( 1.0 + $ vat ) ; } // Reduce discounts if ( $ goods [ 'goods' ] [ 'discount' ] > 0 ) { $ discount = $ goods [ 'goods' ] [ 'discount' ] / 100.0 ; $ price *= ( 1.0 - $ discount ) ; } $ amount += $ price * ( int ) $ goods [ 'qty' ] ; } return $ amount ; }
docstring: Summarizes the prices of the held goods list
  
  @return int total amount
docstring_tokens: Summarizes the prices of the held goods list