Documentation

SecurityRules
in package

Security rules class

Tags
author

Dodonov A.A.

Table of Contents

getFileValue()  : string|array<string|int, mixed>
Method returns file value
getIntValue()  : int
Returning int value
getStringValue()  : string
Returning string value
isUploadedFileValid()  : bool
Method validates uploaded file
storeFile()  : string
Method stores file on disk
storeFileContent()  : string
Method stores file on disk
moveUploadedFile()  : void
Method stores uploaded file
prepareFs()  : string
Method prepares file system for saving file

Methods

getFileValue()

Method returns file value

public getFileValue(string|array<string|int, mixed> $value, bool $storeFiles[, string $pathPrefix = '.' ]) : string|array<string|int, mixed>
Parameters
$value : string|array<string|int, mixed>

data about the uploaded file

$storeFiles : bool

Must be the file stored in the file system of the service or not

$pathPrefix : string = '.'

prefix of the file path

Return values
string|array<string|int, mixed>

path to the stored file or the array $value itself

getIntValue()

Returning int value

public getIntValue(mixed $value) : int
Parameters
$value : mixed

value to be made secure

Return values
int

secure value

getStringValue()

Returning string value

public getStringValue(mixed $value) : string
Parameters
$value : mixed

value to be made secure

Return values
string

secure value

isUploadedFileValid()

Method validates uploaded file

public isUploadedFileValid(string $fieldName[, array<string|int, ValidatorInterface$validators = [] ]) : bool
Parameters
$fieldName : string

field in the $_FILES array

$validators : array<string|int, ValidatorInterface> = []

list of validators

Return values
bool

true if the file valid and false otherwise.

storeFile()

Method stores file on disk

public storeFile(string $filePath, string $pathPrefix[, bool $decoded = false ]) : string
Parameters
$filePath : string

path to the saving file

$pathPrefix : string

prefix to file

$decoded : bool = false

if the file was not encodded in base64

Return values
string

Path to file or null if the image was not loaded

storeFileContent()

Method stores file on disk

public storeFileContent(string $fileContent, string $pathPrefix[, bool $decoded = false ]) : string
Parameters
$fileContent : string

content of the saving file

$pathPrefix : string

prefix to file

$decoded : bool = false

if the file was not encodded in base64

Return values
string

Path to file

moveUploadedFile()

Method stores uploaded file

private moveUploadedFile(string $from, string $to) : void
Parameters
$from : string

path to the uploaded file

$to : string

destination file path

Tags
codeCoverageIgnore
Return values
void

prepareFs()

Method prepares file system for saving file

private prepareFs(string $pathPrefix) : string
Parameters
$pathPrefix : string

prefix to file path

Return values
string

file path

Search results