\Symfony\Component\HttpFoundation\Tests\FileFakeFile

A file in the file system.

Summary

Methods
Properties
Constants
__construct()
guessExtension()
getMimeType()
move()
isReadable()
getRealpath()
getSize()
getMTime()
No public properties found
No constants found
getTargetFile()
getName()
No protected properties found
N/A
No private methods found
$realpath
N/A

Properties

$realpath

$realpath : 

Type

Methods

__construct()

__construct(  $realpath, string  $path) 

Constructs a new file from the given path.

Parameters

$realpath
string $path

The path to the file

guessExtension()

guessExtension() : string|null

Returns the extension based on the mime type.

If the mime type is unknown, returns null.

This method uses the mime type as guessed by getMimeType() to guess the file extension.

Returns

string|null —

The guessed extension or null if it cannot be guessed

getMimeType()

getMimeType() : string|null

Returns the mime type of the file.

The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), mime_content_type() and the system binary "file" (in this order), depending on which of those are available.

Returns

string|null —

The guessed mime type (e.g. "application/pdf")

move()

move(string  $directory, string  $name = null) : self

Moves the file to a new location.

Parameters

string $directory

The destination folder

string $name

The new file name

Throws

\Symfony\Component\HttpFoundation\File\Exception\FileException

if the target file could not be created

Returns

self —

A File object representing the new file

isReadable()

isReadable() 

getRealpath()

getRealpath() 

getSize()

getSize() 

getMTime()

getMTime() 

getTargetFile()

getTargetFile(  $directory,   $name = null) 

Parameters

$directory
$name

getName()

getName(string  $name) : string

Returns locale independent base name of the given path.

Parameters

string $name

The new file name

Returns

string —

containing