PHP Class Whoops\Handler\PrettyPageHandler

Inheritance: extends Whoops\Handler\Handler
Afficher le fichier Open project: filp/whoops Class Usage Examples

Protected Properties

Свойство Type Description
$editor mixed A string identifier for a known IDE/text editor, or a closure that resolves a string that can be used to open a given file in an editor. If the string contains the special substrings %file or %line, they will be replaced with the correct data.
$editors array A list of known editor strings

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
addCustomCss ( string $name ) : void Adds a custom css file to be loaded.
addDataTable ( string $label, array $data ) Adds an entry to the list of tables displayed in the template.
addDataTableCallback ( string $label, callable $callback ) Lazily adds an entry to the list of tables displayed in the table.
addEditor ( string $identifier, string $resolver ) Adds an editor resolver, identified by a string name, and that may be a string path, or a callable resolver. If the callable returns a string, it will be set as the file reference's href attribute.
addResourcePath ( string $path ) : void Adds a path to the list of paths to be searched for resources.
getApplicationPaths ( ) : array Return the application paths.
getDataTables ( string | null $label = null ) : array[] | callable Returns all the extra data tables registered with this handler.
getEditorAjax ( string $filePath, integer $line ) : boolean Given a boolean if the editor link should act as an Ajax request. The editor must be a valid callable function/closure
getEditorHref ( string $filePath, integer $line ) : string | boolean Given a string file path, and an integer file line, executes the editor resolver and returns, if available, a string that may be used as the href property for that file reference.
getPageTitle ( ) : string
getResourcePaths ( ) : array
getResourcesPath ( ) : string
handle ( ) : integer | null
handleUnconditionally ( boolean | null $value = null ) : boolean | null Allows to disable all attempts to dynamically decide whether to handle or return prematurely.
setApplicationPaths ( array $applicationPaths ) Set the application paths.
setEditor ( string | callable $editor ) Set the editor to use to open referenced files, by a string identifier, or a callable that will be executed for every file reference, with a $file and $line argument, and should return a string.
setPageTitle ( string $title ) : void
setResourcesPath ( string $resourcesPath ) : void

Méthodes protégées

Méthode Description
getEditor ( string $filePath, integer $line ) : mixed Given a boolean if the editor link should act as an Ajax request. The editor must be a valid callable function/closure
getResource ( string $resource ) : string Finds a resource, by its relative path, in all available search paths.

Method Details

__construct() public méthode

Constructor.
public __construct ( )

addCustomCss() public méthode

Adds a custom css file to be loaded.
public addCustomCss ( string $name ) : void
$name string
Résultat void

addDataTable() public méthode

The expected data is a simple associative array. Any nested arrays will be flattened with print_r
public addDataTable ( string $label, array $data )
$label string
$data array

addDataTableCallback() public méthode

The supplied callback argument will be called when the error is rendered, it should produce a simple associative array. Any nested arrays will be flattened with print_r.
public addDataTableCallback ( string $label, callable $callback )
$label string
$callback callable Callable returning an associative array

addEditor() public méthode

Adds an editor resolver, identified by a string name, and that may be a string path, or a callable resolver. If the callable returns a string, it will be set as the file reference's href attribute.
public addEditor ( string $identifier, string $resolver )
$identifier string
$resolver string

addResourcePath() public méthode

Adds a path to the list of paths to be searched for resources.
public addResourcePath ( string $path ) : void
$path string
Résultat void

getApplicationPaths() public méthode

Return the application paths.
public getApplicationPaths ( ) : array
Résultat array

getDataTables() public méthode

Optionally accepts a 'label' parameter, to only return the data table under that label.
public getDataTables ( string | null $label = null ) : array[] | callable
$label string | null
Résultat array[] | callable

getEditor() protected méthode

Given a boolean if the editor link should act as an Ajax request. The editor must be a valid callable function/closure
protected getEditor ( string $filePath, integer $line ) : mixed
$filePath string
$line integer
Résultat mixed

getEditorAjax() public méthode

Given a boolean if the editor link should act as an Ajax request. The editor must be a valid callable function/closure
public getEditorAjax ( string $filePath, integer $line ) : boolean
$filePath string
$line integer
Résultat boolean

getEditorHref() public méthode

Given a string file path, and an integer file line, executes the editor resolver and returns, if available, a string that may be used as the href property for that file reference.
public getEditorHref ( string $filePath, integer $line ) : string | boolean
$filePath string
$line integer
Résultat string | boolean

getPageTitle() public méthode

public getPageTitle ( ) : string
Résultat string

getResource() protected méthode

The search is performed starting at the last search path, and all the way back to the first, enabling a cascading-type system of overrides for all resources.
protected getResource ( string $resource ) : string
$resource string
Résultat string

getResourcePaths() public méthode

public getResourcePaths ( ) : array
Résultat array

getResourcesPath() public méthode

Deprecation:
public getResourcesPath ( ) : string
Résultat string

handle() public méthode

public handle ( ) : integer | null
Résultat integer | null

handleUnconditionally() public méthode

Set this to ensure that the handler will perform no matter what.
public handleUnconditionally ( boolean | null $value = null ) : boolean | null
$value boolean | null
Résultat boolean | null

setApplicationPaths() public méthode

Set the application paths.
public setApplicationPaths ( array $applicationPaths )
$applicationPaths array

setEditor() public méthode

Set the editor to use to open referenced files, by a string identifier, or a callable that will be executed for every file reference, with a $file and $line argument, and should return a string.
public setEditor ( string | callable $editor )
$editor string | callable

setPageTitle() public méthode

public setPageTitle ( string $title ) : void
$title string
Résultat void

setResourcesPath() public méthode

Deprecation:
public setResourcesPath ( string $resourcesPath ) : void
$resourcesPath string
Résultat void

Property Details

$editor protected_oe property

A string identifier for a known IDE/text editor, or a closure that resolves a string that can be used to open a given file in an editor. If the string contains the special substrings %file or %line, they will be replaced with the correct data.
protected mixed $editor
Résultat mixed

$editors protected_oe property

A list of known editor strings
protected array $editors
Résultat array