コード例 #1
0
ファイル: slow.php プロジェクト: vvval/spiral
<!DOCTYPE html>
<?php 
/**
 * @see http://ppig.org/sites/default/files/2015-PPIG-26th-Sarkar.pdf
 * @var Throwable $exception
 */
$dumper = new \Spiral\Debug\Dumper(10, $styler = new \Spiral\Debug\Dumper\InversedStyle());
$dumps = [];
/**
 * Format arguments and create data dumps.
 *
 * @param array $arguments
 * @return array
 */
$argumenter = function (array $arguments) use($dumper, $styler, &$dumps) {
    $result = [];
    foreach ($arguments as $argument) {
        $display = $type = strtolower(gettype($argument));
        if (is_numeric($argument)) {
            $result[] = $styler->style($argument, 'value', $type);
            continue;
        } elseif (is_bool($argument)) {
            $result[] = $styler->style($argument ? 'true' : 'false', 'value', $type);
            continue;
        } elseif (is_null($argument)) {
            $result[] = $styler->style('null', 'value', $type);
            continue;
        }
        if (is_object($argument)) {
            $reflection = new ReflectionClass($argument);
            $display = interpolate("<span title=\"{title}\">{class}</span>", ['title' => $reflection->getName(), 'class' => $reflection->getShortName()]);
コード例 #2
0
ファイル: fast.php プロジェクト: vvval/spiral
<!DOCTYPE html>
<?php 
/**
 * @see http://ppig.org/sites/default/files/2015-PPIG-26th-Sarkar.pdf
 * @var Throwable $exception
 */
$dumper = new \Spiral\Debug\Dumper(10, $styler = new \Spiral\Debug\Dumper\InversedStyle());
$dumps = [];
/**
 * Format arguments and create data dumps.
 *
 * @param array $arguments
 * @return array
 */
$argumenter = function (array $arguments) use($dumper, $styler, &$dumps) {
    $result = [];
    foreach ($arguments as $argument) {
        $display = $type = strtolower(gettype($argument));
        if (is_numeric($argument)) {
            $result[] = $styler->style($argument, 'value', $type);
            continue;
        } elseif (is_bool($argument)) {
            $result[] = $styler->style($argument ? 'true' : 'false', 'value', $type);
            continue;
        } elseif (is_null($argument)) {
            $result[] = $styler->style('null', 'value', $type);
            continue;
        }
        if (is_object($argument)) {
            $reflection = new ReflectionClass($argument);
            $display = interpolate("<span title=\"{title}\">{class}</span>", ['title' => $reflection->getName(), 'class' => $reflection->getShortName()]);
コード例 #3
0
ファイル: exception.php プロジェクト: jwdeitch/spiral
<!DOCTYPE html>
<?php 
/**
 * @var \Spiral\Debug\Snapshot          $snapshot
 * @var \Spiral\Core\ContainerInterface $container
 * @var \Spiral\Debug\Debugger          $debugger
 */
$highlighter = new \Spiral\Tokenizer\Hightligher($container->get(\Spiral\Tokenizer\TokenizerInterface::class), ['styles' => ['color: #C26230; font-weight: bold;' => [T_STATIC, T_PUBLIC, T_PRIVATE, T_PROTECTED, T_CLASS, T_NEW, T_FINAL, T_ABSTRACT, T_IMPLEMENTS, T_CONST, T_ECHO, T_CASE, T_FUNCTION, T_GOTO, T_INCLUDE, T_INCLUDE_ONCE, T_REQUIRE, T_REQUIRE_ONCE, T_VAR, T_INSTANCEOF, T_INTERFACE, T_THROW, T_ARRAY, T_IF, T_ELSE, T_ELSEIF, T_TRY, T_CATCH, T_CLONE, T_WHILE, T_FOR, T_DO, T_UNSET, T_FOREACH, T_RETURN, T_EXIT, T_EXTENDS], 'color: black; font: weight: bold;' => [T_OPEN_TAG, T_CLOSE_TAG, T_OPEN_TAG_WITH_ECHO], 'color: #BC9458;' => [T_COMMENT, T_DOC_COMMENT], 'color: #A5C261;' => [T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE, T_DNUMBER, T_LNUMBER], 'color: #D0D0FF;' => [T_VARIABLE]]]);
$dumper = new \Spiral\Debug\Dumper($container->get(\Spiral\Debug\Debugger::class), ['container' => '<pre style="background-color: #232323; font-family: Monospace;">{dump}</pre>', 'styles' => ['common' => '#E6E1DC', 'name' => '#E6E1DC', 'indent' => 'gray', 'indent-(' => '#E6E1DC', 'indent-)' => '#E6E1DC', 'recursion' => '#ff9900', 'value-string' => '#A5C261', 'value-integer' => '#A5C261', 'value-double' => '#A5C261', 'value-boolean' => '#C26230; font-weight: bold;', 'type' => '#E6E1DC', 'type-object' => '#E6E1DC', 'type-array' => '#C26230;', 'type-null' => '#C26230;', 'type-resource' => '#color: #C26230;', 'access' => '#666', 'access-public' => '#8dc17d', 'access-private' => '#c18c7d', 'access-protected' => '#7d95c1']]);
$dumps = [];
/**
 * Format arguments and create data dumps.
 *
 * @param array $arguments
 * @return array
 */
$argumenter = function (array $arguments) use($dumper, &$dumps) {
    $result = [];
    foreach ($arguments as $argument) {
        $display = $type = strtolower(gettype($argument));
        if (is_numeric($argument)) {
            $result[] = $dumper->style($argument, 'value', $type);
            continue;
        } elseif (is_bool($argument)) {
            $result[] = $dumper->style($argument ? 'true' : 'false', 'value', $type);
            continue;
        } elseif (is_null($argument)) {
            $result[] = $dumper->style('null', 'value', $type);
            continue;
        }
        if (is_object($argument)) {