\app\framework\Component\StopwatchSection

Stopwatch section.

Summary

Methods
Properties
Constants
__construct()
get()
open()
getId()
setId()
startEvent()
isEventStarted()
stopEvent()
lap()
getEvent()
getEvents()
No public properties found
No constants found
serialize()
unserialize()
No protected properties found
N/A
No private methods found
$events
$origin
$id
$children
N/A

Properties

$origin

$origin : null|float

Type

null|float

$id

$id : string

Type

string

Methods

__construct()

__construct(float|null  $origin = null) 

Constructor.

Parameters

float|null $origin

Set the origin of the events in this section, use null to set their origin to their start time

get()

get(string  $id) : self|null

Returns the child section.

Parameters

string $id

The child section identifier

Returns

self|null —

The child section or null when none found

open()

open(string|null  $id) : self

Creates or re-opens a child section.

Parameters

string|null $id

null to create a new section, the identifier to re-open an existing one

Returns

self

getId()

getId() : string

Returns

string —

The identifier of the section

setId()

setId(string  $id) : $this

Sets the session identifier.

Parameters

string $id

The session identifier

Returns

$this

startEvent()

startEvent(string  $name, string  $category) : \app\framework\Component\Stopwatch\StopwatchEvent

Starts an event.

Parameters

string $name

The event name

string $category

The event category

Returns

\app\framework\Component\Stopwatch\StopwatchEvent

The event

isEventStarted()

isEventStarted(string  $name) : boolean

Checks if the event was started.

Parameters

string $name

The event name

Returns

boolean

lap()

lap(string  $name) : \app\framework\Component\Stopwatch\StopwatchEvent

Stops then restarts an event.

Parameters

string $name

The event name

Throws

\LogicException

When the event has not been started

Returns

\app\framework\Component\Stopwatch\StopwatchEvent

The event

serialize()

serialize(  $value) : string

Serializes the given value.

Parameters

$value

Returns

string

unserialize()

unserialize(string  $string) : array|mixed

Unserializes the given string and returns the array.

Parameters

string $string

String to serialize.

Returns

array|mixed