Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Class: FileUtils

Namespace: utils

Methods

Retorna o mime baseado no caminho do arquivo.

@param string $filePath caminho do arquivo

@return string mime do arquivo

@throws \InvalidArgumentException

public static function getMimeFromPath(string $filePath): string

Parameters:

  • $filePath (string)

Retorna a extensão baseado no mime do arquivo.

@param string $mimeType mime do arquivo

@return string extensão do arquivo

public static function getExtensionFromMime(string $mimeType): string

Parameters:

  • $mimeType (string)

Retorna a extensão baseado no path do arquivo.

@param string $filePath caminho do arquivo

@return string extensão do arquivo

@throws \InvalidArgumentException

public static function getExtensionFromPath(string $filePath): string

Parameters:

  • $filePath (string)

Verifica se o arquivo ja possui extensão em seu nome.

public static function nameHasExtension(string $fileName): bool

Parameters:

  • $fileName (string)