original_string: public function replaceNameSuffix($nameSuffix)
      {
          $atoms = $this->nameAtoms();
          if (array('', '') === $atoms) {
              if (null === $nameSuffix) {
                  return $this;
              }
  
              return $this->replaceName(
                  static::EXTENSION_SEPARATOR . $nameSuffix
              );
          }
  
          $numAtoms = count($atoms);
  
          if (null === $nameSuffix) {
              $replacement = array();
          } else {
              $replacement = array($nameSuffix);
          }
          array_splice($atoms, 1, count($atoms), $replacement);
  
          return $this->replaceName(implode(self::EXTENSION_SEPARATOR, $atoms));
      }
code: public function replaceNameSuffix($nameSuffix)
      {
          $atoms = $this->nameAtoms();
          if (array('', '') === $atoms) {
              if (null === $nameSuffix) {
                  return $this;
              }
  
              return $this->replaceName(
                  static::EXTENSION_SEPARATOR . $nameSuffix
              );
          }
  
          $numAtoms = count($atoms);
  
          if (null === $nameSuffix) {
              $replacement = array();
          } else {
              $replacement = array($nameSuffix);
          }
          array_splice($atoms, 1, count($atoms), $replacement);
  
          return $this->replaceName(implode(self::EXTENSION_SEPARATOR, $atoms));
      }
code_tokens: public function replaceNameSuffix ( $ nameSuffix ) { $ atoms = $ this -> nameAtoms ( ) ; if ( array ( '' , '' ) === $ atoms ) { if ( null === $ nameSuffix ) { return $ this ; } return $ this -> replaceName ( static :: EXTENSION_SEPARATOR . $ nameSuffix ) ; } $ numAtoms = count ( $ atoms ) ; if ( null === $ nameSuffix ) { $ replacement = array ( ) ; } else { $ replacement = array ( $ nameSuffix ) ; } array_splice ( $ atoms , 1 , count ( $ atoms ) , $ replacement ) ; return $ this -> replaceName ( implode ( self :: EXTENSION_SEPARATOR , $ atoms ) ) ; }
docstring: Replace all of this path's extensions.
  
  @param string|null $nameSuffix The replacement string, or null to remove all extensions.
  
  @return PathInterface A new path instance with the supplied name suffix replacing the existing one.
docstring_tokens: Replace all of this path s extensions .