Methods

__construct()

__construct(array $options) 

Parameters

$options

array

Invoke filter as a command

__invoke(mixed $value) : mixed
Inherited

Proxies to filter()

inherited_from \Zend\Filter\AbstractFilter::__invoke()

Parameters

$value

mixed

Exceptions

\Zend\Filter\Exception\ExceptionInterface If filtering $value is impossible

Returns

mixed

Defined by Zend\Filter\FilterInterface

filter(string $value) : string | mixed

Returns a human readable format of the amount of bits or bytes.

If the value provided is not numeric, the value will remain unfiltered

Parameters

$value

string

Exceptions

\Zend\Filter\Exception\RuntimeException If filtering $value is impossible

Returns

stringmixed

Retrieve options representing object state

getOptions() : array
Inherited

inherited_from \Zend\Filter\AbstractFilter::getOptions()

Returns

array

hasPcreUnicodeSupport()

hasPcreUnicodeSupport() : bool
Inherited

inherited_from \Zend\Filter\AbstractFilter::hasPcreUnicodeSupport()

Returns

bool

setOptions()

setOptions(array | \Traversable $options) : \Zend\Filter\self
Inherited

inherited_from \Zend\Filter\AbstractFilter::setOptions()

Parameters

$options

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\self

formatAmount()

formatAmount($amount, null $prefix) : string

Parameters

$amount

$prefix

null

Returns

string

Get current filter mode

getMode() : string

Returns

string

Get the precision of the filtered result.

getPrecision() : int

Returns

int

Find the prefix at a specific location in the prefixes array.

getPrefixAt($index) : string | null

Parameters

$index

Returns

stringnull

Get the predefined prefixes or use the build-in standardized lists of prefixes.

getPrefixes() : array

Returns

array

Get current filter type

getUnit() : string

Returns

string

Find out if the filter is in binary mode.

isBinaryMode() : bool

Returns

bool

Find out if the filter is in decimal mode.

isDecimalMode() : bool

Returns

bool

isOptions()

isOptions(mixed $options) : bool
Inherited

inherited_from \Zend\Filter\AbstractFilter::isOptions()

Parameters

$options

mixed

Returns

bool

Define the mode of the filter.

setMode(string $mode) 

Possible values can be fount at self::$modes.

Parameters

$mode

string

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Set the precision of the filtered result.

setPrecision($precision) 

Parameters

$precision

Set the precision of the result.

setPrefixes(array $prefixes) 

Parameters

$prefixes

array

Define the unit of the filter.

setUnit(string $unit) 

Possible values can be fount at self::$types.

Parameters

$unit

string

 Properties

 

Default options:

$options : array

 

A list of all possible filter modes:

$modes : array

 

A list of standardized binary prefix formats for decimal and binary mode

$standardizedPrefixes : array

 Constants

 

BASE_BINARY

BASE_BINARY 

 

BASE_DECIMAL

BASE_DECIMAL 

 

MODE_BINARY

MODE_BINARY 

 

MODE_DECIMAL

MODE_DECIMAL