protected function filterExtension(string $extension): string
    {
        $extension = $this->filterString($extension);
        if (0 === strpos($extension, '.') || false !== strpos($extension, '/')) {
            throw new Exception(
                'extension must be string sequence without a leading `.` and the path separator `/` characters'
            );
        }

        return trim($extension);
    }
protected function filterExtension(string $extension): string
    {
        $extension = $this->filterString($extension);
        if (0 === strpos($extension, '.') || false !== strpos($extension, '/')) {
            throw new Exception(
                'extension must be string sequence without a leading `.` and the path separator `/` characters'
            );
        }

        return trim($extension);
    }
protected function filterExtension ( string $ extension ) : string { $ extension = $ this -> filterString ( $ extension ) ; if ( 0 === strpos ( $ extension , '.' ) || false !== strpos ( $ extension , '/' ) ) { throw new Exception ( 'extension must be string sequence without a leading `.` and the path separator `/` characters' ) ; } return trim ( $ extension ) ; }
filter and validate the extension to use

@param string $extension

@throws Exception if the extension is not valid

@return string
filter and validate the extension to use