ByteSize
in package
Main component class
Tags
Table of Contents
Properties
Methods
- __construct() : void
- Class constructor.
- format() : string
- Proxy method for the formatter's format() method.
- formatBinary() : string
- Static proxy to the binary formatter's format() method.
- formatMetric() : string
- Static proxy to the metric formatter's format() method.
Properties
$formatter
protected
FormatterInterface
$formatter
Methods
__construct()
Class constructor.
public
__construct([FormatterInterface $formatter = null ]) : void
Parameters
- $formatter : FormatterInterface = null
format()
Proxy method for the formatter's format() method.
public
format(int|string $bytes[, int $precision = null ]) : string
Parameters
- $bytes : int|string
-
Integer or string representing the number of bytes.
- $precision : int = null
-
Number of significant digits to include in the formatted output.
Return values
string —Returns a human-friendly formatted string.
formatBinary()
Static proxy to the binary formatter's format() method.
public
static formatBinary(int|string $bytes[, int $precision = null ]) : string
Parameters
- $bytes : int|string
-
Integer or string representing the number of bytes.
- $precision : int = null
-
Number of significant digits to include in the formatted output.
Tags
Return values
string —Returns a human-friendly formatted string.
formatMetric()
Static proxy to the metric formatter's format() method.
public
static formatMetric(int|string $bytes[, int $precision = null ]) : string
Parameters
- $bytes : int|string
-
Integer or string representing the number of bytes.
- $precision : int = null
-
Number of significant digits to include in the formatted output.
Tags
Return values
string —Returns a human-friendly formatted string.