Menu

## SpanComponentBuilder
in package
implements ComponentBuilder

SpanComponentBuilder.php : 35

A builder class for span component.

##### Tags

SuppressWarnings

  (PHPMD.ExcessiveParameterList)

### Interfaces, Classes and Traits

ComponentBuilder
  The interface that has a responsibility to build component.

### Table of Contents

$color : string
$decoration : ComponentTextDecoration
$size : ComponentFontSize
$style : ComponentTextStyle
$text : string
$weight : ComponentFontWeight
__construct() : mixed
build() : array<string|int, mixed>
  Builds component structure.
builder() : SpanComponentBuilder
  Create empty SpanComponentBuilder.
setColor() : SpanComponentBuilder
  Set color.
setDecoration() : SpanComponentBuilder
  Set decoration.
setSize() : SpanComponentBuilder
  Set size.
setStyle() : SpanComponentBuilder
  Set style.
setText() : SpanComponentBuilder
  Set text.
setWeight() : SpanComponentBuilder
  Set weight.

### Properties

#### $color

SpanComponentBuilder.php : 42
`private string $color`

#### $decoration

SpanComponentBuilder.php : 48
`private ComponentTextDecoration $decoration`

#### $size

SpanComponentBuilder.php : 40
`private ComponentFontSize $size`

#### $style

SpanComponentBuilder.php : 46
`private ComponentTextStyle $style`

#### $text

SpanComponentBuilder.php : 38
`private string $text`

#### $weight

SpanComponentBuilder.php : 44
`private ComponentFontWeight $weight`

### Methods

#### __construct()

SpanComponentBuilder.php : 50
`public __construct(mixed $text[, mixed $size = null ][, mixed $color = null ][, mixed $weight = null ][, mixed $style = null ][, mixed $decoration = null ]) : mixed`

##### Parameters

$text : mixed
$size : mixed = null
$color : mixed = null
$weight : mixed = null
$style : mixed = null
$decoration : mixed = null

##### Return values

mixed —

#### build()

SpanComponentBuilder.php : 153

Builds component structure.

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

##### Return values

array<string|int, mixed> —

#### builder()

SpanComponentBuilder.php : 71

Create empty SpanComponentBuilder.

`public static builder() : SpanComponentBuilder`

##### Return values

SpanComponentBuilder —

#### setColor()

SpanComponentBuilder.php : 123

Set color.

`public setColor(string|null $color) : SpanComponentBuilder`

##### Parameters

$color : string|null

##### Return values

SpanComponentBuilder —

#### setDecoration()

SpanComponentBuilder.php : 147

Set decoration.

`public setDecoration(ComponentTextDecoration|string|null $decoration) : SpanComponentBuilder`

##### Parameters

$decoration : ComponentTextDecoration|string|null

##### Return values

SpanComponentBuilder —

#### setSize()

SpanComponentBuilder.php : 99

Set size.

`public setSize(ComponentFontSize|string|null $size) : SpanComponentBuilder`

specifiable pixel and keyword. (e.g. pixel: 5px keyword: xxs (defined in ComponentFontSize)

##### Parameters

$size : ComponentFontSize|string|null

##### Return values

SpanComponentBuilder —

#### setStyle()

SpanComponentBuilder.php : 135

Set style.

`public setStyle(ComponentTextStyle|string|null $style) : SpanComponentBuilder`

##### Parameters

$style : ComponentTextStyle|string|null

##### Return values

SpanComponentBuilder —

#### setText()

SpanComponentBuilder.php : 82

Set text.

`public setText(string $text) : SpanComponentBuilder`

##### Parameters

$text : string

##### Return values

SpanComponentBuilder —

#### setWeight()

SpanComponentBuilder.php : 111

Set weight.

`public setWeight(ComponentFontWeight|string|null $weight) : SpanComponentBuilder`

##### Parameters

$weight : ComponentFontWeight|string|null

##### Return values

SpanComponentBuilder —

## Search results