src/Source.php
public function changeExtension($rename)
    {
        $search = '';
        $replace = '';

        if (is_array($rename)) {
            $search = key($rename);
            $replace = current($rename);
        }

        if (is_string($rename)) {
            $search = pathinfo($this->outputPathname, PATHINFO_EXTENSION);
            $replace = $rename;
        }

        $this->outputPathname = preg_replace("#$search\$#", $replace, $this->outputPathname);

        return $this;
    }
public function changeExtension($rename)
    {
        $search = '';
        $replace = '';

        if (is_array($rename)) {
            $search = key($rename);
            $replace = current($rename);
        }

        if (is_string($rename)) {
            $search = pathinfo($this->outputPathname, PATHINFO_EXTENSION);
            $replace = $rename;
        }

        $this->outputPathname = preg_replace("#$search\$#", $replace, $this->outputPathname);

        return $this;
    }
public function changeExtension ( $ rename ) { $ search = '' ; $ replace = '' ; if ( is_array ( $ rename ) ) { $ search = key ( $ rename ) ; $ replace = current ( $ rename ) ; } if ( is_string ( $ rename ) ) { $ search = pathinfo ( $ this -> outputPathname , PATHINFO_EXTENSION ) ; $ replace = $ rename ; } $ this -> outputPathname = preg_replace ( "#$search\$#" , $ replace , $ this -> outputPathname ) ; return $ this ; }
Change the extension of the output pathname.

@param array|string|null $rename
@return $this
Change the extension of the output pathname .