Dimension
Defines the canonical keys of a two-dimensional size pair.
Using these constants instead of the raw 'width' / 'height' magic strings
keeps producers and consumers of a dimension pair in sync — for instance the
array{width:int,height:int} returned by aspectFit().
Tags
Table of Contents
Constants
- HEIGHT : string = 'height'
- The vertical extent (height) key.
- WIDTH : string = 'width'
- The horizontal extent (width) key.
Methods
- all() : array<string|int, string>
- Returns the list of valid dimension keys.
- isValid() : bool
- Checks if a given value is a valid dimension key.
Constants
HEIGHT
The vertical extent (height) key.
public
string
HEIGHT
= 'height'
Type: string
WIDTH
The horizontal extent (width) key.
public
string
WIDTH
= 'width'
Type: string
Methods
all()
Returns the list of valid dimension keys.
public
static all() : array<string|int, string>
Return values
array<string|int, string>isValid()
Checks if a given value is a valid dimension key.
public
static isValid(string $value) : bool
Parameters
- $value : string