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));
    }
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));
    }
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 ) ) ; }
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.
Replace all of this path s extensions .