Dimension
in package
Table of Contents
Constants
- ABSOLUTE_UNITS = [self::UOM_CENTIMETERS => 96.0 / 2.54, self::UOM_MILLIMETERS => 96.0 / 25.4, self::UOM_INCHES => 96.0, self::UOM_PIXELS => 1.0, self::UOM_POINTS => 96.0 / 72, self::UOM_PICA => 96.0 * 12 / 72]
- Based on 96 dpi.
- RELATIVE_UNITS = ['em' => 10.0 / 8.539999999999999, 'ex' => 10.0 / 8.539999999999999, 'ch' => 10.0 / 8.539999999999999, 'rem' => 10.0 / 8.539999999999999, 'vw' => 8.539999999999999, 'vh' => 8.539999999999999, 'vmin' => 8.539999999999999, 'vmax' => 8.539999999999999, '%' => 8.539999999999999 / 100]
- Based on a standard column width of 8.54 units in MS Excel.
- UOM_CENTIMETERS = 'cm'
- UOM_INCHES = 'in'
- UOM_MILLIMETERS = 'mm'
- UOM_PICA = 'pc'
- UOM_PIXELS = 'px'
- UOM_POINTS = 'pt'
Properties
Methods
- __construct() : mixed
- height() : float
- toUnit() : float
- width() : float
- stanBugFixed() : array<string|int, mixed>
- Phpstan bug has been fixed; this function allows us to pass Phpstan whether fixed or not.
Constants
ABSOLUTE_UNITS
Based on 96 dpi.
public
mixed
ABSOLUTE_UNITS
= [self::UOM_CENTIMETERS => 96.0 / 2.54, self::UOM_MILLIMETERS => 96.0 / 25.4, self::UOM_INCHES => 96.0, self::UOM_PIXELS => 1.0, self::UOM_POINTS => 96.0 / 72, self::UOM_PICA => 96.0 * 12 / 72]
RELATIVE_UNITS
Based on a standard column width of 8.54 units in MS Excel.
public
mixed
RELATIVE_UNITS
= ['em' => 10.0 / 8.539999999999999, 'ex' => 10.0 / 8.539999999999999, 'ch' => 10.0 / 8.539999999999999, 'rem' => 10.0 / 8.539999999999999, 'vw' => 8.539999999999999, 'vh' => 8.539999999999999, 'vmin' => 8.539999999999999, 'vmax' => 8.539999999999999, '%' => 8.539999999999999 / 100]
UOM_CENTIMETERS
public
mixed
UOM_CENTIMETERS
= 'cm'
UOM_INCHES
public
mixed
UOM_INCHES
= 'in'
UOM_MILLIMETERS
public
mixed
UOM_MILLIMETERS
= 'mm'
UOM_PICA
public
mixed
UOM_PICA
= 'pc'
UOM_PIXELS
public
mixed
UOM_PIXELS
= 'px'
UOM_POINTS
public
mixed
UOM_POINTS
= 'pt'
Properties
$size
protected
float|int
$size
If this is a width, then size is measured in pixels (if is set) or in Excel's default column width units if $unit is null. If this is a height, then size is measured in pixels () or in points () if $unit is null.
$unit
protected
string|null
$unit
= null
Methods
__construct()
public
__construct(string $dimension) : mixed
Parameters
- $dimension : string
height()
public
height() : float
Return values
floattoUnit()
public
toUnit(string $unitOfMeasure) : float
Parameters
- $unitOfMeasure : string
Return values
floatwidth()
public
width() : float
Return values
floatstanBugFixed()
Phpstan bug has been fixed; this function allows us to pass Phpstan whether fixed or not.
private
static stanBugFixed(array<string|int, mixed>|int|null $value) : array<string|int, mixed>
Parameters
- $value : array<string|int, mixed>|int|null