Documentation

DescriptorHelper extends Helper
in package

This class adds helper method to describe objects in various formats.

Tags
author

Jean-François Simon contact@jfsimon.fr

Table of Contents

Properties

$helperSet  : mixed
$descriptors  : array<string|int, DescriptorInterface>

Methods

__construct()  : mixed
describe()  : void
Describes an object if supported.
formatMemory()  : string
formatTime()  : string
getFormats()  : array<string|int, mixed>
getHelperSet()  : HelperSet|null
Gets the helper set associated with this helper.
getName()  : string
Returns the canonical name of this helper.
length()  : int
Returns the length of a string, using mb_strlen if it is available.
register()  : $this
Registers a descriptor.
removeDecoration()  : string
setHelperSet()  : void
Sets the helper set associated with this helper.
substr()  : string
Returns the subset of a string, using mb_substr if it is available.
width()  : int
Returns the width of a string, using mb_strwidth if it is available.

Properties

$helperSet

protected mixed $helperSet

Methods

describe()

Describes an object if supported.

public describe(OutputInterface $output, object|null $object[, array<string|int, mixed> $options = [] ]) : void

Available options are:

  • format: string, the output format name
  • raw_text: boolean, sets output type as raw
Parameters
$output : OutputInterface
$object : object|null
$options : array<string|int, mixed> = []
Tags
throws
InvalidArgumentException

when the given format is not supported

formatMemory()

public static formatMemory(int $memory) : string
Parameters
$memory : int
Return values
string

formatTime()

public static formatTime(int|float $secs[, int $precision = 1 ]) : string
Parameters
$secs : int|float
$precision : int = 1
Return values
string

getFormats()

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

getHelperSet()

Gets the helper set associated with this helper.

public getHelperSet() : HelperSet|null
Return values
HelperSet|null

getName()

Returns the canonical name of this helper.

public getName() : string
Return values
string

length()

Returns the length of a string, using mb_strlen if it is available.

public static length(string|null $string) : int

The length is related to how many bytes the string will use.

Parameters
$string : string|null
Return values
int

setHelperSet()

Sets the helper set associated with this helper.

public setHelperSet([HelperSet|null $helperSet = null ]) : void
Parameters
$helperSet : HelperSet|null = null

substr()

Returns the subset of a string, using mb_substr if it is available.

public static substr(string|null $string, int $from[, int|null $length = null ]) : string
Parameters
$string : string|null
$from : int
$length : int|null = null
Return values
string

width()

Returns the width of a string, using mb_strwidth if it is available.

public static width(string|null $string) : int

The width is how many characters positions the string will use.

Parameters
$string : string|null
Return values
int

        
On this page

Search results