original_string: protected function controlDeleteProductCompare(array &$result, $product_id)
      {
          if (empty($result['redirect'])) {
              $segments = explode(',', $this->path());
              if (isset($segments[0]) && $segments[0] === 'compare' && !empty($segments[1])) {
                  $ids = array_filter(array_map('trim', explode(',', $segments[1])), 'ctype_digit');
                  unset($ids[array_search($product_id, $ids)]);
                  $result['redirect'] = $segments[0] . '/' . implode(',', $ids);
              }
          }
      }
code: protected function controlDeleteProductCompare(array &$result, $product_id)
      {
          if (empty($result['redirect'])) {
              $segments = explode(',', $this->path());
              if (isset($segments[0]) && $segments[0] === 'compare' && !empty($segments[1])) {
                  $ids = array_filter(array_map('trim', explode(',', $segments[1])), 'ctype_digit');
                  unset($ids[array_search($product_id, $ids)]);
                  $result['redirect'] = $segments[0] . '/' . implode(',', $ids);
              }
          }
      }
code_tokens: protected function controlDeleteProductCompare ( array & $ result , $ product_id ) { if ( empty ( $ result [ 'redirect' ] ) ) { $ segments = explode ( ',' , $ this -> path ( ) ) ; if ( isset ( $ segments [ 0 ] ) && $ segments [ 0 ] === 'compare' && ! empty ( $ segments [ 1 ] ) ) { $ ids = array_filter ( array_map ( 'trim' , explode ( ',' , $ segments [ 1 ] ) ) , 'ctype_digit' ) ; unset ( $ ids [ array_search ( $ product_id , $ ids ) ] ) ; $ result [ 'redirect' ] = $ segments [ 0 ] . '/' . implode ( ',' , $ ids ) ; } } }
docstring: Controls result after a product has been deleted from comparison
  @param array $result
  @param integer $product_id
docstring_tokens: Controls result after a product has been deleted from comparison