Toolbar
in package
Debug Toolbar
Displays a toolbar with bits of stats to aid a developer in debugging.
Inspiration: http://prophiler.fabfuel.de
Table of Contents
- $collectors : array<string|int, BaseCollector>
- Collectors to be used and displayed.
- $config : Toolbar
- Toolbar configuration settings.
- __construct() : mixed
- Constructor
- prepare() : void
- Prepare for debugging.
- respond() : mixed
- 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.
- roundTo() : float
- Rounds a number to the nearest incremental value.
Properties
$collectors
Collectors to be used and displayed.
protected
array<string|int, BaseCollector>
$collectors
= []
$config
Toolbar configuration settings.
protected
Toolbar
$config
Methods
__construct()
Constructor
public
__construct(Toolbar $config) : mixed
Parameters
- $config : Toolbar
Return values
mixed —prepare()
Prepare for debugging.
public
prepare([RequestInterface $request = null ][, ResponseInterface $response = null ]) : void
.
Parameters
- $request : RequestInterface = null
- $response : ResponseInterface = null
Tags
Return values
void —respond()
Inject debug toolbar into the response.
public
respond() : mixed
Return values
mixed —run()
Returns all the data required by Debug Bar
public
run(float $startTime, float $totalTime, RequestInterface $request, ResponseInterface $response) : string
Parameters
- $startTime : float
-
App start time
- $totalTime : float
- $request : RequestInterface
- $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
-
JSON encoded Toolbar data
- $format : string = 'html'
-
html, json, xml
Return values
string —renderTimeline()
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
string —roundTo()
Rounds a number to the nearest incremental value.
protected
roundTo(float $number[, int $increments = 5 ]) : float
Parameters
- $number : float
- $increments : int = 5