public function replaceName($name)
    {
        $atoms = $this->atoms();
        $numAtoms = count($atoms);

        if ($numAtoms > 0) {
            if ('' === $name) {
                array_pop($atoms);
            } else {
                $atoms[$numAtoms - 1] = $name;
            }
        } elseif ('' !== $name) {
            $atoms[] = $name;
        }

        return $this->createPath(
            $atoms,
            $this instanceof AbsolutePathInterface,
            false
        );
    }
public function replaceName($name)
    {
        $atoms = $this->atoms();
        $numAtoms = count($atoms);

        if ($numAtoms > 0) {
            if ('' === $name) {
                array_pop($atoms);
            } else {
                $atoms[$numAtoms - 1] = $name;
            }
        } elseif ('' !== $name) {
            $atoms[] = $name;
        }

        return $this->createPath(
            $atoms,
            $this instanceof AbsolutePathInterface,
            false
        );
    }
public function replaceName ( $ name ) { $ atoms = $ this -> atoms ( ) ; $ numAtoms = count ( $ atoms ) ; if ( $ numAtoms > 0 ) { if ( '' === $ name ) { array_pop ( $ atoms ) ; } else { $ atoms [ $ numAtoms - 1 ] = $ name ; } } elseif ( '' !== $ name ) { $ atoms [ ] = $ name ; } return $ this -> createPath ( $ atoms , $ this instanceof AbsolutePathInterface , false ) ; }
Replace this path's name.

@param string $name The new path name.

@return PathInterface A new path instance with the supplied name replacing the existing one.
Replace this path s name .