original_string: protected function unshiftSelectedImageProduct($selected, &$product)
      {
          if (isset($selected['combination']['file_id']) && isset($product['images'][$selected['combination']['file_id']])) {
              $image = $product['images'][$selected['combination']['file_id']];
              unset($product['images'][$selected['combination']['file_id']]);
              $product['images'] = array($image['file_id'] => $image) + $product['images'];
          }
      }
code: protected function unshiftSelectedImageProduct($selected, &$product)
      {
          if (isset($selected['combination']['file_id']) && isset($product['images'][$selected['combination']['file_id']])) {
              $image = $product['images'][$selected['combination']['file_id']];
              unset($product['images'][$selected['combination']['file_id']]);
              $product['images'] = array($image['file_id'] => $image) + $product['images'];
          }
      }
code_tokens: protected function unshiftSelectedImageProduct ( $ selected , & $ product ) { if ( isset ( $ selected [ 'combination' ] [ 'file_id' ] ) && isset ( $ product [ 'images' ] [ $ selected [ 'combination' ] [ 'file_id' ] ] ) ) { $ image = $ product [ 'images' ] [ $ selected [ 'combination' ] [ 'file_id' ] ] ; unset ( $ product [ 'images' ] [ $ selected [ 'combination' ] [ 'file_id' ] ] ) ; $ product [ 'images' ] = array ( $ image [ 'file_id' ] => $ image ) + $ product [ 'images' ] ; } }
docstring: Put default selected image on the first position
  @param array $selected
  @param array $product
  @todo Replace with a trait
docstring_tokens: Put default selected image on the first position