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()  : mixed
Describes an object if supported.
formatMemory()  : mixed
formatTime()  : mixed
getHelperSet()  : HelperSet
Gets the helper set associated with this helper.
getName()  : string
Returns the canonical name of this helper.
register()  : $this
Registers a descriptor.
removeDecoration()  : mixed
setHelperSet()  : mixed
Sets the helper set associated with this helper.
strlen()  : int
Returns the length of a string, using mb_strwidth if it is available.
strlenWithoutDecoration()  : mixed
substr()  : string
Returns the subset of a string, using mb_substr if it is available.

Properties

$helperSet

protected mixed $helperSet = null

Methods

describe()

Describes an object if supported.

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

Available options are:

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

when the given format is not supported

formatMemory()

public static formatMemory(mixed $memory) : mixed
Parameters
$memory : mixed

formatTime()

public static formatTime(mixed $secs) : mixed
Parameters
$secs : mixed

getHelperSet()

Gets the helper set associated with this helper.

public getHelperSet() : HelperSet
Return values
HelperSet

A HelperSet instance

getName()

Returns the canonical name of this helper.

public getName() : string
Return values
string

The canonical name

setHelperSet()

Sets the helper set associated with this helper.

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

strlen()

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

public static strlen(string $string) : int
Parameters
$string : string

The string to check its length

Return values
int

The length of the string

substr()

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

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

String to subset

$from : int

Start offset

$length : int|null = null

Length to read

Return values
string

The string subset


        
On this page

Search results