LINE Messaging API SDK for PHP

TextComponentBuilder implements ComponentBuilder

A builder class for text component.

Tags
SuppressWarnings

(PHPMD.ExcessiveParameterList)

Interfaces, Classes and Traits

ComponentBuilder
The interface that has a responsibility to build component.

Table of Contents

$actionBuilder  : TemplateActionBuilder
$adjustMode  : ComponentAdjustMode
$align  : ComponentAlign
$color  : string
$component  : array<string|int, mixed>|null
$contents  : array<string|int, mixed>|null
$decoration  : ComponentTextDecoration
$flex  : int
$gravity  : ComponentGravity
$lineSpacing  : string
$margin  : ComponentMargin
$maxLines  : int
$offsetBottom  : string
$offsetEnd  : string
$offsetStart  : string
$offsetTop  : string
$position  : string
$size  : ComponentFontSize
$style  : ComponentTextStyle
$text  : string
$weight  : ComponentFontWeight
$wrap  : bool
__construct()  : mixed
TextComponentBuilder constructor.
build()  : array<string|int, mixed>
Builds text component structure.
builder()  : TextComponentBuilder
Create empty TextComponentBuilder.
setAction()  : TextComponentBuilder
Set action.
setAdjustMode()  : $this
Set adjustMode
setAlign()  : TextComponentBuilder
Set align.
setColor()  : TextComponentBuilder
Set color.
setContents()  : $this
Set contents.
setDecoration()  : TextComponentBuilder
Set decoration.
setFlex()  : TextComponentBuilder
Set flex.
setGravity()  : TextComponentBuilder
Set gravity.
setLineSpacing()  : TextComponentBuilder
Set lineSpacing.
setMargin()  : TextComponentBuilder
Set margin.
setMaxLines()  : TextComponentBuilder
Set maxLines.
setOffsetBottom()  : $this
Set offsetBottom.
setOffsetEnd()  : $this
Set offsetEnd.
setOffsetStart()  : $this
Set offsetStart.
setOffsetTop()  : $this
Set offsetTop.
setPosition()  : $this
Set position.
setSize()  : TextComponentBuilder
Set size.
setStyle()  : TextComponentBuilder
Set style.
setText()  : TextComponentBuilder
Set text.
setWeight()  : TextComponentBuilder
Set weight.
setWrap()  : TextComponentBuilder
Set wrap.

Properties

Methods

__construct()

TextComponentBuilder constructor.

public __construct(string|null $text[, int|null $flex = null ][, ComponentMargin|null $margin = null ][, ComponentFontSize|null $size = null ][, ComponentAlign|null $align = null ][, ComponentGravity|null $gravity = null ][, bool|null $wrap = null ][, int|null $maxLines = null ][, ComponentFontWeight|null $weight = null ][, string|null $color = null ][, TemplateActionBuilder|null $actionBuilder = null ][, string|null $lineSpacing = null ]) : mixed
Parameters
$text : string|null
$flex : int|null = null
$margin : ComponentMargin|null = null
$size : ComponentFontSize|null = null
$align : ComponentAlign|null = null
$gravity : ComponentGravity|null = null
$wrap : bool|null = null
$maxLines : int|null = null
$weight : ComponentFontWeight|null = null
$color : string|null = null
$actionBuilder : TemplateActionBuilder|null = null
$lineSpacing : string|null = null
Return values
mixed

build()

Builds text component structure.

public build() : array<string|int, mixed>
Return values
array<string|int, mixed>

setContents()

Set contents.

public setContents(array<string|int, mixed>|null $contents) : $this
Parameters
$contents : array<string|int, mixed>|null

array of SpanComponentBuilder

Return values
$this

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

Search results