IconComponentBuilder
in package
implements
ComponentBuilder
A builder class for icon component.
Interfaces, Classes and Traits
- ComponentBuilder
- The interface that has a responsibility to build component.
Table of Contents
- $aspectRatio : ComponentIconAspectRatio
- $component : array<string|int, mixed>|null
- $margin : ComponentMargin
- $offsetBottom : string
- $offsetEnd : string
- $offsetStart : string
- $offsetTop : string
- $position : string
- $size : ComponentIconSize
- $url : string
- __construct() : mixed
- IconComponentBuilder constructor.
- build() : array<string|int, mixed>
- Builds icon component structure.
- builder() : IconComponentBuilder
- Create empty IconComponentBuilder.
- setAspectRatio() : IconComponentBuilder
- Set aspectRatio.
- setMargin() : IconComponentBuilder
- Set margin.
- setOffsetBottom() : $this
- Set offsetBottom.
- setOffsetEnd() : $this
- Set offsetEnd.
- setOffsetStart() : $this
- Set offsetStart.
- setOffsetTop() : $this
- Set offsetTop.
- setPosition() : $this
- Set position.
- setSize() : IconComponentBuilder
- Set size.
- setUrl() : IconComponentBuilder
- Set url.
Properties
$aspectRatio
private
ComponentIconAspectRatio
$aspectRatio
$component
private
array<string|int, mixed>|null
$component
$margin
private
ComponentMargin
$margin
$offsetBottom
private
string
$offsetBottom
$offsetEnd
private
string
$offsetEnd
$offsetStart
private
string
$offsetStart
$offsetTop
private
string
$offsetTop
$position
private
string
$position
$size
private
ComponentIconSize
$size
$url
private
string
$url
Methods
__construct()
IconComponentBuilder constructor.
public
__construct(string|null $url[, ComponentMargin|null $margin = null ][, ComponentIconSize|string|null $size = null ][, ComponentIconAspectRatio|null $aspectRatio = null ]) : mixed
Parameters
- $url : string|null
- $margin : ComponentMargin|null = null
- $size : ComponentIconSize|string|null = null
- $aspectRatio : ComponentIconAspectRatio|null = null
Return values
mixed —build()
Builds icon component structure.
public
build() : array<string|int, mixed>
Return values
array<string|int, mixed> —builder()
Create empty IconComponentBuilder.
public
static builder() : IconComponentBuilder
Return values
IconComponentBuilder —setAspectRatio()
Set aspectRatio.
public
setAspectRatio(ComponentIconAspectRatio|string|null $aspectRatio) : IconComponentBuilder
Parameters
- $aspectRatio : ComponentIconAspectRatio|string|null
Return values
IconComponentBuilder —setMargin()
Set margin.
public
setMargin(ComponentMargin|string|null $margin) : IconComponentBuilder
Parameters
- $margin : ComponentMargin|string|null
Return values
IconComponentBuilder —setOffsetBottom()
Set offsetBottom.
public
setOffsetBottom(string|ComponentSpacing|null $offsetBottom) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetBottom : string|ComponentSpacing|null
Return values
$this —setOffsetEnd()
Set offsetEnd.
public
setOffsetEnd(string|ComponentSpacing|null $offsetEnd) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetEnd : string|ComponentSpacing|null
Return values
$this —setOffsetStart()
Set offsetStart.
public
setOffsetStart(string|ComponentSpacing|null $offsetStart) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetStart : string|ComponentSpacing|null
Return values
$this —setOffsetTop()
Set offsetTop.
public
setOffsetTop(string|ComponentSpacing|null $offsetTop) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetTop : string|ComponentSpacing|null
Return values
$this —setPosition()
Set position.
public
setPosition(string|ComponentPosition|null $position) : $this
specifiable relative or absolute
Parameters
- $position : string|ComponentPosition|null
Return values
$this —setSize()
Set size.
public
setSize(ComponentIconSize|string|null $size) : IconComponentBuilder
specifiable pixel and keyword. (e.g. pixel: 5px keyword: xxs (defined in ComponentIconSize)
Parameters
- $size : ComponentIconSize|string|null
Return values
IconComponentBuilder —setUrl()
Set url.
public
setUrl(string $url) : IconComponentBuilder
Parameters
- $url : string