original_string: protected static function iterateFileName(string $fileName)
      {
          //First remove Extension
          $arrFileParts = explode(".", $fileName);
          $extension = array_pop($arrFileParts);
          $tempFileName = implode(".", $arrFileParts);
          $arrFileName = explode("_", $tempFileName);
          if (is_numeric($arrFileName[(count($arrFileName) - 1)])) {
              $iterator = (int) array_pop($arrFileName);
              $iterator++;
              $arrFileName[] = $iterator;
              $newFileName = implode("_", $arrFileName);
              return $newFileName . "." . $extension;
          }
          return $tempFileName."_1." . $extension;
      }
code: protected static function iterateFileName(string $fileName)
      {
          //First remove Extension
          $arrFileParts = explode(".", $fileName);
          $extension = array_pop($arrFileParts);
          $tempFileName = implode(".", $arrFileParts);
          $arrFileName = explode("_", $tempFileName);
          if (is_numeric($arrFileName[(count($arrFileName) - 1)])) {
              $iterator = (int) array_pop($arrFileName);
              $iterator++;
              $arrFileName[] = $iterator;
              $newFileName = implode("_", $arrFileName);
              return $newFileName . "." . $extension;
          }
          return $tempFileName."_1." . $extension;
      }
code_tokens: protected static function iterateFileName ( string $ fileName ) { //First remove Extension $ arrFileParts = explode ( "." , $ fileName ) ; $ extension = array_pop ( $ arrFileParts ) ; $ tempFileName = implode ( "." , $ arrFileParts ) ; $ arrFileName = explode ( "_" , $ tempFileName ) ; if ( is_numeric ( $ arrFileName [ ( count ( $ arrFileName ) - 1 ) ] ) ) { $ iterator = ( int ) array_pop ( $ arrFileName ) ; $ iterator ++ ; $ arrFileName [ ] = $ iterator ; $ newFileName = implode ( "_" , $ arrFileName ) ; return $ newFileName . "." . $ extension ; } return $ tempFileName . "_1." . $ extension ; }
docstring: Puts a number on the end of a file name, prevents overwriting
  @param string $fileName
  @return string
docstring_tokens: Puts a number on the end of a file name prevents overwriting