protected static function getFileTypeByExtension(string $extension): int
    {
        switch ($extension) {
            case 'png':
            case 'jpg':
                return FileInterface::TYPE_STATIC_IMAGE;

            case 'gif':
                return FileInterface::TYPE_ANIMATED_IMAGE;

            case 'webm':
            case 'mp4':
            case 'zip':
                return FileInterface::TYPE_VIDEO;

            default:
                throw new InvalidArgumentException(sprintf(
                    'Unknown file type: %s',
                    $extension
                ));
        }
    }