PHP Класс Kint

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$aliases
$appRootDirs
$charEncodings
$cliColors
$cliDetection
$displayCalledFrom
$expandedByDefault
$fileLinkFormat
$maxLevels
$maxStrLength
$returnOutput # stores mode and active statuses
$theme

Открытые методы

Метод Описание
dump ( mixed $data = null ) : void | string Dump information about variables, accepts any number of parameters, supports modifiers:
enabled ( mixed $forceMode = null ) : mixed Enables or disables Kint, can globally enforce the rendering mode. If called without parameters, returns the current mode.
getIdeLink ( $file, $line )
shortenPath ( string $file ) : string generic path display callback, can be configured in the settings; purpose is to show relevant path info and hide as much of the path as possible.
trace ( array $trace = null ) : mixed Prints a debug backtrace, same as Kint::dump(1)

Приватные методы

Метод Описание
_getCalleeInfo ( array $trace ) : array( returns parameter names that the function was passed, as well as any predefined symbols before function call (modifiers)
_parseTrace ( array $data )
_removeAllButCode ( string $source ) : string removes comments and zaps whitespace &
_showSource ( string $file, integer $lineNumber, integer $padding = 7 ) : boolean | string trace helper, shows the place in code inline
_stepIsInternal ( $step ) : array returns whether current trace step belongs to Kint or its wrappers

Описание методов

dump() публичный статический Метод

clean up any output before kint and place the dump at the top of page: - Kint::dump() ***** expand all nodes on display: ! Kint::dump() ***** dump variables disregarding their depth: + Kint::dump() ***** return output instead of displaying it: @ Kint::dump() ***** force output as plain text ~ Kint::dump() Modifiers are supported by all dump wrapper functions, including Kint::trace(). Space is optional. You can also use the following shorthand to display debug_backtrace(): Kint::dump( 1 ); Passing the result from debug_backtrace() to kint::dump() as a single parameter will display it as trace too: $trace = debug_backtrace( true ); Kint::dump( $trace ); Or simply: Kint::dump( debug_backtrace() );
public static dump ( mixed $data = null ) : void | string
$data mixed
Результат void | string

enabled() публичный статический Метод

Enables or disables Kint, can globally enforce the rendering mode. If called without parameters, returns the current mode.
public static enabled ( mixed $forceMode = null ) : mixed
$forceMode mixed null or void - return current mode false - disable (no output) true - enable and detect cli automatically Kint::MODE_* - enable and force selected mode disregarding detection and function shorthand (s()/d()), note that you can still override this with the "~" modifier
Результат mixed previously set value if a new one is passed

shortenPath() публичный статический Метод

generic path display callback, can be configured in the settings; purpose is to show relevant path info and hide as much of the path as possible.
public static shortenPath ( string $file ) : string
$file string
Результат string

trace() публичный статический Метод

Prints a debug backtrace, same as Kint::dump(1)
public static trace ( array $trace = null ) : mixed
$trace array [OPTIONAL] you can pass your own trace, otherwise, `debug_backtrace` will be called
Результат mixed

Описание свойств

$aliases публичное статическое свойство

public static $aliases

$appRootDirs публичное статическое свойство

public static $appRootDirs

$charEncodings публичное статическое свойство

public static $charEncodings

$cliColors публичное статическое свойство

public static $cliColors

$cliDetection публичное статическое свойство

public static $cliDetection

$displayCalledFrom публичное статическое свойство

public static $displayCalledFrom

$expandedByDefault публичное статическое свойство

public static $expandedByDefault

$fileLinkFormat публичное статическое свойство

public static $fileLinkFormat

$maxLevels публичное статическое свойство

public static $maxLevels

$maxStrLength публичное статическое свойство

public static $maxStrLength

$returnOutput публичное статическое свойство

# stores mode and active statuses
public static $returnOutput

$theme публичное статическое свойство

public static $theme