Documentation

Size extends UploadingFile

Class Size

Tags
subpackage

FileValidators

author

Dodonov A.A.

version

v.1.0 (2020/05/13)

copyright

Copyright (c) 2020, aeon.org

Table of Contents

GB  = 1073741824
Bytes in GB
KB  = 1024
Bytes in KB
MB  = 1048576
Bytes in MB
$file  : string
Index in the $_FILES array
$requiredSize  : int
Required size in bytes
__construct()  : mixed
Constructor
getKey()  : string
Getter for the field $this->file
setValidatingData()  : void
{@inheritdoc}
valid()  : bool
{@inheritdoc}
validateFilesFieldExists()  : void
Method validates that $_FILES[$field] exists.

Constants

GB

Bytes in GB

public int GB = 1073741824

KB

Bytes in KB

public int KB = 1024

MB

Bytes in MB

public int MB = 1048576

Properties

$requiredSize

Required size in bytes

private int $requiredSize = 0

Methods

__construct()

Constructor

public __construct(int $size) : mixed
Parameters
$size : int

size constraint for the file

Tags
codeCoverageIgnore
Return values
mixed

getKey()

Getter for the field $this->file

public getKey() : string
Return values
string

field $this->file

validateFilesFieldExists()

Method validates that $_FILES[$field] exists.

public validateFilesFieldExists(string $field) : void

If it does not then exception will be thrown

Parameters
$field : string

field name

Return values
void

Search results

    Яндекс.Метрика