src/ImageOptimizer.php
private function getFileExtensionFromFilepath($filepath)
    {
        $fileExtension = pathinfo($filepath, PATHINFO_EXTENSION);

        if (empty($fileExtension)) {
            throw new \Exception('File extension not found');
        }

        return $fileExtension;
    }
private function getFileExtensionFromFilepath($filepath)
    {
        $fileExtension = pathinfo($filepath, PATHINFO_EXTENSION);

        if (empty($fileExtension)) {
            throw new \Exception('File extension not found');
        }

        return $fileExtension;
    }
private function getFileExtensionFromFilepath ( $ filepath ) { $ fileExtension = pathinfo ( $ filepath , PATHINFO_EXTENSION ) ; if ( empty ( $ fileExtension ) ) { throw new \ Exception ( 'File extension not found' ) ; } return $ fileExtension ; }
Get extension from a file.

@param $filepath

@throws \Exception

@return string
Get extension from a file .