Toolbar
in package
Displays a toolbar with bits of stats to aid a developer in debugging.
Inspiration: http://prophiler.fabfuel.de
Table of Contents
Properties
- $collectors : array<int, BaseCollector>
- Collectors to be used and displayed.
- $config : Toolbar
- Toolbar configuration settings.
Methods
- __construct() : mixed
- prepare() : void
- Prepare for debugging.
- respond() : void
- Inject debug toolbar into the response.
- run() : string
- Returns all the data required by Debug Bar
- collectTimelineData() : array<string|int, mixed>
- Returns a sorted array of timeline data arrays from the collectors.
- collectVarData() : array<string|int, mixed>
- Returns an array of data from all of the modules that should be displayed in the 'Vars' tab.
- format() : string
- Format output
- renderTimeline() : string
- Called within the view to display the timeline itself.
- renderTimelineRecursive() : string
- Recursively renders timeline elements and their children.
- roundTo() : float
- Rounds a number to the nearest incremental value.
- structureTimelineData() : array<string|int, mixed>
- Arranges the already sorted timeline data into a parent => child structure.
Properties
$collectors
Collectors to be used and displayed.
protected
array<int, BaseCollector>
$collectors
= []
$config
Toolbar configuration settings.
protected
Toolbar
$config
Methods
__construct()
public
__construct(Toolbar $config) : mixed
Parameters
- $config : Toolbar
prepare()
Prepare for debugging.
public
prepare([RequestInterface|null $request = null ][, ResponseInterface|null $response = null ]) : void
Parameters
- $request : RequestInterface|null = null
- $response : ResponseInterface|null = null
respond()
Inject debug toolbar into the response.
public
respond() : void
Tags
run()
Returns all the data required by Debug Bar
public
run(float $startTime, float $totalTime, IncomingRequest $request, ResponseInterface $response) : string
Parameters
- $startTime : float
-
App start time
- $totalTime : float
- $request : IncomingRequest
- $response : ResponseInterface
Return values
string —JSON encoded data
collectTimelineData()
Returns a sorted array of timeline data arrays from the collectors.
protected
collectTimelineData(array<string|int, mixed> $collectors) : array<string|int, mixed>
Parameters
- $collectors : array<string|int, mixed>
Return values
array<string|int, mixed>collectVarData()
Returns an array of data from all of the modules that should be displayed in the 'Vars' tab.
protected
collectVarData() : array<string|int, mixed>
Return values
array<string|int, mixed>format()
Format output
protected
format(string $data[, string $format = 'html' ]) : string
Parameters
- $data : string
- $format : string = 'html'
Return values
stringrenderTimeline()
Called within the view to display the timeline itself.
protected
renderTimeline(array<string|int, mixed> $collectors, float $startTime, int $segmentCount, int $segmentDuration, array<string|int, mixed> &$styles) : string
Parameters
- $collectors : array<string|int, mixed>
- $startTime : float
- $segmentCount : int
- $segmentDuration : int
- $styles : array<string|int, mixed>
Return values
stringrenderTimelineRecursive()
Recursively renders timeline elements and their children.
protected
renderTimelineRecursive(array<string|int, mixed> $rows, float $startTime, int $segmentCount, int $segmentDuration, array<string|int, mixed> &$styles, int &$styleCount[, int $level = 0 ][, bool $isChild = false ]) : string
Parameters
- $rows : array<string|int, mixed>
- $startTime : float
- $segmentCount : int
- $segmentDuration : int
- $styles : array<string|int, mixed>
- $styleCount : int
- $level : int = 0
- $isChild : bool = false
Return values
stringroundTo()
Rounds a number to the nearest incremental value.
protected
roundTo(float $number[, int $increments = 5 ]) : float
Parameters
- $number : float
- $increments : int = 5
Return values
floatstructureTimelineData()
Arranges the already sorted timeline data into a parent => child structure.
protected
structureTimelineData(array<string|int, mixed> $elements) : array<string|int, mixed>
Parameters
- $elements : array<string|int, mixed>