protected function addFileExtension(string $path): string
    {
        $extension = pathinfo($path, PATHINFO_EXTENSION);
        if (empty($extension)) {
            $path .= $this->extension;
        }

        return $path;
    }
protected function addFileExtension(string $path): string
    {
        $extension = pathinfo($path, PATHINFO_EXTENSION);
        if (empty($extension)) {
            $path .= $this->extension;
        }

        return $path;
    }
protected function addFileExtension ( string $ path ) : string { $ extension = pathinfo ( $ path , PATHINFO_EXTENSION ) ; if ( empty ( $ extension ) ) { $ path .= $ this -> extension ; } return $ path ; }
Add default extension if path doesn't have one

Check if the given path has a file exntesion.
If not, add the default one and return the
modified path.

@param string $path Path
@return string
Add default extension if path doesn t have one