From 56c493dcceedc16e9342c03d3ecf01f164c9e264 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 10 Feb 2023 21:44:04 +0100 Subject: [PATCH 01/22] Dumper: added support for sensitive values in PHP 8.2 --- src/Tracy/Dumper/Describer.php | 11 ++++-- tests/Tracy/Dumper.sensitiveValue.phpt | 48 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 tests/Tracy/Dumper.sensitiveValue.phpt diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index dd5ebb5fb..d974bfec2 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -302,15 +302,20 @@ private function exposeObject(object $obj, Value $value): ?array private function isSensitive(string $key, $val, ?string $class = null): bool { - return ($this->scrubber !== null && ($this->scrubber)($key, $val, $class)) + return $val instanceof \SensitiveParameterValue + || ($this->scrubber !== null && ($this->scrubber)($key, $val, $class)) || isset($this->keysToHide[strtolower($key)]) || isset($this->keysToHide[strtolower($class . '::$' . $key)]); } - private static function hideValue($var): string + private static function hideValue($val): string { - return self::HiddenValue . ' (' . (is_object($var) ? Helpers::getClass($var) : gettype($var)) . ')'; + if ($val instanceof \SensitiveParameterValue) { + $val = $val->getValue(); + } + + return self::HiddenValue . ' (' . (is_object($val) ? Helpers::getClass($val) : gettype($val)) . ')'; } diff --git a/tests/Tracy/Dumper.sensitiveValue.phpt b/tests/Tracy/Dumper.sensitiveValue.phpt new file mode 100644 index 000000000..33d5d6f24 --- /dev/null +++ b/tests/Tracy/Dumper.sensitiveValue.phpt @@ -0,0 +1,48 @@ + array (4) + | | 'file' => '%a%' + | | 'line' => %d% + | | 'function' => 'sensitiveParameters' + | | 'args' => array (2) + | | | 0 => ***** (string) + | | | 1 => 'normal' + previous: null +XX; + +Assert::match($expect, Dumper::toText($e)); From c1aefc06832ac61e4498c9f3fdff21d4c0216793 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 10 Dec 2021 05:33:06 +0100 Subject: [PATCH 02/22] opened 3.0-dev --- composer.json | 2 +- readme.md | 1 + src/Tracy/Debugger/Debugger.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f9c8bef6d..bdfd6859b 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.9-dev" + "dev-master": "3.0-dev" } } } diff --git a/readme.md b/readme.md index db25177b1..2efa780e8 100644 --- a/readme.md +++ b/readme.md @@ -49,6 +49,7 @@ Alternatively, you can download the whole package or [tracy.phar](https://github | Tracy | compatible with PHP | compatible with browsers |-----------|---------------|---------- +| Tracy 3.0 | PHP 8.0 – 8.2 | Chrome 64+, Firefox 69+, Safari 13.1+ and iOS Safari 13.4+ | Tracy 2.9 | PHP 7.2 – 8.2 | Chrome 64+, Firefox 69+, Safari 13.1+ and iOS Safari 13.4+ | Tracy 2.8 | PHP 7.2 – 8.1 | Chrome 55+, Firefox 53+, Safari 11+ and iOS Safari 11+ | Tracy 2.7 | PHP 7.1 – 8.0 | Chrome 55+, Firefox 53+, MS Edge 16+, Safari 11+ and iOS Safari 11+ diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index d86a1c364..bfecbda8c 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -17,7 +17,7 @@ */ class Debugger { - public const VERSION = '2.9.6'; + public const VERSION = '3.0-dev'; /** server modes for Debugger::enable() */ public const From 799343f77258991ce9671e267333049a41f8fbec Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 21 Dec 2021 22:02:12 +0100 Subject: [PATCH 03/22] requires PHP 8.0 --- .github/workflows/coding-style.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- .github/workflows/tests.yml | 4 ++-- composer.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coding-style.yml b/.github/workflows/coding-style.yml index fd382338b..a34ad7e8e 100644 --- a/.github/workflows/coding-style.yml +++ b/.github/workflows/coding-style.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 coverage: none - run: composer create-project nette/code-checker temp/code-checker ^3 --no-progress diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5424fc71f..25e44dd05 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 coverage: none - run: composer install --no-progress --prefer-dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e184475f..3911ca9b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] sapi: ['php', 'php-cgi'] fail-fast: false @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 extensions: ds coverage: none diff --git a/composer.json b/composer.json index bdfd6859b..0189cf379 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.2 <8.3", + "php": ">=8.0 <8.3", "ext-session": "*", "ext-json": "*" }, From 55128d0dec8f58e4eb60453e1b1b66f4807cbc6a Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 13 Oct 2022 01:13:20 +0200 Subject: [PATCH 04/22] removed PHP 7 stuff --- src/Tracy/BlueScreen/BlueScreen.php | 2 +- src/Tracy/Debugger/Debugger.php | 4 ---- src/Tracy/Dumper/Describer.php | 29 +++++---------------------- src/Tracy/Dumper/Exposer.php | 3 +-- tests/Tracy/Dumper.toHtml().phpt | 19 ++++++++---------- tests/Tracy/Dumper.toText().phpt | 17 +++++++--------- tests/Tracy/fixtures/DumpClass.74.php | 21 ------------------- tests/Tracy/fixtures/DumpClass.php | 18 +++++++++++++++++ 8 files changed, 40 insertions(+), 73 deletions(-) delete mode 100644 tests/Tracy/fixtures/DumpClass.74.php diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index 77497f6d2..b7ffdc42a 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -63,7 +63,7 @@ public function __construct() ? [$m[1] . '/tracy', $m[1] . '/nette', $m[1] . '/latte'] : [dirname(__DIR__)]; $this->fileGenerators[] = [self::class, 'generateNewPhpFileContents']; - $this->fibers = PHP_VERSION_ID < 80000 ? new \SplObjectStorage : new \WeakMap; + $this->fibers = new \WeakMap; } diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index bfecbda8c..d91e58c88 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -361,10 +361,6 @@ public static function errorHandler( self::errorHandler($error['type'], $error['message'], $error['file'], $error['line']); } - if ($context) { - $context = (array) (object) $context; // workaround for PHP bug #80234 - } - if ($severity === E_RECOVERABLE_ERROR || $severity === E_USER_ERROR) { if (Helpers::findTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), '*::__toString')) { // workaround for PHP < 7.4 $previous = isset($context['e']) && $context['e'] instanceof \Throwable diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index d974bfec2..a1545a8fd 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -321,35 +321,16 @@ private static function hideValue($val): string public function getReferenceId($arr, $key): ?int { - if (PHP_VERSION_ID >= 70400) { - if ((!$rr = \ReflectionReference::fromArrayElement($arr, $key))) { - return null; - } - - $tmp = &$this->references[$rr->getId()]; - if ($tmp === null) { - return $tmp = count($this->references); - } - - return $tmp; - } - - $uniq = new \stdClass; - $copy = $arr; - $orig = $copy[$key]; - $copy[$key] = $uniq; - if ($arr[$key] !== $uniq) { + if ((!$rr = \ReflectionReference::fromArrayElement($arr, $key))) { return null; } - $res = array_search($uniq, $this->references, true); - $copy[$key] = $orig; - if ($res === false) { - $this->references[] = &$arr[$key]; - return count($this->references); + $tmp = &$this->references[$rr->getId()]; + if ($tmp === null) { + return $tmp = count($this->references); } - return $res + 1; + return $tmp; } diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 3b51ae32e..4ae0558e1 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -19,8 +19,7 @@ final class Exposer { public static function exposeObject(object $obj, Value $value, Describer $describer): void { - $tmp = (array) $obj; - $values = $tmp; // bug #79477, PHP < 7.4.6 + $values = (array) $obj; $props = self::getProperties(get_class($obj)); foreach (array_diff_key($values, $props) as $k => $v) { diff --git a/tests/Tracy/Dumper.toHtml().phpt b/tests/Tracy/Dumper.toHtml().phpt index 28b377cf8..284e19cf6 100644 --- a/tests/Tracy/Dumper.toHtml().phpt +++ b/tests/Tracy/Dumper.toHtml().phpt @@ -140,10 +140,8 @@ XX , Dumper::toHtml($obj)); -if (PHP_VERSION_ID >= 70400) { - require __DIR__ . '/fixtures/DumpClass.74.php'; - - Assert::match(<<<'XX' +// PHP 7.4 features +Assert::match(<<<'XX'
Test74 #%d%
 
x: 1 @@ -151,15 +149,15 @@ if (PHP_VERSION_ID >= 70400) { z: unset
XX - , Dumper::toHtml(new Test74)); +, Dumper::toHtml(new Test74)); - $obj = new Child74; - $obj->new = 7; - unset($obj->unset1, $obj->unset2); +$obj = new Child74; +$obj->new = 7; +unset($obj->unset1, $obj->unset2); - Assert::match(<<<'XX' +Assert::match(<<<'XX'
Child74 #%d%
 
new: 7 @@ -171,5 +169,4 @@ XX y: unset
XX - , Dumper::toHtml($obj)); -} +, Dumper::toHtml($obj)); diff --git a/tests/Tracy/Dumper.toText().phpt b/tests/Tracy/Dumper.toText().phpt index c003f56f0..2502acc39 100644 --- a/tests/Tracy/Dumper.toText().phpt +++ b/tests/Tracy/Dumper.toText().phpt @@ -134,24 +134,22 @@ XX , Dumper::toText($obj)); -if (PHP_VERSION_ID >= 70400) { - require __DIR__ . '/fixtures/DumpClass.74.php'; - - Assert::match(<<<'XX' +// PHP 7.4 features +Assert::match(<<<'XX' Test74 #%d% x: 1 y: unset z: unset XX - , Dumper::toText(new Test74)); +, Dumper::toText(new Test74)); - $obj = new Child74; - $obj->new = 7; - unset($obj->unset1, $obj->unset2); +$obj = new Child74; +$obj->new = 7; +unset($obj->unset1, $obj->unset2); - Assert::match(<<<'XX' +Assert::match(<<<'XX' Child74 #%d% new: 7 x: 2 @@ -162,4 +160,3 @@ Child74 #%d% y: unset XX , Dumper::toText($obj)); -} diff --git a/tests/Tracy/fixtures/DumpClass.74.php b/tests/Tracy/fixtures/DumpClass.74.php deleted file mode 100644 index 5c7c1e995..000000000 --- a/tests/Tracy/fixtures/DumpClass.74.php +++ /dev/null @@ -1,21 +0,0 @@ - Date: Fri, 10 Dec 2021 05:40:54 +0100 Subject: [PATCH 05/22] Debugger: removed support for Nette __toString workaround --- src/Tracy/Debugger/Debugger.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index d91e58c88..8acd73f79 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -362,16 +362,6 @@ public static function errorHandler( } if ($severity === E_RECOVERABLE_ERROR || $severity === E_USER_ERROR) { - if (Helpers::findTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), '*::__toString')) { // workaround for PHP < 7.4 - $previous = isset($context['e']) && $context['e'] instanceof \Throwable - ? $context['e'] - : null; - $e = new ErrorException($message, 0, $severity, $file, $line, $previous); - @$e->context = $context; // dynamic properties are deprecated since PHP 8.2 - self::exceptionHandler($e); - exit(255); - } - $e = new ErrorException($message, 0, $severity, $file, $line); @$e->context = $context; // dynamic properties are deprecated since PHP 8.2 throw $e; From c9d01ebbd666757200edb9f27457dbf0c305817a Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 22 Apr 2022 17:11:23 +0200 Subject: [PATCH 06/22] removed support for $context in error handler --- .../assets/section-exception-variables.phtml | 28 ------------------- .../BlueScreen/assets/section-exception.phtml | 2 -- src/Tracy/Debugger/Debugger.php | 7 ++--- src/Tracy/Debugger/DevelopmentStrategy.php | 6 ++-- src/Tracy/Debugger/ProductionStrategy.php | 4 +-- src/Tracy/Helpers.php | 15 ++-------- tests/Tracy/Helpers.improveError.phpt | 8 ------ tests/Tracy/Helpers.improveException.phpt | 12 -------- .../expected/Debugger.E_ERROR.html.expect | 1 - .../expected/Debugger.error-in-eval.expect | 2 +- .../expected/Debugger.exception.html.expect | 1 - .../expected/Debugger.strict.html.expect | 2 +- 12 files changed, 9 insertions(+), 79 deletions(-) delete mode 100644 src/Tracy/BlueScreen/assets/section-exception-variables.phtml diff --git a/src/Tracy/BlueScreen/assets/section-exception-variables.phtml b/src/Tracy/BlueScreen/assets/section-exception-variables.phtml deleted file mode 100644 index ef821c26d..000000000 --- a/src/Tracy/BlueScreen/assets/section-exception-variables.phtml +++ /dev/null @@ -1,28 +0,0 @@ -context) || !is_array($ex->context)) { - return; -} -?> -
- - -
-
- -context as $k => $v): ?> - - -
-
-
-
diff --git a/src/Tracy/BlueScreen/assets/section-exception.phtml b/src/Tracy/BlueScreen/assets/section-exception.phtml index 74517d814..fba06273b 100644 --- a/src/Tracy/BlueScreen/assets/section-exception.phtml +++ b/src/Tracy/BlueScreen/assets/section-exception.phtml @@ -67,8 +67,6 @@ namespace Tracy; - - diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 8acd73f79..380ef65fa 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -352,7 +352,6 @@ public static function errorHandler( string $message, string $file, int $line, - ?array $context = null ): bool { $error = error_get_last(); @@ -362,15 +361,13 @@ public static function errorHandler( } if ($severity === E_RECOVERABLE_ERROR || $severity === E_USER_ERROR) { - $e = new ErrorException($message, 0, $severity, $file, $line); - @$e->context = $context; // dynamic properties are deprecated since PHP 8.2 - throw $e; + throw new ErrorException($message, 0, $severity, $file, $line); } elseif ( ($severity & error_reporting()) || (is_int(self::$scream) ? $severity & self::$scream : self::$scream) ) { - self::getStrategy()->handleError($severity, $message, $file, $line, $context); + self::getStrategy()->handleError($severity, $message, $file, $line); } return false; // calls normal error handler to fill-in error_get_last() diff --git a/src/Tracy/Debugger/DevelopmentStrategy.php b/src/Tracy/Debugger/DevelopmentStrategy.php index 27e778639..370a9652d 100644 --- a/src/Tracy/Debugger/DevelopmentStrategy.php +++ b/src/Tracy/Debugger/DevelopmentStrategy.php @@ -84,7 +84,6 @@ public function handleError( string $message, string $file, int $line, - array $context = null ): void { if (function_exists('ini_set')) { @@ -96,13 +95,12 @@ public function handleError( && !isset($_GET['_tracy_skip_error']) ) { $e = new ErrorException($message, 0, $severity, $file, $line); - @$e->context = $context; // dynamic properties are deprecated since PHP 8.2 - @$e->skippable = true; + @$e->skippable = true; // dynamic properties are deprecated since PHP 8.2 Debugger::exceptionHandler($e); exit(255); } - $message = 'PHP ' . Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message, (array) $context); + $message = 'PHP ' . Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message); $count = &$this->bar->getPanel('Tracy:errors')->data["$file|$line|$message"]; if (!$count++) { // not repeated error diff --git a/src/Tracy/Debugger/ProductionStrategy.php b/src/Tracy/Debugger/ProductionStrategy.php index 289c1972c..16f99e3a4 100644 --- a/src/Tracy/Debugger/ProductionStrategy.php +++ b/src/Tracy/Debugger/ProductionStrategy.php @@ -60,15 +60,13 @@ public function handleError( string $message, string $file, int $line, - array $context = null ): void { if ($severity & Debugger::$logSeverity) { $err = new ErrorException($message, 0, $severity, $file, $line); - @$err->context = $context; // dynamic properties are deprecated since PHP 8.2 Helpers::improveException($err); } else { - $err = 'PHP ' . Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message, (array) $context) . " in $file:$line"; + $err = 'PHP ' . Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message) . " in $file:$line"; } try { diff --git a/src/Tracy/Helpers.php b/src/Tracy/Helpers.php index 46fa9d6d2..4ea49e7e1 100644 --- a/src/Tracy/Helpers.php +++ b/src/Tracy/Helpers.php @@ -210,11 +210,6 @@ public static function improveException(\Throwable $e): void $message .= ", did you mean $hint()?"; $replace = ["$m[2](", "$hint("]; - } elseif (preg_match('#^Undefined variable:? \$?(\w+)#', $message, $m) && !empty($e->context)) { - $hint = self::getSuggestion(array_keys($e->context), $m[1]); - $message = "Undefined variable $$m[1], did you mean $$hint?"; - $replace = ["$$m[1]", "$$hint"]; - } elseif (preg_match('#^Undefined property: ([\w\\\\]+)::\$(\w+)#', $message, $m)) { $rc = new \ReflectionClass($m[1]); $items = array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($prop) { return !$prop->isStatic(); }); @@ -244,15 +239,9 @@ public static function improveException(\Throwable $e): void /** @internal */ - public static function improveError(string $message, array $context = []): string + public static function improveError(string $message): string { - if (preg_match('#^Undefined variable:? \$?(\w+)#', $message, $m) && $context) { - $hint = self::getSuggestion(array_keys($context), $m[1]); - return $hint - ? "Undefined variable $$m[1], did you mean $$hint?" - : $message; - - } elseif (preg_match('#^Undefined property: ([\w\\\\]+)::\$(\w+)#', $message, $m)) { + if (preg_match('#^Undefined property: ([\w\\\\]+)::\$(\w+)#', $message, $m)) { $rc = new \ReflectionClass($m[1]); $items = array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($prop) { return !$prop->isStatic(); }); $hint = self::getSuggestion($items, $m[2]); diff --git a/tests/Tracy/Helpers.improveError.phpt b/tests/Tracy/Helpers.improveError.phpt index 819be7998..064689e92 100644 --- a/tests/Tracy/Helpers.improveError.phpt +++ b/tests/Tracy/Helpers.improveError.phpt @@ -70,11 +70,3 @@ test('do not suggest anything when accessing anonymous class', function () { $message = Helpers::improveError(error_get_last()['message']); Assert::same('Undefined property: class@anonymous::$property', $message); }); - - -test('variables', function () use ($obj) { - $abcd = 1; - @$val = $abc; - $message = Helpers::improveError(error_get_last()['message'], get_defined_vars()); - Assert::same('Undefined variable $abc, did you mean $abcd?', $message); -}); diff --git a/tests/Tracy/Helpers.improveException.phpt b/tests/Tracy/Helpers.improveException.phpt index 11b00ffa6..8ee2ba7e8 100644 --- a/tests/Tracy/Helpers.improveException.phpt +++ b/tests/Tracy/Helpers.improveException.phpt @@ -218,15 +218,3 @@ test('do not suggest anything when accessing anonymous class', function () { Assert::same('Undefined property: class@anonymous::$property', $e->getMessage()); Assert::false(isset($e->tracyAction)); }); - - -test('variables', function () use ($obj) { - $abcd = 1; - @$val = $abc; - $e = new ErrorException(error_get_last()['message'], 0, error_get_last()['type']); - @$e->context = get_defined_vars(); // deprecated since PHP 8.2 - Helpers::improveException($e); - Assert::same('Undefined variable $abc, did you mean $abcd?', $e->getMessage()); - Assert::match('editor://fix/?file=%a%Helpers.improveException.phpt&line=%d%&search=%24abc&replace=%24abcd', $e->tracyAction['link']); - Assert::same('fix it', $e->tracyAction['label']); -}); diff --git a/tests/Tracy/expected/Debugger.E_ERROR.html.expect b/tests/Tracy/expected/Debugger.E_ERROR.html.expect index 527830a48..0d7ca158f 100644 --- a/tests/Tracy/expected/Debugger.E_ERROR.html.expect +++ b/tests/Tracy/expected/Debugger.E_ERROR.html.expect @@ -161,7 +161,6 @@ -
diff --git a/tests/Tracy/expected/Debugger.error-in-eval.expect b/tests/Tracy/expected/Debugger.error-in-eval.expect index 7313f73f6..8ab62f0d6 100644 --- a/tests/Tracy/expected/Debugger.error-in-eval.expect +++ b/tests/Tracy/expected/Debugger.error-in-eval.expect @@ -96,7 +96,7 @@
-%A% +
diff --git a/tests/Tracy/expected/Debugger.exception.html.expect b/tests/Tracy/expected/Debugger.exception.html.expect index 362c57b07..de5d158ae 100644 --- a/tests/Tracy/expected/Debugger.exception.html.expect +++ b/tests/Tracy/expected/Debugger.exception.html.expect @@ -102,7 +102,6 @@ -
diff --git a/tests/Tracy/expected/Debugger.strict.html.expect b/tests/Tracy/expected/Debugger.strict.html.expect index a12e10209..ec235bac5 100644 --- a/tests/Tracy/expected/Debugger.strict.html.expect +++ b/tests/Tracy/expected/Debugger.strict.html.expect @@ -99,7 +99,7 @@
-%A% +
From 58a9a3bddfbf4cba6ba70cf790d6726eb18323a8 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 10 Dec 2021 06:34:13 +0100 Subject: [PATCH 07/22] updated tests --- tests/Tracy/Debugger.autoloading.phpt | 2 +- tests/Tracy/fixtures/{E_STRICT.php => FATAL.php} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/Tracy/fixtures/{E_STRICT.php => FATAL.php} (100%) diff --git a/tests/Tracy/Debugger.autoloading.phpt b/tests/Tracy/Debugger.autoloading.phpt index cc1568118..c49d5a298 100644 --- a/tests/Tracy/Debugger.autoloading.phpt +++ b/tests/Tracy/Debugger.autoloading.phpt @@ -18,4 +18,4 @@ Debugger::enable(); // in this case autoloading is not triggered -include __DIR__ . '/fixtures/E_STRICT.php'; +include __DIR__ . '/fixtures/FATAL.php'; diff --git a/tests/Tracy/fixtures/E_STRICT.php b/tests/Tracy/fixtures/FATAL.php similarity index 100% rename from tests/Tracy/fixtures/E_STRICT.php rename to tests/Tracy/fixtures/FATAL.php From 9582b01790072e2de236cd823b56dde453b97130 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 6 Feb 2023 16:34:04 +0100 Subject: [PATCH 08/22] coding style --- src/Bridges/Nette/TracyExtension.php | 6 +- src/Bridges/Psr/PsrToTracyLoggerAdapter.php | 2 +- src/Tracy/Bar/Bar.php | 2 +- src/Tracy/BlueScreen/BlueScreen.php | 48 ++-- src/Tracy/Debugger/Debugger.php | 4 +- src/Tracy/Debugger/DeferredContent.php | 8 +- src/Tracy/Debugger/ProductionStrategy.php | 4 +- src/Tracy/Dumper/Describer.php | 8 +- src/Tracy/Dumper/Dumper.php | 6 +- src/Tracy/Dumper/Exposer.php | 20 +- src/Tracy/Dumper/Renderer.php | 6 +- src/Tracy/Helpers.php | 80 +++--- src/Tracy/Logger/Logger.php | 4 +- src/Tracy/Session/FileSession.php | 2 +- tests/Tracy/BlueScreen.getDumper().phpt | 8 +- tests/Tracy/BlueScreen.renderActions().phpt | 32 ++- tests/Tracy/BlueScreen.showEnvironment.phpt | 6 +- tests/Tracy/Debugger.E_ERROR.console.phpt | 2 +- .../Debugger.barDump().showLocation.phpt | 23 +- tests/Tracy/Debugger.warnings.console.phpt | 14 +- tests/Tracy/Debugger.warnings.html.phpt | 35 ++- tests/Tracy/Dumper.debugInfo.phpt | 53 ++-- tests/Tracy/Dumper.dump().html.phpt | 32 +-- tests/Tracy/Dumper.keys.phpt | 74 +++--- tests/Tracy/Dumper.keysToHide.phpt | 30 +-- tests/Tracy/Dumper.nesting-error.phpt | 18 +- tests/Tracy/Dumper.objectExporters.phpt | 158 ++++++------ tests/Tracy/Dumper.scrubber.phpt | 60 +++-- tests/Tracy/Dumper.toHtml().collapse.phpt | 70 +++--- tests/Tracy/Dumper.toHtml().depth.phpt | 208 ++++++++------- tests/Tracy/Dumper.toHtml().key.phpt | 4 +- tests/Tracy/Dumper.toHtml().lazy.auto.phpt | 142 ++++++----- tests/Tracy/Dumper.toHtml().lazy.no.phpt | 200 ++++++++------- tests/Tracy/Dumper.toHtml().lazy.phpt | 136 ++++++---- tests/Tracy/Dumper.toHtml().live.phpt | 36 +-- tests/Tracy/Dumper.toHtml().locale.phpt | 18 +- tests/Tracy/Dumper.toHtml().location.phpt | 80 +++--- tests/Tracy/Dumper.toHtml().phpt | 192 +++++++------- tests/Tracy/Dumper.toHtml().recursion.phpt | 50 ++-- tests/Tracy/Dumper.toHtml().references.phpt | 40 +-- tests/Tracy/Dumper.toHtml().see.phpt | 140 ++++++----- tests/Tracy/Dumper.toHtml().snapshot.phpt | 48 ++-- tests/Tracy/Dumper.toHtml().specialChars.phpt | 56 +++-- tests/Tracy/Dumper.toHtml().specials.phpt | 170 +++++++------ tests/Tracy/Dumper.toTerminal().phpt | 76 +++--- tests/Tracy/Dumper.toText().depth.phpt | 170 +++++++------ tests/Tracy/Dumper.toText().locale.phpt | 14 +- tests/Tracy/Dumper.toText().nohash.phpt | 64 ++--- tests/Tracy/Dumper.toText().phpt | 174 +++++++------ tests/Tracy/Dumper.toText().recursion.phpt | 42 ++-- tests/Tracy/Dumper.toText().references.phpt | 36 +-- tests/Tracy/Dumper.toText().see.phpt | 108 ++++---- tests/Tracy/Dumper.toText().specialChars.phpt | 52 ++-- tests/Tracy/Dumper.toText().specials.dom.phpt | 238 +++++++++--------- tests/Tracy/Dumper.toText().specials.ds.phpt | 28 ++- .../Tracy/Dumper.toText().specials.enum.phpt | 18 +- .../Tracy/Dumper.toText().specials.fiber.phpt | 14 +- .../Dumper.toText().specials.generator.phpt | 28 ++- tests/Tracy/Dumper.toText().specials.phpt | 84 ++++--- tests/Tracy/dump().html.phpt | 36 +-- 60 files changed, 1876 insertions(+), 1641 deletions(-) diff --git a/src/Bridges/Nette/TracyExtension.php b/src/Bridges/Nette/TracyExtension.php index 1ac434444..c2e39ebe5 100644 --- a/src/Bridges/Nette/TracyExtension.php +++ b/src/Bridges/Nette/TracyExtension.php @@ -116,7 +116,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) ]; $initialize->addBody($builder->formatPhp( ($tbl[$key] ?? 'Tracy\Debugger::$' . $key . ' = ?') . ';', - Nette\DI\Helpers::filterArguments([$value]) + Nette\DI\Helpers::filterArguments([$value]), )); } } @@ -137,7 +137,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) $initialize->addBody($builder->formatPhp( '$this->getService(?)->addPanel(?);', - Nette\DI\Helpers::filterArguments([$this->prefix('bar'), $item]) + Nette\DI\Helpers::filterArguments([$this->prefix('bar'), $item]), )); } @@ -154,7 +154,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) foreach ($this->config->blueScreen as $item) { $initialize->addBody($builder->formatPhp( '$this->getService(?)->addPanel(?);', - Nette\DI\Helpers::filterArguments([$this->prefix('blueScreen'), $item]) + Nette\DI\Helpers::filterArguments([$this->prefix('blueScreen'), $item]), )); } diff --git a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php index b28526bee..28fac20eb 100644 --- a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php +++ b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php @@ -56,7 +56,7 @@ public function log($value, $level = self::INFO) $this->psrLogger->log( self::LevelMap[$level] ?? Psr\Log\LogLevel::ERROR, $message, - $context + $context, ); } } diff --git a/src/Tracy/Bar/Bar.php b/src/Tracy/Bar/Bar.php index fd68c4049..6778e3fec 100644 --- a/src/Tracy/Bar/Bar.php +++ b/src/Tracy/Bar/Bar.php @@ -31,7 +31,7 @@ public function addPanel(IBarPanel $panel, ?string $id = null): self if ($id === null) { $c = 0; do { - $id = get_class($panel) . ($c++ ? "-$c" : ''); + $id = $panel::class . ($c++ ? "-$c" : ''); } while (isset($this->panels[$id])); } diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index b7ffdc42a..a1666920e 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -131,9 +131,7 @@ public function render(\Throwable $exception): void /** @internal */ public function renderToAjax(\Throwable $exception, DeferredContent $defer): void { - $defer->addSetup('Tracy.BlueScreen.loadAjax', Helpers::capture(function () use ($exception) { - $this->renderTemplate($exception, __DIR__ . '/assets/content.phtml'); - })); + $defer->addSetup('Tracy.BlueScreen.loadAjax', Helpers::capture(fn() => $this->renderTemplate($exception, __DIR__ . '/assets/content.phtml'))); } @@ -174,8 +172,8 @@ private function renderTemplate(\Throwable $exception, string $template, $toScre if (function_exists('apache_request_headers')) { $httpHeaders = apache_request_headers(); } else { - $httpHeaders = array_filter($_SERVER, function ($k) { return strncmp($k, 'HTTP_', 5) === 0; }, ARRAY_FILTER_USE_KEY); - $httpHeaders = array_combine(array_map(function ($k) { return strtolower(strtr(substr($k, 5), '_', '-')); }, array_keys($httpHeaders)), $httpHeaders); + $httpHeaders = array_filter($_SERVER, fn($k) => strncmp($k, 'HTTP_', 5) === 0, ARRAY_FILTER_USE_KEY); + $httpHeaders = array_combine(array_map(fn($k) => strtolower(strtr(substr($k, 5), '_', '-')), array_keys($httpHeaders)), $httpHeaders); } $snapshot = &$this->snapshot; @@ -316,7 +314,7 @@ public static function highlightFile( int $line, int $lines = 15, bool $php = true, - int $column = 0 + int $column = 0, ): ?string { $source = @file_get_contents($file); // @ file may not exist @@ -395,14 +393,14 @@ public static function highlightLine(string $html, int $line, int $lines = 15, i '#((?:&.*?;|[^&]){' . ($column - 1) . '})(&.*?;|.)#u', '\1\2', $s . ' ', - 1 + 1, ); } $out .= sprintf( "%{$numWidth}s: %s\n%s", $n, $s, - implode('', $tags[0]) + implode('', $tags[0]), ); } else { $out .= sprintf("%{$numWidth}s: %s\n", $n, $s); @@ -448,7 +446,7 @@ function ($m) use ($colors, &$stack): string { return "\e[0m\e[" . end($stack) . 'm'; }, - $s + $s, ); $s = htmlspecialchars_decode(strip_tags($s), ENT_QUOTES | ENT_HTML5); return $s; @@ -476,17 +474,15 @@ public function isCollapsed(string $file): bool /** @internal */ public function getDumper(): \Closure { - return function ($v, $k = null): string { - return Dumper::toHtml($v, [ - Dumper::DEPTH => $this->maxDepth, - Dumper::TRUNCATE => $this->maxLength, - Dumper::ITEMS => $this->maxItems, - Dumper::SNAPSHOT => &$this->snapshot, - Dumper::LOCATION => Dumper::LOCATION_CLASS, - Dumper::SCRUBBER => $this->scrubber, - Dumper::KEYS_TO_HIDE => $this->keysToHide, - ], $k); - }; + return fn($v, $k = null): string => Dumper::toHtml($v, [ + Dumper::DEPTH => $this->maxDepth, + Dumper::TRUNCATE => $this->maxLength, + Dumper::ITEMS => $this->maxItems, + Dumper::SNAPSHOT => &$this->snapshot, + Dumper::LOCATION => Dumper::LOCATION_CLASS, + Dumper::SCRUBBER => $this->scrubber, + Dumper::KEYS_TO_HIDE => $this->keysToHide, + ], $k); } @@ -498,7 +494,7 @@ public function formatMessage(\Throwable $exception): string $msg = preg_replace( '#\'\S(?:[^\']|\\\\\')*\S\'|"\S(?:[^"]|\\\\")*\S"#', '$0', - $msg + $msg, ); // clickable class & methods @@ -517,18 +513,16 @@ function ($m) { return '' . $m[0] . ''; }, - $msg + $msg, ); // clickable file name $msg = preg_replace_callback( '#([\w\\\\/.:-]+\.(?:php|phpt|phtml|latte|neon))(?|:(\d+)| on line (\d+))?#', - function ($m) { - return @is_file($m[1]) + fn($m) => @is_file($m[1]) ? '' . $m[0] . '' - : $m[0]; - }, - $msg + : $m[0], + $msg, ); return $msg; diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 380ef65fa..b6e9380f3 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -511,9 +511,7 @@ public static function dump($var, bool $return = false) ]; return Helpers::isCli() ? Dumper::toText($var) - : Helpers::capture(function () use ($var, $options) { - Dumper::dump($var, $options); - }); + : Helpers::capture(fn() => Dumper::dump($var, $options)); } elseif (!self::$productionMode) { $html = Helpers::isHtmlMode(); diff --git a/src/Tracy/Debugger/DeferredContent.php b/src/Tracy/Debugger/DeferredContent.php index fafc8be82..038578eb7 100644 --- a/src/Tracy/Debugger/DeferredContent.php +++ b/src/Tracy/Debugger/DeferredContent.php @@ -66,7 +66,7 @@ public function sendAssets(): bool if (headers_sent($file, $line) || ob_get_length()) { throw new \LogicException( __METHOD__ . '() called after some output has been sent. ' - . ($file ? "Output started at $file:$line." : 'Try Tracy\OutputDebugger to find where output started.') + . ($file ? "Output started at $file:$line." : 'Try Tracy\OutputDebugger to find where output started.'), ); } @@ -126,7 +126,7 @@ private function buildJsCss(): string __DIR__ . '/../BlueScreen/assets/bluescreen.css', ], Debugger::$customCssFiles)); - $js1 = array_map(function ($file) { return '(function() {' . file_get_contents($file) . '})();'; }, [ + $js1 = array_map(fn($file) => '(function() {' . file_get_contents($file) . '})();', [ __DIR__ . '/../Bar/assets/bar.js', __DIR__ . '/../assets/toggle.js', __DIR__ . '/../assets/table-sort.js', @@ -153,9 +153,7 @@ public function clean(): void { foreach ($this->sessionStorage->getData() as &$items) { $items = array_slice((array) $items, -10, null, true); - $items = array_filter($items, function ($item) { - return isset($item['time']) && $item['time'] > time() - 60; - }); + $items = array_filter($items, fn($item) => isset($item['time']) && $item['time'] > time() - 60); } } } diff --git a/src/Tracy/Debugger/ProductionStrategy.php b/src/Tracy/Debugger/ProductionStrategy.php index 16f99e3a4..93ddfa2f2 100644 --- a/src/Tracy/Debugger/ProductionStrategy.php +++ b/src/Tracy/Debugger/ProductionStrategy.php @@ -40,9 +40,7 @@ public function handleException(\Throwable $exception, bool $firstTime): void header('Content-Type: text/html; charset=UTF-8'); } - (function ($logged) use ($exception) { - require Debugger::$errorTemplate ?: __DIR__ . '/assets/error.500.phtml'; - })(empty($e)); + (fn($logged) => require Debugger::$errorTemplate ?: __DIR__ . '/assets/error.500.phtml')(empty($e)); } elseif (Helpers::isCli()) { // @ triggers E_NOTICE when strerr is closed since PHP 7.4 diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index a1545a8fd..c370befd1 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -60,9 +60,7 @@ final class Describer public function describe($var): \stdClass { - uksort($this->objectExposers, function ($a, $b): int { - return $b === '' || (class_exists($a, false) && is_subclass_of($a, $b)) ? -1 : 1; - }); + uksort($this->objectExposers, fn($a, $b): int => $b === '' || (class_exists($a, false) && is_subclass_of($a, $b)) ? -1 : 1); try { return (object) [ @@ -265,14 +263,14 @@ public function addPropertyTo( $v, $type = Value::PropertyVirtual, ?int $refId = null, - ?string $class = null + ?string $class = null, ) { if ($value->depth && $this->maxItems && count($value->items ?? []) >= $this->maxItems) { $value->length = ($value->length ?? count($value->items)) + 1; return; } - $class = $class ?? $value->value; + $class ??= $value->value; $value->items[] = [ $this->describeKey($k), $type !== Value::PropertyVirtual && $this->isSensitive($k, $v, $class) diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index ebc089a7d..d28b0f44c 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -107,7 +107,7 @@ public static function dump($var, array $options = []) fwrite(STDOUT, $dumper->asTerminal($var, $useColors ? self::$terminalColors : [])); } elseif (Helpers::isHtmlMode()) { - $options[self::LOCATION] = $options[self::LOCATION] ?? true; + $options[self::LOCATION] ??= true; self::renderAssets(); echo self::toHtml($var, $options); @@ -195,8 +195,8 @@ private function __construct(array $options = []) } if (isset($tmp)) { - $tmp[0] = $tmp[0] ?? []; - $tmp[1] = $tmp[1] ?? []; + $tmp[0] ??= []; + $tmp[1] ??= []; $describer->snapshot = &$tmp[0]; $describer->references = &$tmp[1]; } diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 4ae0558e1..1d415ec15 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -20,7 +20,7 @@ final class Exposer public static function exposeObject(object $obj, Value $value, Describer $describer): void { $values = (array) $obj; - $props = self::getProperties(get_class($obj)); + $props = self::getProperties($obj::class); foreach (array_diff_key($values, $props) as $k => $v) { $describer->addPropertyTo( @@ -28,7 +28,7 @@ public static function exposeObject(object $obj, Value $value, Describer $descri (string) $k, $v, Value::PropertyDynamic, - $describer->getReferenceId($values, $k) + $describer->getReferenceId($values, $k), ); } @@ -40,7 +40,7 @@ public static function exposeObject(object $obj, Value $value, Describer $descri $values[$k], $type, $describer->getReferenceId($values, $k), - $class + $class, ); } else { $value->items[] = [ @@ -114,7 +114,7 @@ public static function exposeClosure(\Closure $obj, Value $value, Describer $des public static function exposeEnum(\UnitEnum $enum, Value $value, Describer $describer): void { - $value->value = get_class($enum) . '::' . $enum->name; + $value->value = $enum::class . '::' . $enum->name; if ($enum instanceof \BackedEnum) { $describer->addPropertyTo($value, 'value', $enum->value); $value->collapsed = true; @@ -159,7 +159,7 @@ public static function exposeGenerator(\Generator $gen, Value $value, Describer $describer->addPropertyTo($value, 'file', $r->getExecutingFile() . ':' . $r->getExecutingLine()); $describer->addPropertyTo($value, 'this', $r->getThis()); } catch (\ReflectionException $e) { - $value->value = get_class($gen) . ' (terminated)'; + $value->value = $gen::class . ' (terminated)'; } } @@ -167,9 +167,9 @@ public static function exposeGenerator(\Generator $gen, Value $value, Describer public static function exposeFiber(\Fiber $fiber, Value $value, Describer $describer): void { if ($fiber->isTerminated()) { - $value->value = get_class($fiber) . ' (terminated)'; + $value->value = $fiber::class . ' (terminated)'; } elseif (!$fiber->isStarted()) { - $value->value = get_class($fiber) . ' (not started)'; + $value->value = $fiber::class . ' (not started)'; } else { $r = new \ReflectionFiber($fiber); $describer->addPropertyTo($value, 'file', $r->getExecutingFile() . ':' . $r->getExecutingLine()); @@ -198,7 +198,7 @@ public static function exposeSplObjectStorage(\SplObjectStorage $obj): array public static function exposePhpIncompleteClass( \__PHP_Incomplete_Class $obj, Value $value, - Describer $describer + Describer $describer, ): void { $values = (array) $obj; @@ -227,7 +227,7 @@ public static function exposePhpIncompleteClass( public static function exposeDsCollection( Ds\Collection $obj, Value $value, - Describer $describer + Describer $describer, ): void { foreach ($obj as $k => $v) { @@ -239,7 +239,7 @@ public static function exposeDsCollection( public static function exposeDsMap( Ds\Map $obj, Value $value, - Describer $describer + Describer $describer, ): void { $i = 0; diff --git a/src/Tracy/Dumper/Renderer.php b/src/Tracy/Dumper/Renderer.php index 9ea566144..e8c78f5f1 100644 --- a/src/Tracy/Dumper/Renderer.php +++ b/src/Tracy/Dumper/Renderer.php @@ -91,7 +91,7 @@ public function renderAsHtml(\stdClass $model): string $uri ?? '#', $file, $line, - $uri ? "\nClick to open in editor" : '' + $uri ? "\nClick to open in editor" : '', ) . Helpers::encodeString($code, 50) . " 📍"; } @@ -339,7 +339,7 @@ private function renderObject(Value $object, int $depth): string $object->editor->line, $object->editor->url ? "\nCtrl-Click to open in editor" : '', "\nAlt-Click to expand/collapse all child nodes", - $object->editor->url + $object->editor->url, ); } @@ -493,7 +493,7 @@ function ($m) use ($colors, &$stack): string { return "\033[" . end($stack) . 'm'; }, - $s + $s, ); $s = preg_replace('/\e\[0m(\n*)(?=\e)/', '$1', $s); return $s; diff --git a/src/Tracy/Helpers.php b/src/Tracy/Helpers.php index 4ea49e7e1..92962d3f7 100644 --- a/src/Tracy/Helpers.php +++ b/src/Tracy/Helpers.php @@ -39,7 +39,7 @@ public static function editorLink(string $file, ?int $line = null): string $origFile . ($line ? ":$line" : ''), rtrim(dirname($file), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, basename($file), - $line ? ":$line" : '' + $line ? ":$line" : '', ); } else { return self::formatHtml('%', $file . ($line ? ":$line" : '')); @@ -55,7 +55,7 @@ public static function editorUri( ?int $line = null, string $action = 'open', string $search = '', - string $replace = '' + string $replace = '', ): ?string { if (Debugger::$editor && $file && ($action === 'create' || is_file($file))) { @@ -112,7 +112,7 @@ public static function findTrace(array $trace, $method, ?int &$index = null): ?a public static function getClass($obj): string { - return explode("\x00", get_class($obj))[0]; + return explode("\x00", $obj::class)[0]; } @@ -212,14 +212,14 @@ public static function improveException(\Throwable $e): void } elseif (preg_match('#^Undefined property: ([\w\\\\]+)::\$(\w+)#', $message, $m)) { $rc = new \ReflectionClass($m[1]); - $items = array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($prop) { return !$prop->isStatic(); }); + $items = array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), fn($prop) => !$prop->isStatic()); $hint = self::getSuggestion($items, $m[2]); $message .= ", did you mean $$hint?"; $replace = ["->$m[2]", "->$hint"]; } elseif (preg_match('#^Access to undeclared static property:? ([\w\\\\]+)::\$(\w+)#', $message, $m)) { $rc = new \ReflectionClass($m[1]); - $items = array_filter($rc->getProperties(\ReflectionProperty::IS_STATIC), function ($prop) { return $prop->isPublic(); }); + $items = array_filter($rc->getProperties(\ReflectionProperty::IS_STATIC), fn($prop) => $prop->isPublic()); $hint = self::getSuggestion($items, $m[2]); $message .= ", did you mean $$hint?"; $replace = ["::$$m[2]", "::$$hint"]; @@ -243,7 +243,7 @@ public static function improveError(string $message): string { if (preg_match('#^Undefined property: ([\w\\\\]+)::\$(\w+)#', $message, $m)) { $rc = new \ReflectionClass($m[1]); - $items = array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($prop) { return !$prop->isStatic(); }); + $items = array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), fn($prop) => !$prop->isStatic()); $hint = self::getSuggestion($items, $m[2]); return $hint ? $message . ", did you mean $$hint?" : $message; } @@ -285,9 +285,7 @@ public static function getSuggestion(array $items, string $value): ?string { $best = null; $min = (strlen($value) / 4 + 1) * 10 + .1; - $items = array_map(function ($item) { - return $item instanceof \Reflector ? $item->getName() : (string) $item; - }, $items); + $items = array_map(fn($item) => $item instanceof \Reflector ? $item->getName() : (string) $item, $items); foreach (array_unique($items) as $item) { if (($len = levenshtein($item, $value, 10, 11, 10)) > 0 && $len < $min) { $min = $len; @@ -414,12 +412,10 @@ private static function doEncodeString(string $s, bool $utf8, bool $showWhitespa $special = $specials[$showWhitespaces]; $s = preg_replace_callback( $utf8 ? '#[\p{C}<&]#u' : '#[\x00-\x1F\x7F-\xFF<&]#', - function ($m) use ($special) { - return $special[$m[0]] ?? (strlen($m[0]) === 1 + fn($m) => $special[$m[0]] ?? (strlen($m[0]) === 1 ? '\x' . str_pad(strtoupper(dechex(ord($m[0]))), 2, '0', STR_PAD_LEFT) . '' - : '\u{' . strtoupper(ltrim(dechex(self::utf8Ord($m[0])), '0')) . '}'); - }, - $s + : '\u{' . strtoupper(ltrim(dechex(self::utf8Ord($m[0])), '0')) . '}'), + $s, ); $s = str_replace('', '', $s); $s = preg_replace('~\n$~D', '', $s); @@ -483,22 +479,21 @@ public static function minifyJs(string $s): string $last = ''; return preg_replace_callback( <<<'XX' - ( - (?: - (^|[-+\([{}=,:;!%^&*|?~]|/(?![/*])|return|throw) # context before regexp - (?:\s|//[^\n]*+\n|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space - (/(?![/*])(?:\\[^\n]|[^[\n/\\]|\[(?:\\[^\n]|[^]])++)+/) # regexp - |(^ - |'(?:\\.|[^\n'\\])*' - |"(?:\\.|[^\n"\\])*" - |([0-9A-Za-z_$]+) - |([-+]+) - |. - ) - )(?:\s|//[^\n]*+\n|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space - ())sx -XX - , + ( + (?: + (^|[-+\([{}=,:;!%^&*|?~]|/(?![/*])|return|throw) # context before regexp + (?:\s|//[^\n]*+\n|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space + (/(?![/*])(?:\\[^\n]|[^[\n/\\]|\[(?:\\[^\n]|[^]])++)+/) # regexp + |(^ + |'(?:\\.|[^\n'\\])*' + |"(?:\\.|[^\n"\\])*" + |([0-9A-Za-z_$]+) + |([-+]+) + |. + ) + )(?:\s|//[^\n]*+\n|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space + ())sx + XX, function ($match) use (&$last) { [, $context, $regexp, $result, $word, $operator] = $match; if ($word !== '') { @@ -517,7 +512,7 @@ function ($match) use (&$last) { return $result; }, - $s . "\n" + $s . "\n", ); } @@ -528,16 +523,15 @@ public static function minifyCss(string $s): string $last = ''; return preg_replace_callback( <<<'XX' - ( - (^ - |'(?:\\.|[^\n'\\])*' - |"(?:\\.|[^\n"\\])*" - |([0-9A-Za-z_*#.%:()[\]-]+) - |. - )(?:\s|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space - ())sx -XX - , + ( + (^ + |'(?:\\.|[^\n'\\])*' + |"(?:\\.|[^\n"\\])*" + |([0-9A-Za-z_*#.%:()[\]-]+) + |. + )(?:\s|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space + ())sx + XX, function ($match) use (&$last) { [, $result, $word] = $match; if ($last === ';') { @@ -557,7 +551,7 @@ function ($match) use (&$last) { return $result; }, - $s . "\n" + $s . "\n", ); } @@ -604,7 +598,7 @@ public static function traverseValue($val, callable $callback, array &$skip = [] } foreach ($val as $k => $v) { - $refId = ($r = \ReflectionReference::fromArrayElement($val, $k)) ? $r->getId() : null; + $refId = \ReflectionReference::fromArrayElement($val, $k)?->getId(); self::traverseValue($v, $callback, $skip, $refId); } } diff --git a/src/Tracy/Logger/Logger.php b/src/Tracy/Logger/Logger.php index bbdc2d604..2a50a8e78 100644 --- a/src/Tracy/Logger/Logger.php +++ b/src/Tracy/Logger/Logger.php @@ -123,7 +123,7 @@ public function getExceptionFile(\Throwable $exception, string $level = self::EX { foreach (Helpers::getExceptionChain($exception) as $exception) { $data[] = [ - get_class($exception), $exception->getMessage(), $exception->getCode(), $exception->getFile(), $exception->getLine(), + $exception::class, $exception->getMessage(), $exception->getCode(), $exception->getFile(), $exception->getLine(), array_map(function (array $item): array { unset($item['args']); return $item; @@ -196,7 +196,7 @@ public function defaultMailer($message, string $email): void ]) . "\n", 'subject' => "PHP: An error occurred on the server $host", 'body' => static::formatMessage($message) . "\n\nsource: " . Helpers::getSource(), - ] + ], ); mail($email, $parts['subject'], $parts['body'], $parts['headers']); diff --git a/src/Tracy/Session/FileSession.php b/src/Tracy/Session/FileSession.php index 783651d2e..f68b8d581 100644 --- a/src/Tracy/Session/FileSession.php +++ b/src/Tracy/Session/FileSession.php @@ -13,7 +13,7 @@ class FileSession implements SessionStorage { private const FilePrefix = 'tracy-'; - private const CookieLifetime = 31557600; + private const CookieLifetime = 31_557_600; /** @var string */ public $cookieName = 'tracy-session'; diff --git a/tests/Tracy/BlueScreen.getDumper().phpt b/tests/Tracy/BlueScreen.getDumper().phpt index d574625d4..d6cac3cc3 100644 --- a/tests/Tracy/BlueScreen.getDumper().phpt +++ b/tests/Tracy/BlueScreen.getDumper().phpt @@ -18,9 +18,7 @@ test('dumper with default keysToHide scrubbing', function () { test('dumper with custom scrubbing', function () { $blueScreen = new Tracy\BlueScreen; - $blueScreen->scrubber = function (string $k, $v = null): bool { - return strtolower($k) === 'pin' || strtolower($k) === 'foo' || $v === 42; - }; + $blueScreen->scrubber = fn(string $k, $v = null): bool => strtolower($k) === 'pin' || strtolower($k) === 'foo' || $v === 42; $dumper = $blueScreen->getDumper(); Assert::contains('foo', $dumper('foo', 'bar')); Assert::notContains('secret', $dumper('secret', 'password')); // default keysToHide @@ -31,9 +29,7 @@ test('dumper with custom scrubbing', function () { test('dumper with regexp scrubbing', function () { $blueScreen = new Tracy\BlueScreen; - $blueScreen->scrubber = function (string $k): bool { - return (bool) preg_match('#password#i', $k); - }; + $blueScreen->scrubber = fn(string $k): bool => (bool) preg_match('#password#i', $k); $dumper = $blueScreen->getDumper(); Assert::contains('foo', $dumper('foo', 'bar')); Assert::notContains('secret', $dumper('secret', 'super_password')); diff --git a/tests/Tracy/BlueScreen.renderActions().phpt b/tests/Tracy/BlueScreen.renderActions().phpt index d39be1340..803abbddc 100644 --- a/tests/Tracy/BlueScreen.renderActions().phpt +++ b/tests/Tracy/BlueScreen.renderActions().phpt @@ -19,7 +19,7 @@ Assert::with($blueScreen, function () { 'external' => true, ], ], - $this->renderActions(new Exception) + $this->renderActions(new Exception), ); Assert::same( @@ -30,7 +30,7 @@ Assert::with($blueScreen, function () { 'external' => true, ], ], - $this->renderActions(new Exception('The = message', 123)) + $this->renderActions(new Exception('The = message', 123)), ); Assert::same( @@ -41,7 +41,7 @@ Assert::with($blueScreen, function () { 'external' => true, ], ], - $this->renderActions(new ErrorException('Message', 123, E_USER_WARNING)) + $this->renderActions(new ErrorException('Message', 123, E_USER_WARNING)), ); }); @@ -59,7 +59,7 @@ Assert::with($blueScreen, function () { Assert::same( [$search], - $this->renderActions($e) + $this->renderActions($e), ); if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { @@ -72,7 +72,7 @@ Assert::with($blueScreen, function () { 'label' => 'skip error', ], ], - $this->renderActions($e) + $this->renderActions($e), ); } }); @@ -85,7 +85,7 @@ Assert::with($blueScreen, function () { 'link' => 'editor://open/?file=' . urlencode(__FILE__) . '&line=1&search=&replace=', 'label' => 'open file', ], - $this->renderActions(new Exception(" '" . __FILE__ . "'"))[0] + $this->renderActions(new Exception(" '" . __FILE__ . "'"))[0], ); Assert::same( @@ -93,7 +93,7 @@ Assert::with($blueScreen, function () { 'link' => 'editor://open/?file=' . urlencode(__FILE__) . '&line=1&search=&replace=', 'label' => 'open file', ], - $this->renderActions(new Exception(' "' . __FILE__ . '"'))[0] + $this->renderActions(new Exception(' "' . __FILE__ . '"'))[0], ); $ds = urlencode(DIRECTORY_SEPARATOR); @@ -102,7 +102,7 @@ Assert::with($blueScreen, function () { 'link' => 'editor://create/?file=' . $ds . 'notexists.txt&line=1&search=&replace=', 'label' => 'create file', ], - $this->renderActions(new Exception(' "/notexists.txt"'))[0] + $this->renderActions(new Exception(' "/notexists.txt"'))[0], ); Assert::same( @@ -110,7 +110,7 @@ Assert::with($blueScreen, function () { 'link' => 'editor://create/?file=c%3A%5Cnotexists.txt&line=1&search=&replace=', 'label' => 'create file', ], - $this->renderActions(new Exception(' "c:\notexists.txt"'))[0] + $this->renderActions(new Exception(' "c:\notexists.txt"'))[0], ); Assert::same( @@ -118,7 +118,7 @@ Assert::with($blueScreen, function () { 'link' => 'editor://create/?file=c%3A' . $ds . 'notexists.txt&line=1&search=&replace=', 'label' => 'create file', ], - $this->renderActions(new Exception(' "c:/notexists.txt"'))[0] + $this->renderActions(new Exception(' "c:/notexists.txt"'))[0], ); Assert::count(1, $this->renderActions(new Exception(' "/notfile"'))); @@ -136,19 +136,15 @@ Assert::with($blueScreen, function () { @$e->tracyAction = ['link' => 'a', 'label' => 'b']; // deprecated since PHP 8.2 Assert::same( ['link' => 'a', 'label' => 'b'], - $this->renderActions($e)[0] + $this->renderActions($e)[0], ); }); // addAction -$blueScreen->addAction(function (Throwable $e) { - return []; -}); +$blueScreen->addAction(fn(Throwable $e) => []); -$blueScreen->addAction(function (Throwable $e) { - return ['link' => 'a', 'label' => 'b']; -}); +$blueScreen->addAction(fn(Throwable $e) => ['link' => 'a', 'label' => 'b']); Assert::with($blueScreen, function () { $e = new Exception; @@ -161,7 +157,7 @@ Assert::with($blueScreen, function () { 'external' => true, ], ], - $this->renderActions($e) + $this->renderActions($e), ); }); diff --git a/tests/Tracy/BlueScreen.showEnvironment.phpt b/tests/Tracy/BlueScreen.showEnvironment.phpt index 452fd23af..20687319f 100644 --- a/tests/Tracy/BlueScreen.showEnvironment.phpt +++ b/tests/Tracy/BlueScreen.showEnvironment.phpt @@ -25,13 +25,13 @@ $lookFor = '

Dumps

+ + + %A% + XX, $panelContent); echo 'OK!'; // prevents PHP bug #62725 }); diff --git a/tests/Tracy/Debugger.warnings.console.phpt b/tests/Tracy/Debugger.warnings.console.phpt index 676e7c78b..a9e04c941 100644 --- a/tests/Tracy/Debugger.warnings.console.phpt +++ b/tests/Tracy/Debugger.warnings.console.phpt @@ -39,15 +39,17 @@ function third($arg1) register_shutdown_function(function () { - Assert::match(<<<'XX' + Assert::match( + <<<'XX' -PHP Notice: Only variables should be assigned by reference in %a% on line %d% + PHP Notice: Only variables should be assigned by reference in %a% on line %d% -PHP Warning: hex2bin(): Hexadecimal input string must have an even length in %a% on line %d% + PHP Warning: hex2bin(): Hexadecimal input string must have an even length in %a% on line %d% -PHP Compile Warning: Unsupported declare 'foo' in %a% on line %d% -XX - , ob_get_clean()); + PHP Compile Warning: Unsupported declare 'foo' in %a% on line %d% + XX, + ob_get_clean(), + ); }); diff --git a/tests/Tracy/Debugger.warnings.html.phpt b/tests/Tracy/Debugger.warnings.html.phpt index b276d5be2..e94338b12 100644 --- a/tests/Tracy/Debugger.warnings.html.phpt +++ b/tests/Tracy/Debugger.warnings.html.phpt @@ -30,24 +30,23 @@ register_shutdown_function(function () { $rawContent = json_decode($m[1]); $panelContent = (string) DomQuery::fromHtml($rawContent)->find('#tracy-debug-panel-Tracy-errors')[0]['data-tracy-content']; Assert::match(<<<'XX' -%A% - - - - - - - - - - - - - -
CountError
1%a%
PHP Notice: Only variables should be assigned by reference in %a%:%d%
1%a%
PHP Warning: hex2bin(): Hexadecimal input string must have an even length in %a%:%d%
1%a%
PHP Compile Warning: Unsupported declare 'foo' in %a%:%d%
-
%A% -XX - , $panelContent); + %A% + + + + + + + + + + + + + +
CountError
1%a%
PHP Notice: Only variables should be assigned by reference in %a%:%d%
1%a%
PHP Warning: hex2bin(): Hexadecimal input string must have an even length in %a%:%d%
1%a%
PHP Compile Warning: Unsupported declare 'foo' in %a%:%d%
+ %A% + XX, $panelContent); echo 'OK!'; // prevents PHP bug #62725 }); diff --git a/tests/Tracy/Dumper.debugInfo.phpt b/tests/Tracy/Dumper.debugInfo.phpt index dd4317206..943c3ef6c 100644 --- a/tests/Tracy/Dumper.debugInfo.phpt +++ b/tests/Tracy/Dumper.debugInfo.phpt @@ -31,21 +31,22 @@ $obj = new Password; $obj->password = 'secret'; -Assert::match(<<<'XX' -Password #%d% - password: '[censored]' -XX - , Dumper::toText($obj, [Dumper::DEBUGINFO => true])); +Assert::match( + <<<'XX' + Password #%d% + password: '[censored]' + XX, + Dumper::toText($obj, [Dumper::DEBUGINFO => true]), +); Assert::match( <<<'XX' -Password #%d% - password: 'secret' - extra: 'foo' -XX - , - Dumper::toText($obj) + Password #%d% + password: 'secret' + extra: 'foo' + XX, + Dumper::toText($obj), ); @@ -53,18 +54,22 @@ $container = new stdClass; $container->passwordObject = $obj; -Assert::match(<<<'XX' -stdClass #%d% - passwordObject: Password #%d% - | password: '[censored]' -XX - , Dumper::toText($container, [Dumper::DEBUGINFO => true])); +Assert::match( + <<<'XX' + stdClass #%d% + passwordObject: Password #%d% + | password: '[censored]' + XX, + Dumper::toText($container, [Dumper::DEBUGINFO => true]), +); -Assert::match(<<<'XX' -stdClass #%d% - passwordObject: Password #%d% - | password: 'secret' - | extra: 'foo' -XX - , Dumper::toText($container)); +Assert::match( + <<<'XX' + stdClass #%d% + passwordObject: Password #%d% + | password: 'secret' + | extra: 'foo' + XX, + Dumper::toText($container), +); diff --git a/tests/Tracy/Dumper.dump().html.phpt b/tests/Tracy/Dumper.dump().html.phpt index f2af15248..8727b219a 100644 --- a/tests/Tracy/Dumper.dump().html.phpt +++ b/tests/Tracy/Dumper.dump().html.phpt @@ -21,26 +21,30 @@ test('html mode', function () { setHtmlMode(); ob_start(); Assert::same(123, Dumper::dump(123)); - Assert::match(<<<'XX' - - -
Dumper::dump(123)) 📍123
-XX - , ob_get_clean()); + Assert::match( + <<<'XX' + + +
Dumper::dump(123)) 📍123
+ XX, + ob_get_clean(), + ); }); test('repeated html mode', function () { ob_start(); Assert::same(123, Dumper::dump(123)); - Assert::match(<<<'XX' -
Dumper::dump(123)) 📍123
-XX - , ob_get_clean()); + Assert::match( + <<<'XX' +
Dumper::dump(123)) 📍123
+ XX, + ob_get_clean(), + ); }); diff --git a/tests/Tracy/Dumper.keys.phpt b/tests/Tracy/Dumper.keys.phpt index b9ad1f205..23a4e72c9 100644 --- a/tests/Tracy/Dumper.keys.phpt +++ b/tests/Tracy/Dumper.keys.phpt @@ -24,47 +24,51 @@ $keys = [ ' &' => 0, ]; -Assert::match(<<<'XX' -array (%i%) - '' => 0 - '"' => 0 - ''' => 0 - 'key' => 0 - ' key' => 0 - 'key ' => 0 - 0 => 0 - '01' => 0 - 'true' => 0 - 'false' => 0 - 'null' => 0 - 'NULL' => 0 - ' &' => 0 -XX - , Dumper::toText($keys)); +Assert::match( + <<<'XX' + array (%i%) + '' => 0 + '"' => 0 + ''' => 0 + 'key' => 0 + ' key' => 0 + 'key ' => 0 + 0 => 0 + '01' => 0 + 'true' => 0 + 'false' => 0 + 'null' => 0 + 'NULL' => 0 + ' &' => 0 + XX, + Dumper::toText($keys), +); -Assert::match(<<<'XX' -stdClass #%d% - '': 0 - '"': 0 - ''': 0 - key: 0 - ' key': 0 - 'key ': 0 - 0: 0 - 01: 0 - 'true': 0 - 'false': 0 - 'null': 0 - 'NULL': 0 - ' &': 0 -XX - , Dumper::toText((object) $keys)); +Assert::match( + <<<'XX' + stdClass #%d% + '': 0 + '"': 0 + ''': 0 + key: 0 + ' key': 0 + 'key ': 0 + 0: 0 + 01: 0 + 'true': 0 + 'false': 0 + 'null': 0 + 'NULL': 0 + ' &': 0 + XX, + Dumper::toText((object) $keys), +); $snapshot = []; Assert::match( '
',
-	Dumper::toHtml((object) $keys, [Dumper::SNAPSHOT => &$snapshot])
+	Dumper::toHtml((object) $keys, [Dumper::SNAPSHOT => &$snapshot]),
 );
 
 Assert::equal([
diff --git a/tests/Tracy/Dumper.keysToHide.phpt b/tests/Tracy/Dumper.keysToHide.phpt
index 6846c1236..a6a826171 100644
--- a/tests/Tracy/Dumper.keysToHide.phpt
+++ b/tests/Tracy/Dumper.keysToHide.phpt
@@ -22,25 +22,27 @@ $obj = (object) [
 ];
 
 
-Assert::match(<<<'XX'
-stdClass #%d%
-   a: ***** (integer)
-   password: ***** (string)
-   PASSWORD: ***** (string)
-   Pin: ***** (string)
-   inner: array (4)
-   |  'a' => 123
-   |  'password' => ***** (string)
-   |  'PASSWORD' => ***** (string)
-   |  'Pin' => ***** (string)
-XX
-	, Dumper::toText($obj, [Dumper::KEYS_TO_HIDE => ['password', 'PIN', 'stdClass::$a']]));
+Assert::match(
+	<<<'XX'
+		stdClass #%d%
+		   a: ***** (integer)
+		   password: ***** (string)
+		   PASSWORD: ***** (string)
+		   Pin: ***** (string)
+		   inner: array (4)
+		   |  'a' => 123
+		   |  'password' => ***** (string)
+		   |  'PASSWORD' => ***** (string)
+		   |  'Pin' => ***** (string)
+		XX,
+	Dumper::toText($obj, [Dumper::KEYS_TO_HIDE => ['password', 'PIN', 'stdClass::$a']]),
+);
 
 
 $snapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml($obj, [Dumper::KEYS_TO_HIDE => ['password', 'pin'], Dumper::SNAPSHOT => &$snapshot])
+	Dumper::toHtml($obj, [Dumper::KEYS_TO_HIDE => ['password', 'pin'], Dumper::SNAPSHOT => &$snapshot]),
 );
 
 Assert::equal([
diff --git a/tests/Tracy/Dumper.nesting-error.phpt b/tests/Tracy/Dumper.nesting-error.phpt
index c4fcb6887..a13b0e74a 100644
--- a/tests/Tracy/Dumper.nesting-error.phpt
+++ b/tests/Tracy/Dumper.nesting-error.phpt
@@ -12,11 +12,13 @@ require __DIR__ . '/../bootstrap.php';
 
 $a[] = [&$a];
 
-Assert::match(<<<'XX'
-array (1)
-   0 => array (1)
-   |  0 => &1 array (1)
-   |  |  0 => array (1)
-   |  |  |  0 => &1 array (1) RECURSION
-XX
-	, Dumper::toText($a));
+Assert::match(
+	<<<'XX'
+		array (1)
+		   0 => array (1)
+		   |  0 => &1 array (1)
+		   |  |  0 => array (1)
+		   |  |  |  0 => &1 array (1) RECURSION
+		XX,
+	Dumper::toText($a),
+);
diff --git a/tests/Tracy/Dumper.objectExporters.phpt b/tests/Tracy/Dumper.objectExporters.phpt
index 1df74ac29..5a9bb64fd 100644
--- a/tests/Tracy/Dumper.objectExporters.phpt
+++ b/tests/Tracy/Dumper.objectExporters.phpt
@@ -26,15 +26,13 @@ Assert::match('stdClass #%d%
 
 // custom exposer
 $exporters = [
-	'stdClass' => function ($var) {
-		return ['x' => $var->a + 1];
-	},
+	'stdClass' => fn($var) => ['x' => $var->a + 1],
 ];
 Assert::match(
 	'stdClass #%d%
    x: 2
 ',
-	Dumper::toText($obj, [Dumper::OBJECT_EXPORTERS => $exporters])
+	Dumper::toText($obj, [Dumper::OBJECT_EXPORTERS => $exporters]),
 );
 
 
@@ -49,17 +47,19 @@ $exporters = [
 		$value->items[] = ['object', $inner];
 	},
 ];
-Assert::match(<<<'XX'
-
stdClass #%d%
-
x: 3 - key: hello - $x: hello - object: hello -
| a: 'b' -
-XX - , Dumper::toHtml($obj, [Dumper::OBJECT_EXPORTERS => $exporters])); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
x: 3 + key: hello + $x: hello + object: hello +
| a: 'b' +
+ XX, + Dumper::toHtml($obj, [Dumper::OBJECT_EXPORTERS => $exporters]), +); // custom exposer & collapsed @@ -69,74 +69,90 @@ $exporters = [ $value->collapsed = true; }, ]; -Assert::match(<<<'XX' -
stdClass #%d%
-XX - , Dumper::toHtml($obj, [Dumper::OBJECT_EXPORTERS => $exporters])); +Assert::match( + <<<'XX' +
stdClass #%d%
+ XX, + Dumper::toHtml($obj, [Dumper::OBJECT_EXPORTERS => $exporters]), +); // PHP incomplete class $obj = unserialize('O:1:"Y":7:{s:1:"1";N;s:1:"b";i:2;s:4:"' . "\0" . '*' . "\0" . 'c";N;s:4:"' . "\0" . '*' . "\0" . 'd";s:1:"d";s:4:"' . "\0" . 'Y' . "\0" . 'e";N;s:4:"' . "\0" . 'Y' . "\0" . 'i";s:3:"bar";s:4:"' . "\0" . 'X' . "\0" . 'i";s:3:"foo";}'); -Assert::match(<<<'XX' -Y (Incomplete Class) #%d% - 1: null - b: 2 - c: null - d: 'd' - e: null - i: 'bar' - i: 'foo' -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + Y (Incomplete Class) #%d% + 1: null + b: 2 + c: null + d: 'd' + e: null + i: 'bar' + i: 'foo' + XX, + Dumper::toText($obj), +); // inheritance Dumper::$objectExporters = [ - null => function ($var) { return ['type' => 'NULL']; }, - 'Iterator' => function ($var) { return ['type' => 'Default Iterator']; }, + null => fn($var) => ['type' => 'NULL'], + 'Iterator' => fn($var) => ['type' => 'Default Iterator'], ]; $exporters = [ - 'Iterator' => function ($var) { return ['type' => 'Iterator']; }, - 'SplFileInfo' => function ($var) { return ['type' => 'SplFileInfo']; }, - 'SplFileObject' => function ($var) { return ['type' => 'SplFileObject']; }, + 'Iterator' => fn($var) => ['type' => 'Iterator'], + 'SplFileInfo' => fn($var) => ['type' => 'SplFileInfo'], + 'SplFileObject' => fn($var) => ['type' => 'SplFileObject'], ]; -Assert::match(<<<'XX' -SplFileInfo #%d% - type: 'SplFileInfo' -XX - , Dumper::toText(new SplFileInfo(__FILE__), [Dumper::OBJECT_EXPORTERS => $exporters])); - -Assert::match(<<<'XX' -SplFileObject #%d% - type: 'SplFileObject' -XX - , Dumper::toText(new SplFileObject(__FILE__), [Dumper::OBJECT_EXPORTERS => $exporters])); - -Assert::match(<<<'XX' -ArrayIterator #%d% - type: 'Iterator' -XX - , Dumper::toText(new ArrayIterator([]), [Dumper::OBJECT_EXPORTERS => $exporters])); - -Assert::match(<<<'XX' -stdClass #%d% - type: 'NULL' -XX - , Dumper::toText(new stdClass, [Dumper::OBJECT_EXPORTERS => $exporters])); - -Assert::match(<<<'XX' -ArrayIterator #%d% - type: 'Default Iterator' -XX - , Dumper::toText(new ArrayIterator([]))); - -Assert::match(<<<'XX' -stdClass #%d% - type: 'NULL' -XX - , Dumper::toText(new stdClass)); +Assert::match( + <<<'XX' + SplFileInfo #%d% + type: 'SplFileInfo' + XX, + Dumper::toText(new SplFileInfo(__FILE__), [Dumper::OBJECT_EXPORTERS => $exporters]), +); + +Assert::match( + <<<'XX' + SplFileObject #%d% + type: 'SplFileObject' + XX, + Dumper::toText(new SplFileObject(__FILE__), [Dumper::OBJECT_EXPORTERS => $exporters]), +); + +Assert::match( + <<<'XX' + ArrayIterator #%d% + type: 'Iterator' + XX, + Dumper::toText(new ArrayIterator([]), [Dumper::OBJECT_EXPORTERS => $exporters]), +); + +Assert::match( + <<<'XX' + stdClass #%d% + type: 'NULL' + XX, + Dumper::toText(new stdClass, [Dumper::OBJECT_EXPORTERS => $exporters]), +); + +Assert::match( + <<<'XX' + ArrayIterator #%d% + type: 'Default Iterator' + XX, + Dumper::toText(new ArrayIterator([])), +); + +Assert::match( + <<<'XX' + stdClass #%d% + type: 'NULL' + XX, + Dumper::toText(new stdClass), +); diff --git a/tests/Tracy/Dumper.scrubber.phpt b/tests/Tracy/Dumper.scrubber.phpt index 2f470ca13..567d1910b 100644 --- a/tests/Tracy/Dumper.scrubber.phpt +++ b/tests/Tracy/Dumper.scrubber.phpt @@ -24,44 +24,42 @@ $obj = (object) [ 'bar' => 42, ], ]; -$scrubber = function (string $k, $v = null): bool { - return strtolower($k) === 'pin' || strtolower($k) === 'foo' || $v === 42; -}; +$scrubber = fn(string $k, $v = null): bool => strtolower($k) === 'pin' || strtolower($k) === 'foo' || $v === 42; $expect1 = <<<'XX' -stdClass #%d% - a: 456 - password: 'secret1' - PASSWORD: 'secret2' - Pin: ***** (string) - foo: ***** (string) - q: ***** (integer) - inner: array (5) - | 'a' => 123 - | 'password' => 'secret4' - | 'PASSWORD' => 'secret5' - | 'Pin' => ***** (string) - | 'bar' => ***** (integer) -XX; + stdClass #%d% + a: 456 + password: 'secret1' + PASSWORD: 'secret2' + Pin: ***** (string) + foo: ***** (string) + q: ***** (integer) + inner: array (5) + | 'a' => 123 + | 'password' => 'secret4' + | 'PASSWORD' => 'secret5' + | 'Pin' => ***** (string) + | 'bar' => ***** (integer) + XX; Assert::match($expect1, Dumper::toText($obj, [Dumper::SCRUBBER => $scrubber])); // scrubber works with "keys to hide" (back compatibility) $expect2 = <<<'XX' -stdClass #%d% - a: 456 - password: ***** (string) - PASSWORD: ***** (string) - Pin: ***** (string) - foo: ***** (string) - q: ***** (integer) - inner: array (5) - | 'a' => 123 - | 'password' => ***** (string) - | 'PASSWORD' => ***** (string) - | 'Pin' => ***** (string) - | 'bar' => ***** (integer) -XX; + stdClass #%d% + a: 456 + password: ***** (string) + PASSWORD: ***** (string) + Pin: ***** (string) + foo: ***** (string) + q: ***** (integer) + inner: array (5) + | 'a' => 123 + | 'password' => ***** (string) + | 'PASSWORD' => ***** (string) + | 'Pin' => ***** (string) + | 'bar' => ***** (integer) + XX; Assert::match($expect2, Dumper::toText($obj, [Dumper::SCRUBBER => $scrubber, Dumper::KEYS_TO_HIDE => ['password']])); diff --git a/tests/Tracy/Dumper.toHtml().collapse.phpt b/tests/Tracy/Dumper.toHtml().collapse.phpt index c8d1b1472..40797e927 100644 --- a/tests/Tracy/Dumper.toHtml().collapse.phpt +++ b/tests/Tracy/Dumper.toHtml().collapse.phpt @@ -13,34 +13,42 @@ require __DIR__ . '/../bootstrap.php'; require __DIR__ . '/fixtures/DumpClass.php'; -Assert::match(<<<'XX' -
Test #%d%
-
x: array (2) - y: 'hello' - z: 30.0 -
-XX - , Dumper::toHtml(new Test, [Dumper::COLLAPSE_COUNT => 1])); - -Assert::match(<<<'XX' -
Test #%d%
-
x: array (2) - y: 'hello' - z: 30.0 -
-XX - , Dumper::toHtml(new Test, [Dumper::COLLAPSE_COUNT => 1, Dumper::COLLAPSE => false])); - -Assert::match(<<<'XX' -
Test #%d%
-XX - , Dumper::toHtml(new Test, [Dumper::COLLAPSE => true])); - -Assert::match(<<<'XX' -
Test #%d%
-XX - , Dumper::toHtml(new Test, [Dumper::COLLAPSE => 3])); +Assert::match( + <<<'XX' +
Test #%d%
+		
x: array (2) + y: 'hello' + z: 30.0 +
+ XX, + Dumper::toHtml(new Test, [Dumper::COLLAPSE_COUNT => 1]), +); + +Assert::match( + <<<'XX' +
Test #%d%
+		
x: array (2) + y: 'hello' + z: 30.0 +
+ XX, + Dumper::toHtml(new Test, [Dumper::COLLAPSE_COUNT => 1, Dumper::COLLAPSE => false]), +); + +Assert::match( + <<<'XX' +
Test #%d%
+ XX, + Dumper::toHtml(new Test, [Dumper::COLLAPSE => true]), +); + +Assert::match( + <<<'XX' +
Test #%d%
+ XX, + Dumper::toHtml(new Test, [Dumper::COLLAPSE => 3]), +); diff --git a/tests/Tracy/Dumper.toHtml().depth.phpt b/tests/Tracy/Dumper.toHtml().depth.phpt index 3009d4222..355ff6592 100644 --- a/tests/Tracy/Dumper.toHtml().depth.phpt +++ b/tests/Tracy/Dumper.toHtml().depth.phpt @@ -31,103 +31,119 @@ $arr = [ ]; -Assert::match(<<<'XX' -
array (4)
-
'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework Framework' - 0 => array (1) -
| 0 => array (1) -
'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework Framework' - 1 => stdClass #%d% -
| 0: stdClass #%d% -
-XX - , Dumper::toHtml($arr)); - - -Assert::match(<<<'XX' -
array (4)
-
'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' - 0 => array (1) -
| 0 => array (1) -
'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' - 1 => stdClass #%d% … -
-XX - , Dumper::toHtml($arr, [Dumper::DEPTH => 0, Dumper::TRUNCATE => 0])); - - -Assert::match(<<<'XX' -
array (4)
-
'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette Framework' - 0 => array (1) -
| 0 => array (1) … -
'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette Framework' - 1 => stdClass #%d% -
| 0: stdClass #%d% … -
-XX - , Dumper::toHtml($arr, [Dumper::DEPTH => 2, Dumper::TRUNCATE => 50])); - - -Assert::match(<<<'XX' -
'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework'
-XX - , Dumper::toHtml(str_repeat('Nette Framework', 10), [Dumper::TRUNCATE => 50])); +Assert::match( + <<<'XX' +
array (4)
+		
'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework Framework' + 0 => array (1) +
| 0 => array (1) +
'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework Framework' + 1 => stdClass #%d% +
| 0: stdClass #%d% +
+ XX, + Dumper::toHtml($arr), +); + + +Assert::match( + <<<'XX' +
array (4)
+		
'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' + 0 => array (1) +
| 0 => array (1) +
'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' + 1 => stdClass #%d% … +
+ XX, + Dumper::toHtml($arr, [Dumper::DEPTH => 0, Dumper::TRUNCATE => 0]), +); + + +Assert::match( + <<<'XX' +
array (4)
+		
'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette Framework' + 0 => array (1) +
| 0 => array (1) … +
'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette Framework' + 1 => stdClass #%d% +
| 0: stdClass #%d% … +
+ XX, + Dumper::toHtml($arr, [Dumper::DEPTH => 2, Dumper::TRUNCATE => 50]), +); + + +Assert::match( + <<<'XX' +
'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework'
+ XX, + Dumper::toHtml(str_repeat('Nette Framework', 10), [Dumper::TRUNCATE => 50]), +); $arr = [1, 2, 3, 4]; -Assert::match(<<<'XX' -
array (4)
-
0 => 1 - 1 => 2 - 2 => 3 - 3 => 4 -
-XX - , Dumper::toHtml($arr, [Dumper::ITEMS => 0])); - - -Assert::match(<<<'XX' -
array (4)
-
0 => 1 - 1 => 2 - 2 => 3 - 3 => 4 -
-XX - , Dumper::toHtml($arr, [Dumper::ITEMS => 2])); - - -Assert::match(<<<'XX' -
stdClass #%d%
-
0: 1 - 1: 2 - 2: 3 - 3: 4 -
-XX - , Dumper::toHtml((object) $arr, [Dumper::ITEMS => 2])); - - -Assert::match(<<<'XX' -
array (2)
-
0 => array (4) -
| 0 => 1 - | 1 => 2 - | … -
1 => stdClass #%d% -
| 0: 1 - | 1: 2 - | … -
-XX - , Dumper::toHtml([$arr, (object) $arr], [Dumper::ITEMS => 2])); +Assert::match( + <<<'XX' +
array (4)
+		
0 => 1 + 1 => 2 + 2 => 3 + 3 => 4 +
+ XX, + Dumper::toHtml($arr, [Dumper::ITEMS => 0]), +); + + +Assert::match( + <<<'XX' +
array (4)
+		
0 => 1 + 1 => 2 + 2 => 3 + 3 => 4 +
+ XX, + Dumper::toHtml($arr, [Dumper::ITEMS => 2]), +); + + +Assert::match( + <<<'XX' +
stdClass #%d%
+		
0: 1 + 1: 2 + 2: 3 + 3: 4 +
+ XX, + Dumper::toHtml((object) $arr, [Dumper::ITEMS => 2]), +); + + +Assert::match( + <<<'XX' +
array (2)
+		
0 => array (4) +
| 0 => 1 + | 1 => 2 + | … +
1 => stdClass #%d% +
| 0: 1 + | 1: 2 + | … +
+ XX, + Dumper::toHtml([$arr, (object) $arr], [Dumper::ITEMS => 2]), +); diff --git a/tests/Tracy/Dumper.toHtml().key.phpt b/tests/Tracy/Dumper.toHtml().key.phpt index 8952f744b..07618db8e 100644 --- a/tests/Tracy/Dumper.toHtml().key.phpt +++ b/tests/Tracy/Dumper.toHtml().key.phpt @@ -11,10 +11,10 @@ require __DIR__ . '/../bootstrap.php'; Assert::match( '
123
', - Dumper::toHtml(123, [Dumper::KEYS_TO_HIDE => ['password', 'pin']], 'pass') + Dumper::toHtml(123, [Dumper::KEYS_TO_HIDE => ['password', 'pin']], 'pass'), ); Assert::match( '
***** (integer)
', - Dumper::toHtml(123, [Dumper::KEYS_TO_HIDE => ['password', 'pin']], 'password') + Dumper::toHtml(123, [Dumper::KEYS_TO_HIDE => ['password', 'pin']], 'password'), ); diff --git a/tests/Tracy/Dumper.toHtml().lazy.auto.phpt b/tests/Tracy/Dumper.toHtml().lazy.auto.phpt index b194bb0d8..02e6494dc 100644 --- a/tests/Tracy/Dumper.toHtml().lazy.auto.phpt +++ b/tests/Tracy/Dumper.toHtml().lazy.auto.phpt @@ -14,95 +14,109 @@ require __DIR__ . '/../bootstrap.php'; // depth $arr = [1, [2, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', [3, [4, [5, [6]]]]]], 3]; -Assert::match(<<<'XX' -
array (3)
-
0 => 1 - 1 => array (2) -
| 0 => 2 - | 1 => array (9) -
2 => 3 -
-XX - , Dumper::toHtml($arr, [Dumper::DEPTH => 4])); +Assert::match( + <<<'XX' +
array (3)
+		
0 => 1 + 1 => array (2) +
| 0 => 2 + | 1 => array (9) +
2 => 3 +
+ XX, + Dumper::toHtml($arr, [Dumper::DEPTH => 4]), +); $obj = new stdClass; $obj->items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']; $obj->items['x'] = new stdClass; $obj->items['x']->b = new stdClass; $obj->items['x']->b->c = new stdClass; -Assert::match(<<<'XX' -
stdClass #%d%
-
items: array (9) -
-XX - , Dumper::toHtml($obj, [Dumper::DEPTH => 4])); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
items: array (9) +
+ XX, + Dumper::toHtml($obj, [Dumper::DEPTH => 4]), +); // recursion $arr = [1, 2, 3, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']]; $arr[3][] = &$arr; -Assert::match(<<<'XX' -
array (4)
-
0 => 1 - 1 => 2 - 2 => 3 - 3 => array (9) -
-XX - , Dumper::toHtml($arr)); +Assert::match( + <<<'XX' +
array (4)
+		
0 => 1 + 1 => 2 + 2 => 3 + 3 => array (9) +
+ XX, + Dumper::toHtml($arr), +); $obj = new stdClass; $obj->items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', $obj]; -Assert::match(<<<'XX' -
stdClass #%d%
-
items: array (9) -
-XX - , Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
items: array (9) +
+ XX, + Dumper::toHtml($obj), +); // recursion fix $arr = [new stdClass, 'arr' => [1, 2, 3, 4, 5, 6]]; $obj = (object) $arr; $obj->arr[] = $obj; -Assert::match(<<<'XX' -
stdClass #%d%
-
0: stdClass #%d% - arr: array (7) -
-XX - , Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
0: stdClass #%d% + arr: array (7) +
+ XX, + Dumper::toHtml($obj), +); // lazy dump & max items $arr = [1, 2, 3, 4, 5, 6, 7, 8]; -Assert::match(<<<'XX' -
array (2)
-
0 => array (8) - 1 => stdClass #%d% -
| 0: 1 - | 1: 2 - | 2: 3 - | 3: 4 - | 4: 5 - | … -
-XX - , Dumper::toHtml([$arr, (object) $arr], [Dumper::ITEMS => 5])); +Assert::match( + <<<'XX' +
array (2)
+		
0 => array (8) + 1 => stdClass #%d% +
| 0: 1 + | 1: 2 + | 2: 3 + | 3: 4 + | 4: 5 + | … +
+ XX, + Dumper::toHtml([$arr, (object) $arr], [Dumper::ITEMS => 5]), +); // lazy dump & max items & reference $arr = [1, 2, 3, 4, 5, 6, 7, 8]; -Assert::match(<<<'XX' -
array (1)
-
0 => &1 array (8) -
-XX - , Dumper::toHtml([&$arr], [Dumper::ITEMS => 5])); +Assert::match( + <<<'XX' +
array (1)
+		
0 => &1 array (8) +
+ XX, + Dumper::toHtml([&$arr], [Dumper::ITEMS => 5]), +); diff --git a/tests/Tracy/Dumper.toHtml().lazy.no.phpt b/tests/Tracy/Dumper.toHtml().lazy.no.phpt index 76db56ea6..18891fa52 100644 --- a/tests/Tracy/Dumper.toHtml().lazy.no.phpt +++ b/tests/Tracy/Dumper.toHtml().lazy.no.phpt @@ -26,109 +26,123 @@ Assert::match('
arrayarray (11)
-
0 => null - 1 => true - 2 => false - 3 => 0 - 4 => 0.0 - 5 => 'string' - 6 => ''&"' - 7 => '\x00' - 8 => INF - 9 => -INF - 10 => NAN -
-XX - , Dumper::toHtml([null, true, false, 0, 0.0, 'string', "'&\"", "\x00", INF, -INF, NAN], $options)); +Assert::match( + <<<'XX' +
array (11)
+		
0 => null + 1 => true + 2 => false + 3 => 0 + 4 => 0.0 + 5 => 'string' + 6 => ''&"' + 7 => '\x00' + 8 => INF + 9 => -INF + 10 => NAN +
+ XX, + Dumper::toHtml([null, true, false, 0, 0.0, 'string', "'&\"", "\x00", INF, -INF, NAN], $options), +); // no lazy dump and resource -Assert::match(<<<'XX' -
stream resource @%d%
-
%A% -XX - , Dumper::toHtml(fopen(__FILE__, 'r'), $options)); +Assert::match( + <<<'XX' +
stream resource @%d%
+		
%A% + XX, + Dumper::toHtml(fopen(__FILE__, 'r'), $options), +); // no lazy dump and collapse -Assert::match(<<<'XX' -
Test #%d%
-
x: array (2) -
| 0 => 10 - | 1 => null -
y: 'hello' - z: 30.0 -
-XX - , Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true])); +Assert::match( + <<<'XX' +
Test #%d%
+		
x: array (2) +
| 0 => 10 + | 1 => null +
y: 'hello' + z: 30.0 +
+ XX, + Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true]), +); // no lazy dump & location -Assert::match(<<<'XX' -
Dumper::toHtml(new Test, $options + ['location' =>  N_CLASS])) 📍Test #%d%
-
x: array (2) -
| 0 => 10 - | 1 => null -
y: 'hello' - z: 30.0 -
-XX - , Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS])); +Assert::match( + <<<'XX' +
Dumper::toHtml(new Test, $options + ['location' =>  ON_CLASS]) 📍Test #%d%
+		
x: array (2) +
| 0 => 10 + | 1 => null +
y: 'hello' + z: 30.0 +
+ XX, + Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS]), +); // recursion $arr = [1, 2, 3]; $arr[] = &$arr; -Assert::match(<<<'XX' -
array (4)
-
0 => 1 - 1 => 2 - 2 => 3 - 3 => &1 array (4) -
| 0 => 1 - | 1 => 2 - | 2 => 3 - | 3 => &1 array (4) RECURSION -
-XX - , Dumper::toHtml($arr, $options)); +Assert::match( + <<<'XX' +
array (4)
+		
0 => 1 + 1 => 2 + 2 => 3 + 3 => &1 array (4) +
| 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => &1 array (4) RECURSION +
+ XX, + Dumper::toHtml($arr, $options), +); $obj = new stdClass; $obj->x = $obj; -Assert::match(<<<'XX' -
stdClass #%d%
-
x: stdClass #%d% RECURSION -
-XX - , Dumper::toHtml($obj, $options)); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
x: stdClass #%d% RECURSION +
+ XX, + Dumper::toHtml($obj, $options), +); // max depth $arr = [1, [2, [3, [4, [5, [6]]]]], 3]; -Assert::match(<<<'XX' -
array (3)
-
0 => 1 - 1 => array (2) -
| 0 => 2 - | 1 => array (2) -
| | 0 => 3 - | | 1 => array (2) -
| | | 0 => 4 - | | | 1 => array (2) … -
2 => 3 -
-XX - , Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4])); +Assert::match( + <<<'XX' +
array (3)
+		
0 => 1 + 1 => array (2) +
| 0 => 2 + | 1 => array (2) +
| | 0 => 3 + | | 1 => array (2) +
| | | 0 => 4 + | | | 1 => array (2) … +
2 => 3 +
+ XX, + Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]), +); $obj = new stdClass; $obj->a = new stdClass; @@ -136,13 +150,15 @@ $obj->a->b = new stdClass; $obj->a->b->c = new stdClass; $obj->a->b->c->d = new stdClass; $obj->a->b->c->d->e = new stdClass; -Assert::match(<<<'XX' -
stdClass #%d%
-
a: stdClass #%d% -
| b: stdClass #%d% -
| | c: stdClass #%d% -
| | | d: stdClass #%d% … -
-XX - , Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4])); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
a: stdClass #%d% +
| b: stdClass #%d% +
| | c: stdClass #%d% +
| | | d: stdClass #%d% … +
+ XX, + Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4]), +); diff --git a/tests/Tracy/Dumper.toHtml().lazy.phpt b/tests/Tracy/Dumper.toHtml().lazy.phpt index 60fb1c903..a515e6c00 100644 --- a/tests/Tracy/Dumper.toHtml().lazy.phpt +++ b/tests/Tracy/Dumper.toHtml().lazy.phpt @@ -26,77 +26,97 @@ Assert::match('
array
-XX - , Dumper::toHtml([null, true, false, 'string', "'&\"", "\x00"], $options)); +Assert::match( + <<<'XX' +

+		XX,
+	Dumper::toHtml([null, true, false, 'string', "'&\"", "\x00"], $options),
+);
 
 
 // lazy dump of numbers
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml([0, 0.0, 1, 1.0, 9007199254740999, -9007199254740999, INF, -INF, NAN], $options));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml([0, 0.0, 1, 1.0, 9_007_199_254_740_999, -9_007_199_254_740_999, INF, -INF, NAN], $options),
+);
 
 
 // live dump of object
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml(new stdClass, $options));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml(new stdClass, $options),
+);
 
 // twice with different identity
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml(new stdClass, $options)); // different object
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml(new stdClass, $options),
+); // different object
 
 
-	// lazy dump and resource
-	Assert::match(<<<'XX'
-

-XX
-		, Dumper::toHtml(fopen(__FILE__, 'r'), $options));
+// lazy dump and resource
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml(fopen(__FILE__, 'r'), $options),
+);
 
 
 // lazy dump and collapse
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true]));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true]),
+);
 
 
 // lazy dump & location
-Assert::match(<<<'XX'
-
Dumper::toHtml(new Test, $options + ['location' =>  N_CLASS])) 📍
-XX - , Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS])); +Assert::match( + <<<'XX' +
Dumper::toHtml(new Test, $options + ['location' =>  ON_CLASS]) 📍
+ XX, + Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS]), +); // lazy dump & recursion $arr = [1, 2, 3]; $arr[] = &$arr; -Assert::match(<<<'XX' -

-XX
-	, Dumper::toHtml($arr, $options));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml($arr, $options),
+);
 
 $obj = new stdClass;
 $obj->x = $obj;
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml($obj, $options));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml($obj, $options),
+);
 
 
 // lazy dump & max depth
 $arr = [1, [2, [3, [4, [5, [6]]]]], 3];
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]),
+);
 
 $obj = new stdClass;
 $obj->a = new stdClass;
@@ -104,23 +124,29 @@ $obj->a->b = new stdClass;
 $obj->a->b->c = new stdClass;
 $obj->a->b->c->d = new stdClass;
 $obj->a->b->c->d->e = new stdClass;
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4]));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4]),
+);
 
 
 // lazy dump & max string length
 $arr = [str_repeat('x', 80)];
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml($arr, $options + [Dumper::TRUNCATE => 50]));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml($arr, $options + [Dumper::TRUNCATE => 50]),
+);
 
 
 // lazy dump & max items
 $arr = [1, 2, 3, 4, 5, 6, 7, 8];
-Assert::match(<<<'XX'
-

-XX
-	, Dumper::toHtml([$arr, (object) $arr], $options + [Dumper::ITEMS => 5]));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml([$arr, (object) $arr], $options + [Dumper::ITEMS => 5]),
+);
diff --git a/tests/Tracy/Dumper.toHtml().live.phpt b/tests/Tracy/Dumper.toHtml().live.phpt
index 6743fa22c..25e946304 100644
--- a/tests/Tracy/Dumper.toHtml().live.phpt
+++ b/tests/Tracy/Dumper.toHtml().live.phpt
@@ -36,20 +36,20 @@ Assert::same([], Dumper::$liveSnapshot[0]);
 // live dump of array
 Assert::match(
 	'
\\\\x00","length":1}],[8,{"number":"INF"}],[9,{"number":"-INF"}],[10,{"number":"NAN"}]]\'>
', - Dumper::toHtml([null, true, false, 0, 0.0, 'string', "'&\"", "\x00", INF, -INF, NAN], $options) + Dumper::toHtml([null, true, false, 0, 0.0, 'string', "'&\"", "\x00", INF, -INF, NAN], $options), ); // live dump of object Assert::match( '
',
-	Dumper::toHtml(new stdClass, $options)
+	Dumper::toHtml(new stdClass, $options),
 );
 
 // twice with different identity
 Assert::match(
 	'
',
-	Dumper::toHtml(new stdClass, $options) // different object
+	Dumper::toHtml(new stdClass, $options), // different object
 );
 Assert::equal([
 	['object' => 'stdClass', 'items' => []],
@@ -65,7 +65,7 @@ Assert::match('
null
 Dumper::$liveSnapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml(fopen(__FILE__, 'r'), $options)
+	Dumper::toHtml(fopen(__FILE__, 'r'), $options),
 );
 Assert::count(1, Dumper::$liveSnapshot[0]);
 
@@ -74,7 +74,7 @@ Assert::count(1, Dumper::$liveSnapshot[0]);
 Dumper::$liveSnapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true])
+	Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true]),
 );
 
 
@@ -82,7 +82,7 @@ Assert::match(
 Dumper::$liveSnapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml(new Test, $options)
+	Dumper::toHtml(new Test, $options),
 );
 
 Assert::equal([
@@ -99,12 +99,14 @@ Assert::equal([
 
 // live dump & location
 Dumper::$liveSnapshot = [];
-Assert::match(<<<'XX'
-
Dumper::toHtml(new Test, $options + ['location' =>  N_CLASS])) 📍
-XX - , Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS])); +Assert::match( + <<<'XX' +
Dumper::toHtml(new Test, $options + ['location' =>  ON_CLASS]) 📍
+ XX, + Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS]), +); Assert::equal([ [ @@ -129,7 +131,7 @@ $arr = [1, 2, 3]; $arr[] = &$arr; Assert::match( '
',
-	Dumper::toHtml($arr, $options)
+	Dumper::toHtml($arr, $options),
 );
 Assert::equal([
 	[
@@ -143,7 +145,7 @@ $obj = new stdClass;
 $obj->x = $obj;
 Assert::match(
 	'
',
-	Dumper::toHtml($obj, $options)
+	Dumper::toHtml($obj, $options),
 );
 
 
@@ -152,7 +154,7 @@ Dumper::$liveSnapshot = [];
 $arr = [1, [2, [3, [4, [5, [6]]]]], 3];
 Assert::match(
 	'
',
-	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4])
+	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]),
 );
 Assert::same([], Dumper::$liveSnapshot[0]);
 
@@ -160,7 +162,7 @@ Assert::same([], Dumper::$liveSnapshot[0]);
 $arr = [1, [2, [3, [4, []]]], 3];
 Assert::match(
 	'
',
-	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4])
+	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]),
 );
 Assert::same([], Dumper::$liveSnapshot[0]);
 
@@ -173,5 +175,5 @@ $obj->a->b->c->d = new stdClass;
 $obj->a->b->c->d->e = new stdClass;
 Assert::match(
 	'
',
-	Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4])
+	Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4]),
 );
diff --git a/tests/Tracy/Dumper.toHtml().locale.phpt b/tests/Tracy/Dumper.toHtml().locale.phpt
index 03c300560..8447ac1ae 100644
--- a/tests/Tracy/Dumper.toHtml().locale.phpt
+++ b/tests/Tracy/Dumper.toHtml().locale.phpt
@@ -14,11 +14,13 @@ require __DIR__ . '/../bootstrap.php';
 
 setlocale(LC_ALL, 'czech');
 
-Assert::match(<<<'XX'
-
array (2)
-
0 => -10.0 - 1 => 10.3 -
-XX - , Dumper::toHtml([-10.0, 10.3])); +Assert::match( + <<<'XX' +
array (2)
+		
0 => -10.0 + 1 => 10.3 +
+ XX, + Dumper::toHtml([-10.0, 10.3]), +); diff --git a/tests/Tracy/Dumper.toHtml().location.phpt b/tests/Tracy/Dumper.toHtml().location.phpt index 8a5c980eb..1044100e8 100644 --- a/tests/Tracy/Dumper.toHtml().location.phpt +++ b/tests/Tracy/Dumper.toHtml().location.phpt @@ -15,44 +15,54 @@ require __DIR__ . '/../bootstrap.php'; Assert::same("
\n", substr(Dumper::toHtml(true, ['location' => true]), -7)); -Assert::match(<<<'XX' -
Dumper::toHtml([1], ['location' => true])) 📍array (1)
-
0 => 1 -
-XX - , Dumper::toHtml([1], ['location' => true])); +Assert::match( + <<<'XX' +
Dumper::toHtml([1], ['location' => true]) 📍array (1)
+		
0 => 1 +
+ XX, + Dumper::toHtml([1], ['location' => true]), +); class Test { } -Assert::match(<<<'XX' -
Dumper::toHtml(new Test, ['location' => true])) 📍Test #%d%
-XX - , Dumper::toHtml(new Test, ['location' => true])); - - -Assert::match(<<<'XX' -
Test #%d%
-XX - , Dumper::toHtml(new Test, ['location' => false])); - - -Assert::match(<<<'XX' -
Dumper::toHtml(new Test, ['location' => Dumper::LOCATION_SOURCE])) 📍Test #%d%
-XX - , Dumper::toHtml(new Test, ['location' => Dumper::LOCATION_SOURCE])); - - -Assert::match(<<<'XX' -
Test #%d%
-XX - , Dumper::toHtml(new Test, ['location' => Dumper::LOCATION_CLASS])); +Assert::match( + <<<'XX' +
Dumper::toHtml(new Test, ['location' => true]) 📍Test #%d%
+ XX, + Dumper::toHtml(new Test, ['location' => true]), +); + + +Assert::match( + <<<'XX' +
Test #%d%
+ XX, + Dumper::toHtml(new Test, ['location' => false]), +); + + +Assert::match( + <<<'XX' +
Dumper::toHtml(new Test, ['location' => Dumper::LOCATION_SOURCE]) 📍Test #%d%
+ XX, + Dumper::toHtml(new Test, ['location' => Dumper::LOCATION_SOURCE]), +); + + +Assert::match( + <<<'XX' +
Test #%d%
+ XX, + Dumper::toHtml(new Test, ['location' => Dumper::LOCATION_CLASS]), +); diff --git a/tests/Tracy/Dumper.toHtml().phpt b/tests/Tracy/Dumper.toHtml().phpt index 284e19cf6..418a69406 100644 --- a/tests/Tracy/Dumper.toHtml().phpt +++ b/tests/Tracy/Dumper.toHtml().phpt @@ -51,65 +51,73 @@ Assert::same(str_replace( "\r", '', <<<'XX' -
array (1)
-
0 => 1 -
+
array (1)
+		
0 => 1 +
-XX + XX, ), Dumper::toHtml([1])); // multiline -Assert::match(<<<'XX' -
array (3)
-
0 => 'hello' - 1 => string -
| 'a\n - | b' -
2 => array (1) -
| 0 => string -
| | 'a\n - | | b' -
-XX - , Dumper::toHtml(['hello', "a\nb", ["a\nb"]])); +Assert::match( + <<<'XX' +
array (3)
+		
0 => 'hello' + 1 => string +
| 'a\n + | b' +
2 => array (1) +
| 0 => string +
| | 'a\n + | | b' +
+ XX, + Dumper::toHtml(['hello', "a\nb", ["a\nb"]]), +); // array (with snapshot) -Assert::match(<<<'XX' -
array (5)
-
0 => 1 - 1 => 'hello' - 2 => array (0) - 3 => array (2) -
| 0 => 1 - | 1 => 2 -
4 => array (7) -
-XX - , Dumper::toHtml([1, 'hello', [], [1, 2], [1 => 1, 2, 3, 4, 5, 6, 7]])); +Assert::match( + <<<'XX' +
array (5)
+		
0 => 1 + 1 => 'hello' + 2 => array (0) + 3 => array (2) +
| 0 => 1 + | 1 => 2 +
4 => array (7) +
+ XX, + Dumper::toHtml([1, 'hello', [], [1, 2], [1 => 1, 2, 3, 4, 5, 6, 7]]), +); // object -Assert::match(<<<'XX' -
stdClass #%d%
-XX - , Dumper::toHtml(new stdClass)); - -Assert::match(<<<'XX' -
Test #%d%
-
x: array (2) -
| 0 => 10 - | 1 => null -
y: 'hello' - z: 30.0 -
-XX - , Dumper::toHtml(new Test)); +Assert::match( + <<<'XX' +
stdClass #%d%
+ XX, + Dumper::toHtml(new stdClass), +); + +Assert::match( + <<<'XX' +
Test #%d%
+		
x: array (2) +
| 0 => 10 + | 1 => null +
y: 'hello' + z: 30.0 +
+ XX, + Dumper::toHtml(new Test), +); $obj = new Child; $obj->new = 7; @@ -119,37 +127,41 @@ $obj->{''} = 10; $obj->{"a\x00\n"} = 11; $obj->{"a\xA0"} = 12; -Assert::match(<<<'XX' -
Child #%d%
-
new: 7 - 0: 8 - 1: 9 - '': 10 - 'a\x00\n': 11 - 'a\xA0': 12 - x: 1 - y: 2 - z: 3 - x2: 4 - y2: 5 - z2: 6 - y: 'hello' -
-XX - , Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
Child #%d%
+		
new: 7 + 0: 8 + 1: 9 + '': 10 + 'a\x00\n': 11 + 'a\xA0': 12 + x: 1 + y: 2 + z: 3 + x2: 4 + y2: 5 + z2: 6 + y: 'hello' +
+ XX, + Dumper::toHtml($obj), +); // PHP 7.4 features -Assert::match(<<<'XX' -
Test74 #%d%
-
x: 1 - y: unset - z: unset -
-XX -, Dumper::toHtml(new Test74)); +Assert::match( + <<<'XX' +
Test74 #%d%
+		
x: 1 + y: unset + z: unset +
+ XX, + Dumper::toHtml(new Test74), +); $obj = new Child74; @@ -157,16 +169,18 @@ $obj->new = 7; unset($obj->unset1, $obj->unset2); -Assert::match(<<<'XX' -
Child74 #%d%
-
new: 7 - x: 2 - y: unset - z: unset - unset1: unset - unset2: unset - y: unset -
-XX -, Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
Child74 #%d%
+		
new: 7 + x: 2 + y: unset + z: unset + unset1: unset + unset2: unset + y: unset +
+ XX, + Dumper::toHtml($obj), +); diff --git a/tests/Tracy/Dumper.toHtml().recursion.phpt b/tests/Tracy/Dumper.toHtml().recursion.phpt index f41cd9e39..7cc4a2a88 100644 --- a/tests/Tracy/Dumper.toHtml().recursion.phpt +++ b/tests/Tracy/Dumper.toHtml().recursion.phpt @@ -14,30 +14,34 @@ require __DIR__ . '/../bootstrap.php'; $arr = [1, 2, 3]; $arr[] = &$arr; -Assert::match(<<<'XX' -
array (4)
-
0 => 1 - 1 => 2 - 2 => 3 - 3 => &1 array (4) -
| 0 => 1 - | 1 => 2 - | 2 => 3 - | 3 => &1 array (4) RECURSION -
-XX - , Dumper::toHtml($arr)); +Assert::match( + <<<'XX' +
array (4)
+		
0 => 1 + 1 => 2 + 2 => 3 + 3 => &1 array (4) +
| 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => &1 array (4) RECURSION +
+ XX, + Dumper::toHtml($arr), +); $arr = (object) ['x' => 1, 'y' => 2]; $arr->z = &$arr; -Assert::match(<<<'XX' -
stdClass #%d%
-
x: 1 - y: 2 - z: &1 stdClass #%d% RECURSION -
-XX - , Dumper::toHtml($arr)); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
x: 1 + y: 2 + z: &1 stdClass #%d% RECURSION +
+ XX, + Dumper::toHtml($arr), +); diff --git a/tests/Tracy/Dumper.toHtml().references.phpt b/tests/Tracy/Dumper.toHtml().references.phpt index 8100de373..dc46d6641 100644 --- a/tests/Tracy/Dumper.toHtml().references.phpt +++ b/tests/Tracy/Dumper.toHtml().references.phpt @@ -17,22 +17,24 @@ $a = 1; $b = 2; $obj = (object) [&$a, $a, &$b, $b, (object) [&$a, &$b], (object) [$a, $b], [&$b, &$a]]; -Assert::match(<<<'XX' -
stdClass #%d%
-
0: &1 1 - 1: 1 - 2: &2 2 - 3: 2 - 4: stdClass #%d% -
| 0: &1 1 - | 1: &2 2 -
5: stdClass #%d% -
| 0: 1 - | 1: 2 -
6: array (2) -
| 0 => &2 2 - | 1 => &1 1 -
-XX - , Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
stdClass #%d%
+		
0: &1 1 + 1: 1 + 2: &2 2 + 3: 2 + 4: stdClass #%d% +
| 0: &1 1 + | 1: &2 2 +
5: stdClass #%d% +
| 0: 1 + | 1: 2 +
6: array (2) +
| 0 => &2 2 + | 1 => &1 1 +
+ XX, + Dumper::toHtml($obj), +); diff --git a/tests/Tracy/Dumper.toHtml().see.phpt b/tests/Tracy/Dumper.toHtml().see.phpt index 1a36cd948..c85812127 100644 --- a/tests/Tracy/Dumper.toHtml().see.phpt +++ b/tests/Tracy/Dumper.toHtml().see.phpt @@ -39,61 +39,63 @@ $var = [ $file, ]; -Assert::match(<<<'XX' -
array (8)
-
0 => Test #%d% -
| a: array (1) -
| | 1 => array (1) -
| | | 2 => array (1) … -
'a' => stdClass #%d% -
| b: array (1) -
| | 'c' => array (5) -
| | | 0 => Test #%d% see below - | | | 1 => Test #%d% … - | | | 2 => &%d% array (1) see below - | | | 3 => array (1) … - | | | 4 => stream resource @%d% -
| | | | timed_out: false - | | | | blocked: true - | | | | eof: false - | | | | wrapper_type: 'plainfile' - | | | | stream_type: 'STDIO' - | | | | mode: 'r' - | | | | unread_bytes: 0 - | | | | seekable: true - | | | | uri: '%a%' -
| 0: Test #%d% see below - | 1: Test #%d% see above - | 2: Test #%d% -
| | a: array (1) -
| | | 1 => array (1) … -
| 3: &1 array (1) see below - | 4: array (1) -
| | 1 => array (1) -
| | | 2 => array (1) … -
| 5: stream resource @%d% see above -
1 => Test #%d% -
| a: array (1) -
| | 1 => array (1) -
| | | 2 => array (1) … -
2 => Test #%d% see above - 3 => Test #%d% -
| a: array (1) -
| | 1 => array (1) -
| | | 2 => array (1) … -
4 => &1 array (1) -
| 1 => array (1) -
| | 2 => array (1) -
| | | 3 => 'item' -
5 => array (1) -
| 1 => array (1) -
| | 2 => array (1) -
| | | 3 => 'item' -
6 => stream resource @%d% see above -
-XX - , Dumper::toHtml($var, [Dumper::DEPTH => 4, Dumper::LAZY => false])); +Assert::match( + <<<'XX' +
array (8)
+		
0 => Test #%d% +
| a: array (1) +
| | 1 => array (1) +
| | | 2 => array (1) … +
'a' => stdClass #%d% +
| b: array (1) +
| | 'c' => array (5) +
| | | 0 => Test #%d% see below + | | | 1 => Test #%d% … + | | | 2 => &%d% array (1) see below + | | | 3 => array (1) … + | | | 4 => stream resource @%d% +
| | | | timed_out: false + | | | | blocked: true + | | | | eof: false + | | | | wrapper_type: 'plainfile' + | | | | stream_type: 'STDIO' + | | | | mode: 'r' + | | | | unread_bytes: 0 + | | | | seekable: true + | | | | uri: '%a%' +
| 0: Test #%d% see below + | 1: Test #%d% see above + | 2: Test #%d% +
| | a: array (1) +
| | | 1 => array (1) … +
| 3: &1 array (1) see below + | 4: array (1) +
| | 1 => array (1) +
| | | 2 => array (1) … +
| 5: stream resource @%d% see above +
1 => Test #%d% +
| a: array (1) +
| | 1 => array (1) +
| | | 2 => array (1) … +
2 => Test #%d% see above + 3 => Test #%d% +
| a: array (1) +
| | 1 => array (1) +
| | | 2 => array (1) … +
4 => &1 array (1) +
| 1 => array (1) +
| | 2 => array (1) +
| | | 3 => 'item' +
5 => array (1) +
| 1 => array (1) +
| | 2 => array (1) +
| | | 3 => 'item' +
6 => stream resource @%d% see above +
+ XX, + Dumper::toHtml($var, [Dumper::DEPTH => 4, Dumper::LAZY => false]), +); // no above or below in lazy mode @@ -108,16 +110,18 @@ $var = [ $obj2, ]; -Assert::match(<<<'XX' -
array (4)
-
0 => Test #%d% -
| a: array (1) -
'a' => stdClass #%d% -
| b: array (1) -
1 => Test #%d% -
| a: array (1) -
2 => Test #%d% -
-XX - , Dumper::toHtml($var, [Dumper::DEPTH => 4])); +Assert::match( + <<<'XX' +
array (4)
+		
0 => Test #%d% +
| a: array (1) +
'a' => stdClass #%d% +
| b: array (1) +
1 => Test #%d% +
| a: array (1) +
2 => Test #%d% +
+ XX, + Dumper::toHtml($var, [Dumper::DEPTH => 4]), +); diff --git a/tests/Tracy/Dumper.toHtml().snapshot.phpt b/tests/Tracy/Dumper.toHtml().snapshot.phpt index b05978efc..19b348a2f 100644 --- a/tests/Tracy/Dumper.toHtml().snapshot.phpt +++ b/tests/Tracy/Dumper.toHtml().snapshot.phpt @@ -35,22 +35,24 @@ Assert::same([], $snapshot[0]); // snapshot dump of array -Assert::match(<<<'XX' -

-XX
-	, Dumper::toHtml([null, true, false, 0, 0.0, 'string', "'&\"", "\x00", INF, -INF, NAN], $options));
+Assert::match(
+	<<<'XX'
+		

+		XX,
+	Dumper::toHtml([null, true, false, 0, 0.0, 'string', "'&\"", "\x00", INF, -INF, NAN], $options),
+);
 
 
 // snapshot dump of object
 Assert::match(
 	'
',
-	Dumper::toHtml(new stdClass, $options)
+	Dumper::toHtml(new stdClass, $options),
 );
 
 // twice with different identity
 Assert::match(
 	'
',
-	Dumper::toHtml(new stdClass, $options) // different object
+	Dumper::toHtml(new stdClass, $options), // different object
 );
 Assert::equal([
 	['object' => 'stdClass', 'items' => []],
@@ -66,7 +68,7 @@ Assert::match('
null
 $snapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml(fopen(__FILE__, 'r'), $options)
+	Dumper::toHtml(fopen(__FILE__, 'r'), $options),
 );
 Assert::count(1, $snapshot[0]);
 
@@ -75,7 +77,7 @@ Assert::count(1, $snapshot[0]);
 $snapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true])
+	Dumper::toHtml(new Test, $options + [Dumper::COLLAPSE => true]),
 );
 
 
@@ -83,7 +85,7 @@ Assert::match(
 $snapshot = [];
 Assert::match(
 	'
',
-	Dumper::toHtml(new Test, $options)
+	Dumper::toHtml(new Test, $options),
 );
 
 Assert::equal([
@@ -100,12 +102,14 @@ Assert::equal([
 
 // snapshot & location
 $snapshot = [];
-Assert::match(<<<'XX'
-
Dumper::toHtml(new Test, $options + ['location' =>  N_CLASS])) 📍
-XX - , Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS])); +Assert::match( + <<<'XX' +
Dumper::toHtml(new Test, $options + ['location' =>  ON_CLASS]) 📍
+ XX, + Dumper::toHtml(new Test, $options + ['location' => Dumper::LOCATION_SOURCE | Dumper::LOCATION_CLASS]), +); Assert::equal([ [ @@ -130,7 +134,7 @@ $arr = [1, 2, 3]; $arr[] = &$arr; Assert::match( '
',
-	Dumper::toHtml($arr, $options)
+	Dumper::toHtml($arr, $options),
 );
 Assert::equal([
 	[
@@ -144,7 +148,7 @@ $obj = new stdClass;
 $obj->x = $obj;
 Assert::match(
 	'
',
-	Dumper::toHtml($obj, $options)
+	Dumper::toHtml($obj, $options),
 );
 
 
@@ -153,7 +157,7 @@ $snapshot = [];
 $arr = [1, [2, [3, [4, [5, [6]]]]], 3];
 Assert::match(
 	'
',
-	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4])
+	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]),
 );
 Assert::same([], $snapshot[0]);
 
@@ -161,7 +165,7 @@ Assert::same([], $snapshot[0]);
 $arr = [1, [2, [3, [4, []]]], 3];
 Assert::match(
 	'
',
-	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4])
+	Dumper::toHtml($arr, $options + [Dumper::DEPTH => 4]),
 );
 Assert::same([], $snapshot[0]);
 
@@ -174,7 +178,7 @@ $obj->a->b->c->d = new stdClass;
 $obj->a->b->c->d->e = new stdClass;
 Assert::match(
 	'
',
-	Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4])
+	Dumper::toHtml($obj, $options + [Dumper::DEPTH => 4]),
 );
 
 
@@ -183,10 +187,10 @@ $a = ['a'];
 $b = ['b'];
 Assert::match(
 	'
',
-	Dumper::toHtml([&$a, &$b], $options)
+	Dumper::toHtml([&$a, &$b], $options),
 );
 
 Assert::match(
 	'
',
-	Dumper::toHtml([&$b, &$a], $options)
+	Dumper::toHtml([&$b, &$a], $options),
 );
diff --git a/tests/Tracy/Dumper.toHtml().specialChars.phpt b/tests/Tracy/Dumper.toHtml().specialChars.phpt
index fe444f711..140305b76 100644
--- a/tests/Tracy/Dumper.toHtml().specialChars.phpt
+++ b/tests/Tracy/Dumper.toHtml().specialChars.phpt
@@ -12,32 +12,33 @@ use Tracy\Dumper;
 require __DIR__ . '/../bootstrap.php';
 
 
-Assert::match(<<<'XX'
-
array (14)
-
0 => '' - 1 => ' ' - 2 => '\x00' - 3 => '\xFF' - 4 => 'Iñtërnâtiônàlizætiøn' - 5 => string -
| 'utf \n - | \r\t \e\x00 Iñtër\n' -
6 => 'utf \n\r\t\xab Iñtër' - 7 => string -
| 'binary \n - | \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' -
8 => 'binary \n\r\t\xab I\xC3\xB1t\xC3\xABr \xA0' - 'utf \n\r\t\xab Iñtër' => 1 - 'utf \n - \r\t \e\x00 Iñtër' => 2 - 'utf \n - \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' => 3 - '<div> &amp;' => '<div> &amp;' - 9 => '\u{FEFF}' -
-XX - , Dumper::toHtml([ +Assert::match( + <<<'XX' +
array (14)
+		
0 => '' + 1 => ' ' + 2 => '\x00' + 3 => '\xFF' + 4 => 'Iñtërnâtiônàlizætiøn' + 5 => string +
| 'utf \n + | \r\t \e\x00 Iñtër\n' +
6 => 'utf \n\r\t\xab Iñtër' + 7 => string +
| 'binary \n + | \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' +
8 => 'binary \n\r\t\xab I\xC3\xB1t\xC3\xABr \xA0' + 'utf \n\r\t\xab Iñtër' => 1 + 'utf \n + \r\t \e\x00 Iñtër' => 2 + 'utf \n + \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' => 3 + '<div> &amp;' => '<div> &amp;' + 9 => '\u{FEFF}' +
+ XX, + Dumper::toHtml([ '', ' ', "\x00", @@ -52,4 +53,5 @@ XX "utf \n\r\t\e\x00 Iñtër \xA0" => 3, // binary + control chars in key, '
&' => '
&', // HTML "\xEF\xBB\xBF", // BOM - ], [Dumper::COLLAPSE => false])); + ], [Dumper::COLLAPSE => false]), +); diff --git a/tests/Tracy/Dumper.toHtml().specials.phpt b/tests/Tracy/Dumper.toHtml().specials.phpt index 54f72320f..a4217a3a7 100644 --- a/tests/Tracy/Dumper.toHtml().specials.phpt +++ b/tests/Tracy/Dumper.toHtml().specials.phpt @@ -14,61 +14,75 @@ require __DIR__ . '/../bootstrap.php'; // resource $f = fopen(__FILE__, 'r'); -Assert::match(<<<'XX' -
stream resource @%d%
-
%a%: %a%%A% -XX - , Dumper::toHtml($f)); +Assert::match( + <<<'XX' +
stream resource @%d%
+		
%a%: %a%%A% + XX, + Dumper::toHtml($f), +); fclose($f); -Assert::match(<<<'XX' -
closed resource @%d%
-XX - , Dumper::toHtml($f)); +Assert::match( + <<<'XX' +
closed resource @%d%
+ XX, + Dumper::toHtml($f), +); // closure -Assert::match(<<<'XX' -
Closure() #%d%
-XX - , Dumper::toHtml(function () {})); - - -Assert::match(<<<'XX' -
Closure() #%d%
-
file: '%a%:%d%' -
-XX - , Dumper::toHtml(function () {}, [Dumper::LOCATION => Dumper::LOCATION_CLASS])); - - -Assert::match(<<<'XX' -
Closure($x, $y) #%d%
-
use: $use -
-XX - , Dumper::toHtml(function ($x, int $y = 1) use (&$use) {})); +Assert::match( + <<<'XX' +
Closure() #%d%
+ XX, + Dumper::toHtml(function () {}), +); + + +Assert::match( + <<<'XX' +
Closure() #%d%
+		
file: '%a%:%d%' +
+ XX, + Dumper::toHtml(function () {}, [Dumper::LOCATION => Dumper::LOCATION_CLASS]), +); + + +Assert::match( + <<<'XX' +
Closure($x, $y) #%d%
+		
use: $use +
+ XX, + Dumper::toHtml(function ($x, int $y = 1) use (&$use) {}), +); // new class -Assert::match(<<<'XX' -
class@anonymous #%d%
-XX - , Dumper::toHtml(new class { - })); +Assert::match( + <<<'XX' +
class@anonymous #%d%
+ XX, + Dumper::toHtml(new class { + }), +); // SplFileInfo -Assert::match(<<<'XX' -
SplFileInfo #%d%
-
path: '%a%' -
-XX - , Dumper::toHtml(new SplFileInfo(__FILE__))); +Assert::match( + <<<'XX' +
SplFileInfo #%d%
+		
path: '%a%' +
+ XX, + Dumper::toHtml(new SplFileInfo(__FILE__)), +); // SplObjectStorage @@ -81,33 +95,37 @@ $objStorage[$o2] = 'o2'; $objStorage->next(); $key = $objStorage->key(); -Assert::match(<<<'XX' -
SplObjectStorage #%d%
-
0: array (2) -
| 'object' => stdClass #%d% - | 'data' => 'o1' -
1: array (2) -
| 'object' => stdClass #%d% - | 'data' => 'o2' -
-XX - , Dumper::toHtml($objStorage)); +Assert::match( + <<<'XX' +
SplObjectStorage #%d%
+		
0: array (2) +
| 'object' => stdClass #%d% + | 'data' => 'o1' +
1: array (2) +
| 'object' => stdClass #%d% + | 'data' => 'o2' +
+ XX, + Dumper::toHtml($objStorage), +); Assert::same($key, $objStorage->key()); // ArrayObject $obj = new ArrayObject(['a' => 1, 'b' => 2]); -Assert::match(<<<'XX' -
ArrayObject #%d%
-
storage: array (2) -
| 'a' => 1 - | 'b' => 2 -
-XX - , Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
ArrayObject #%d%
+		
storage: array (2) +
| 'a' => 1 + | 'b' => 2 +
+ XX, + Dumper::toHtml($obj), +); class ArrayObjectChild extends ArrayObject { @@ -115,13 +133,15 @@ class ArrayObjectChild extends ArrayObject } $obj = new ArrayObjectChild(['a' => 1, 'b' => 2]); -Assert::match(<<<'XX' -
ArrayObjectChild #%d%
-
prop: 123 - storage: array (2) -
| 'a' => 1 - | 'b' => 2 -
-XX - , Dumper::toHtml($obj)); +Assert::match( + <<<'XX' +
ArrayObjectChild #%d%
+		
prop: 123 + storage: array (2) +
| 'a' => 1 + | 'b' => 2 +
+ XX, + Dumper::toHtml($obj), +); diff --git a/tests/Tracy/Dumper.toTerminal().phpt b/tests/Tracy/Dumper.toTerminal().phpt index 54957e7bd..18365fe16 100644 --- a/tests/Tracy/Dumper.toTerminal().phpt +++ b/tests/Tracy/Dumper.toTerminal().phpt @@ -16,17 +16,19 @@ require __DIR__ . '/fixtures/DumpClass.php'; Assert::match("\e[1;33mnull\e[0m", Dumper::toTerminal(null)); -Assert::match(<< \e[1;32m1 -\e[1;30m \e[1;32m1\e[0m => \e[1;36m\e[0m'\e[1;36mhello\e[0m'\e[1;36m -\e[1;30m \e[1;32m2\e[0m => \e[1;31marray\e[0m (0) -\e[1;30m \e[1;32m3\e[0m => \e[1;31marray\e[0m (2) -\e[1;30m | \e[1;32m0\e[0m => \e[1;33mtrue -\e[1;30m | \e[1;32m1\e[0m => \e[1;33mnull -\e[0m -XX - , Dumper::toTerminal([1, 'hello', [], [true, null]])); +Assert::match( + << \e[1;32m1 + \e[1;30m \e[1;32m1\e[0m => \e[1;36m\e[0m'\e[1;36mhello\e[0m'\e[1;36m + \e[1;30m \e[1;32m2\e[0m => \e[1;31marray\e[0m (0) + \e[1;30m \e[1;32m3\e[0m => \e[1;31marray\e[0m (2) + \e[1;30m | \e[1;32m0\e[0m => \e[1;33mtrue + \e[1;30m | \e[1;32m1\e[0m => \e[1;33mnull + \e[0m + XX, + Dumper::toTerminal([1, 'hello', [], [true, null]]), +); $obj = new Child; @@ -35,31 +37,35 @@ $obj->{0} = 8; $obj->{1} = 9; $obj->{''} = 10; -Assert::match(<< 1, 'y' => 2]; $arr->z = &$arr; -Assert::match(<< 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework ... Framework' - 0 => array (1) - | 0 => array (1) - | | 0 => array (1) - | | | 'hello' => 'world' - 'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework ... Framework' - 1 => stdClass #%a% - | 0: stdClass #%a% - | | 0: stdClass #%a% - | | | hello: 'world' -XX - , Dumper::toText($arr)); - - -Assert::match(<<<'XX' -array (4) - 'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' - 0 => array (1) - | 0 => array (1) - | | 0 => array (1) - | | | 'hello' => 'world' - 'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' - 1 => stdClass #%a% ... -XX - , Dumper::toText($arr, [Dumper::DEPTH => 0, Dumper::TRUNCATE => 0])); - - -Assert::match(<<<'XX' -array (4) - 'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette ... Framework' - 0 => array (1) - | 0 => array (1) ... - 'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette ... Framework' - 1 => stdClass #%a% - | 0: stdClass #%a% ... -XX - , Dumper::toText($arr, [Dumper::DEPTH => 2, Dumper::TRUNCATE => 50])); +Assert::match( + <<<'XX' + array (4) + 'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework ... Framework' + 0 => array (1) + | 0 => array (1) + | | 0 => array (1) + | | | 'hello' => 'world' + 'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework ... Framework' + 1 => stdClass #%a% + | 0: stdClass #%a% + | | 0: stdClass #%a% + | | | hello: 'world' + XX, + Dumper::toText($arr), +); + + +Assert::match( + <<<'XX' + array (4) + 'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' + 0 => array (1) + | 0 => array (1) + | | 0 => array (1) + | | | 'hello' => 'world' + 'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette FrameworkNette Framework' + 1 => stdClass #%a% ... + XX, + Dumper::toText($arr, [Dumper::DEPTH => 0, Dumper::TRUNCATE => 0]), +); + + +Assert::match( + <<<'XX' + array (4) + 'long' => 'Nette FrameworkNette FrameworkNette FrameworkNette ... Framework' + 0 => array (1) + | 0 => array (1) ... + 'long2' => 'Nette FrameworkNette FrameworkNette FrameworkNette ... Framework' + 1 => stdClass #%a% + | 0: stdClass #%a% ... + XX, + Dumper::toText($arr, [Dumper::DEPTH => 2, Dumper::TRUNCATE => 50]), +); $arr = [1, 2, 3, 4]; -Assert::match(<<<'XX' -array (4) - 0 => 1 - 1 => 2 - 2 => 3 - 3 => 4 -XX - , Dumper::toText($arr, [Dumper::ITEMS => 0])); - -Assert::match(<<<'XX' -array (4) - 0 => 1 - 1 => 2 - 2 => 3 - 3 => 4 -XX - , Dumper::toText($arr, [Dumper::ITEMS => 2])); - -Assert::match(<<<'XX' -stdClass #%d% - 0: 1 - 1: 2 - 2: 3 - 3: 4 -XX - , Dumper::toText((object) $arr, [Dumper::ITEMS => 2])); - -Assert::match(<<<'XX' -array (2) - 0 => array (4) - | 0 => 1 - | 1 => 2 - | ... - 1 => stdClass #%d% - | 0: 1 - | 1: 2 - | ... -XX - , Dumper::toText([$arr, (object) $arr], [Dumper::ITEMS => 2])); +Assert::match( + <<<'XX' + array (4) + 0 => 1 + 1 => 2 + 2 => 3 + 3 => 4 + XX, + Dumper::toText($arr, [Dumper::ITEMS => 0]), +); + +Assert::match( + <<<'XX' + array (4) + 0 => 1 + 1 => 2 + 2 => 3 + 3 => 4 + XX, + Dumper::toText($arr, [Dumper::ITEMS => 2]), +); + +Assert::match( + <<<'XX' + stdClass #%d% + 0: 1 + 1: 2 + 2: 3 + 3: 4 + XX, + Dumper::toText((object) $arr, [Dumper::ITEMS => 2]), +); + +Assert::match( + <<<'XX' + array (2) + 0 => array (4) + | 0 => 1 + | 1 => 2 + | ... + 1 => stdClass #%d% + | 0: 1 + | 1: 2 + | ... + XX, + Dumper::toText([$arr, (object) $arr], [Dumper::ITEMS => 2]), +); diff --git a/tests/Tracy/Dumper.toText().locale.phpt b/tests/Tracy/Dumper.toText().locale.phpt index 3724c2b53..2afe50e0e 100644 --- a/tests/Tracy/Dumper.toText().locale.phpt +++ b/tests/Tracy/Dumper.toText().locale.phpt @@ -14,9 +14,11 @@ require __DIR__ . '/../bootstrap.php'; setlocale(LC_ALL, 'czech'); -Assert::match(<<<'XX' -array (2) - 0 => -10.0 - 1 => 10.3 -XX - , Dumper::toText([-10.0, 10.3])); +Assert::match( + <<<'XX' + array (2) + 0 => -10.0 + 1 => 10.3 + XX, + Dumper::toText([-10.0, 10.3]), +); diff --git a/tests/Tracy/Dumper.toText().nohash.phpt b/tests/Tracy/Dumper.toText().nohash.phpt index 2cec53f63..b215635f0 100644 --- a/tests/Tracy/Dumper.toText().nohash.phpt +++ b/tests/Tracy/Dumper.toText().nohash.phpt @@ -14,39 +14,45 @@ require __DIR__ . '/../bootstrap.php'; $arr = [1, 2, 3]; $arr[] = &$arr; -Assert::match(<<<'XX' -array (4) - 0 => 1 - 1 => 2 - 2 => 3 - 3 => array (4) - | 0 => 1 - | 1 => 2 - | 2 => 3 - | 3 => array (4) RECURSION -XX - , Dumper::toText($arr, [Dumper::HASH => false])); +Assert::match( + <<<'XX' + array (4) + 0 => 1 + 1 => 2 + 2 => 3 + 3 => array (4) + | 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => array (4) RECURSION + XX, + Dumper::toText($arr, [Dumper::HASH => false]), +); $arr = (object) ['x' => 1, 'y' => 2]; $arr->z = &$arr; -Assert::match(<<<'XX' -stdClass - x: 1 - y: 2 - z: stdClass RECURSION -XX - , Dumper::toText($arr, [Dumper::HASH => false])); +Assert::match( + <<<'XX' + stdClass + x: 1 + y: 2 + z: stdClass RECURSION + XX, + Dumper::toText($arr, [Dumper::HASH => false]), +); $obj = (object) ['a' => 1]; -Assert::match(<<<'XX' -array (3) - 0 => stdClass - | a: 1 - 1 => stdClass - | a: 1 - 2 => stdClass - | a: 1 -XX - , Dumper::toText([$obj, $obj, $obj], [Dumper::HASH => false])); +Assert::match( + <<<'XX' + array (3) + 0 => stdClass + | a: 1 + 1 => stdClass + | a: 1 + 2 => stdClass + | a: 1 + XX, + Dumper::toText([$obj, $obj, $obj], [Dumper::HASH => false]), +); diff --git a/tests/Tracy/Dumper.toText().phpt b/tests/Tracy/Dumper.toText().phpt index 2502acc39..6e1f210ce 100644 --- a/tests/Tracy/Dumper.toText().phpt +++ b/tests/Tracy/Dumper.toText().phpt @@ -50,65 +50,73 @@ Assert::same(str_replace( "\r", '', <<<'XX' -array (1) - 0 => 1 + array (1) + 0 => 1 -XX + XX, ), Dumper::toText([1])); -Assert::match(<<<'XX' -array (5) - 0 => 1 - 1 => 'hello' - 2 => array (0) - 3 => array (2) - | 0 => 1 - | 1 => 2 - 4 => array (7) - | 1 => 1 - | 2 => 2 - | 3 => 3 - | 4 => 4 - | 5 => 5 - | 6 => 6 - | 7 => 7 -XX - , Dumper::toText([1, 'hello', [], [1, 2], [1 => 1, 2, 3, 4, 5, 6, 7]])); +Assert::match( + <<<'XX' + array (5) + 0 => 1 + 1 => 'hello' + 2 => array (0) + 3 => array (2) + | 0 => 1 + | 1 => 2 + 4 => array (7) + | 1 => 1 + | 2 => 2 + | 3 => 3 + | 4 => 4 + | 5 => 5 + | 6 => 6 + | 7 => 7 + XX, + Dumper::toText([1, 'hello', [], [1, 2], [1 => 1, 2, 3, 4, 5, 6, 7]]), +); // multiline -Assert::match(<<<'XX' -array (3) - 0 => 'hello' - 1 => string - | 'a\n - | b' - 2 => array (1) - | 0 => string - | | 'a\n - | | b' -XX - , Dumper::toText(['hello', "a\nb", ["a\nb"]])); +Assert::match( + <<<'XX' + array (3) + 0 => 'hello' + 1 => string + | 'a\n + | b' + 2 => array (1) + | 0 => string + | | 'a\n + | | b' + XX, + Dumper::toText(['hello', "a\nb", ["a\nb"]]), +); // object Assert::match('stdClass #%d%', Dumper::toText(new stdClass)); -Assert::match(<<<'XX' -stdClass #%d% - '': 'foo' -XX - , Dumper::toText((object) ['' => 'foo'])); +Assert::match( + <<<'XX' + stdClass #%d% + '': 'foo' + XX, + Dumper::toText((object) ['' => 'foo']), +); -Assert::match(<<<'XX' -Test #%d% - x: array (2) - | 0 => 10 - | 1 => null - y: 'hello' - z: 30.0 -XX - , Dumper::toText(new Test)); +Assert::match( + <<<'XX' + Test #%d% + x: array (2) + | 0 => 10 + | 1 => null + y: 'hello' + z: 30.0 + XX, + Dumper::toText(new Test), +); $obj = new Child; @@ -117,31 +125,35 @@ $obj->{0} = 8; $obj->{1} = 9; $obj->{''} = 10; -Assert::match(<<<'XX' -Child #%d% - new: 7 - 0: 8 - 1: 9 - '': 10 - x: 1 - y: 2 - z: 3 - x2: 4 - y2: 5 - z2: 6 - y: 'hello' -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + Child #%d% + new: 7 + 0: 8 + 1: 9 + '': 10 + x: 1 + y: 2 + z: 3 + x2: 4 + y2: 5 + z2: 6 + y: 'hello' + XX, + Dumper::toText($obj), +); // PHP 7.4 features -Assert::match(<<<'XX' -Test74 #%d% - x: 1 - y: unset - z: unset -XX -, Dumper::toText(new Test74)); +Assert::match( + <<<'XX' + Test74 #%d% + x: 1 + y: unset + z: unset + XX, + Dumper::toText(new Test74), +); $obj = new Child74; @@ -149,14 +161,16 @@ $obj->new = 7; unset($obj->unset1, $obj->unset2); -Assert::match(<<<'XX' -Child74 #%d% - new: 7 - x: 2 - y: unset - z: unset - unset1: unset - unset2: unset - y: unset -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + Child74 #%d% + new: 7 + x: 2 + y: unset + z: unset + unset1: unset + unset2: unset + y: unset + XX, + Dumper::toText($obj), +); diff --git a/tests/Tracy/Dumper.toText().recursion.phpt b/tests/Tracy/Dumper.toText().recursion.phpt index 8aec242df..68d5d0b82 100644 --- a/tests/Tracy/Dumper.toText().recursion.phpt +++ b/tests/Tracy/Dumper.toText().recursion.phpt @@ -14,26 +14,30 @@ require __DIR__ . '/../bootstrap.php'; $arr = [1, 2, 3]; $arr[] = &$arr; -Assert::match(<<<'XX' -array (4) - 0 => 1 - 1 => 2 - 2 => 3 - 3 => &1 array (4) - | 0 => 1 - | 1 => 2 - | 2 => 3 - | 3 => &1 array (4) RECURSION -XX - , Dumper::toText($arr)); +Assert::match( + <<<'XX' + array (4) + 0 => 1 + 1 => 2 + 2 => 3 + 3 => &1 array (4) + | 0 => 1 + | 1 => 2 + | 2 => 3 + | 3 => &1 array (4) RECURSION + XX, + Dumper::toText($arr), +); $arr = (object) ['x' => 1, 'y' => 2]; $arr->z = &$arr; -Assert::match(<<<'XX' -stdClass #%d% - x: 1 - y: 2 - z: &1 stdClass #%d% RECURSION -XX - , Dumper::toText($arr)); +Assert::match( + <<<'XX' + stdClass #%d% + x: 1 + y: 2 + z: &1 stdClass #%d% RECURSION + XX, + Dumper::toText($arr), +); diff --git a/tests/Tracy/Dumper.toText().references.phpt b/tests/Tracy/Dumper.toText().references.phpt index 0324ae8cc..a5936d54f 100644 --- a/tests/Tracy/Dumper.toText().references.phpt +++ b/tests/Tracy/Dumper.toText().references.phpt @@ -17,20 +17,22 @@ $a = 1; $b = 2; $obj = (object) [&$a, $a, &$b, $b, (object) [&$a, &$b], (object) [$a, $b], [&$b, &$a]]; -Assert::match(<<<'XX' -stdClass #%d% - 0: &1 1 - 1: 1 - 2: &2 2 - 3: 2 - 4: stdClass #%d% - | 0: &1 1 - | 1: &2 2 - 5: stdClass #%d% - | 0: 1 - | 1: 2 - 6: array (2) - | 0 => &2 2 - | 1 => &1 1 -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + stdClass #%d% + 0: &1 1 + 1: 1 + 2: &2 2 + 3: 2 + 4: stdClass #%d% + | 0: &1 1 + | 1: &2 2 + 5: stdClass #%d% + | 0: 1 + | 1: 2 + 6: array (2) + | 0 => &2 2 + | 1 => &1 1 + XX, + Dumper::toText($obj), +); diff --git a/tests/Tracy/Dumper.toText().see.phpt b/tests/Tracy/Dumper.toText().see.phpt index 6603ac80c..0174796f1 100644 --- a/tests/Tracy/Dumper.toText().see.phpt +++ b/tests/Tracy/Dumper.toText().see.phpt @@ -40,56 +40,58 @@ $var = [ ]; -Assert::match(<<<'XX' -array (8) - 0 => Test #%d% - | a: array (1) - | | 1 => array (1) - | | | 2 => array (1) ... - 'a' => stdClass #%d% - | b: array (1) - | | 'c' => array (5) - | | | 0 => Test #%d% see below - | | | 1 => Test #%d% ... - | | | 2 => &1 array (1) see below - | | | 3 => array (1) ... - | | | 4 => stream resource @%d% - | | | | timed_out: false - | | | | blocked: true - | | | | eof: false - | | | | wrapper_type: 'plainfile' - | | | | stream_type: 'STDIO' - | | | | mode: 'r' - | | | | unread_bytes: 0 - | | | | seekable: true - | | | | uri: '%a%' - | 0: Test #%d% see below - | 1: Test #%d% see above - | 2: Test #%d% - | | a: array (1) - | | | 1 => array (1) ... - | 3: &1 array (1) see below - | 4: array (1) - | | 1 => array (1) - | | | 2 => array (1) ... - | 5: stream resource @%d% see above - 1 => Test #%d% - | a: array (1) - | | 1 => array (1) - | | | 2 => array (1) ... - 2 => Test #%d% see above - 3 => Test #%d% - | a: array (1) - | | 1 => array (1) - | | | 2 => array (1) ... - 4 => &1 array (1) - | 1 => array (1) - | | 2 => array (1) - | | | 3 => 'item' - 5 => array (1) - | 1 => array (1) - | | 2 => array (1) - | | | 3 => 'item' - 6 => stream resource @%d% see above -XX - , Dumper::toText($var, [Dumper::DEPTH => 4])); +Assert::match( + <<<'XX' + array (8) + 0 => Test #%d% + | a: array (1) + | | 1 => array (1) + | | | 2 => array (1) ... + 'a' => stdClass #%d% + | b: array (1) + | | 'c' => array (5) + | | | 0 => Test #%d% see below + | | | 1 => Test #%d% ... + | | | 2 => &1 array (1) see below + | | | 3 => array (1) ... + | | | 4 => stream resource @%d% + | | | | timed_out: false + | | | | blocked: true + | | | | eof: false + | | | | wrapper_type: 'plainfile' + | | | | stream_type: 'STDIO' + | | | | mode: 'r' + | | | | unread_bytes: 0 + | | | | seekable: true + | | | | uri: '%a%' + | 0: Test #%d% see below + | 1: Test #%d% see above + | 2: Test #%d% + | | a: array (1) + | | | 1 => array (1) ... + | 3: &1 array (1) see below + | 4: array (1) + | | 1 => array (1) + | | | 2 => array (1) ... + | 5: stream resource @%d% see above + 1 => Test #%d% + | a: array (1) + | | 1 => array (1) + | | | 2 => array (1) ... + 2 => Test #%d% see above + 3 => Test #%d% + | a: array (1) + | | 1 => array (1) + | | | 2 => array (1) ... + 4 => &1 array (1) + | 1 => array (1) + | | 2 => array (1) + | | | 3 => 'item' + 5 => array (1) + | 1 => array (1) + | | 2 => array (1) + | | | 3 => 'item' + 6 => stream resource @%d% see above + XX, + Dumper::toText($var, [Dumper::DEPTH => 4]), +); diff --git a/tests/Tracy/Dumper.toText().specialChars.phpt b/tests/Tracy/Dumper.toText().specialChars.phpt index 9aa1db39c..0aba0ee78 100644 --- a/tests/Tracy/Dumper.toText().specialChars.phpt +++ b/tests/Tracy/Dumper.toText().specialChars.phpt @@ -12,30 +12,31 @@ use Tracy\Dumper; require __DIR__ . '/../bootstrap.php'; -Assert::match(<<<'XX' -array (14) - 0 => '' - 1 => ' ' - 2 => '\x00' - 3 => '\xFF' - 4 => 'Iñtërnâtiônàlizætiøn' - 5 => string - | 'utf \n - | \r\t \e\x00 Iñtër\n' - 6 => 'utf \n\r\t\xab Iñtër' - 7 => string - | 'binary \n - | \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' - 8 => 'binary \n\r\t\xab I\xC3\xB1t\xC3\xABr \xA0' - 'utf \n\r\t\xab Iñtër' => 1 - 'utf \n - \r\t \e\x00 Iñtër' => 2 - 'utf \n - \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' => 3 - '
&' => '
&' - 9 => '\u{FEFF}' -XX - , Dumper::toText([ +Assert::match( + <<<'XX' + array (14) + 0 => '' + 1 => ' ' + 2 => '\x00' + 3 => '\xFF' + 4 => 'Iñtërnâtiônàlizætiøn' + 5 => string + | 'utf \n + | \r\t \e\x00 Iñtër\n' + 6 => 'utf \n\r\t\xab Iñtër' + 7 => string + | 'binary \n + | \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' + 8 => 'binary \n\r\t\xab I\xC3\xB1t\xC3\xABr \xA0' + 'utf \n\r\t\xab Iñtër' => 1 + 'utf \n + \r\t \e\x00 Iñtër' => 2 + 'utf \n + \r\t \e\x00 I\xC3\xB1t\xC3\xABr \xA0' => 3 + '
&' => '
&' + 9 => '\u{FEFF}' + XX, + Dumper::toText([ '', ' ', "\x00", @@ -50,4 +51,5 @@ XX "utf \n\r\t\e\x00 Iñtër \xA0" => 3, // binary + control chars in key '
&' => '
&', // HTML "\xEF\xBB\xBF", // BOM - ])); + ]), +); diff --git a/tests/Tracy/Dumper.toText().specials.dom.phpt b/tests/Tracy/Dumper.toText().specials.dom.phpt index e63f84702..b964d0896 100644 --- a/tests/Tracy/Dumper.toText().specials.dom.phpt +++ b/tests/Tracy/Dumper.toText().specials.dom.phpt @@ -21,117 +21,127 @@ $namedNodeMap = $nodeList->item(0)->attributes; $element = $nodeList->item(0); -Assert::match(<<<'XX' -DOMDocument #%d% - actualEncoding: null - attributes: null - baseURI: null -%A% - doctype: DOMDocumentType #%d% - | attributes: null - | baseURI: null - | childNodes: %a% - | entities: DOMNamedNodeMap #%d% ... - | firstChild: null - | internalSubset: null - | lastChild: null - | localName: null - | name: 'html' - | namespaceURI: null - | nextSibling: DOMElement #%d% see below - | nodeName: 'html' - | nodeType: 10 - | nodeValue: null - | notations: DOMNamedNodeMap #%d% ... - | ownerDocument: DOMDocument #%d% RECURSION - | parentNode: DOMDocument #%d% RECURSION - | prefix: '' - | previousSibling: null - | publicId: '' - | systemId: '' - | textContent: '' - documentElement: DOMElement #%d% - | attributes: DOMNamedNodeMap #%d% ... -%A% - localName: null - namespaceURI: null - nextSibling: null - nodeName: '#document' - nodeType: 13 - nodeValue: null - ownerDocument: null - parentNode: null - prefix: '' - preserveWhiteSpace: true - previousSibling: null - recover: false - resolveExternals: false - standalone: true - strictErrorChecking: true - substituteEntities: false - textContent: 'Ahoj' - validateOnParse: false - version: null - xmlEncoding: null - xmlStandalone: true - xmlVersion: null -XX - , Dumper::toText($dom, [Dumper::DEPTH => 2])); - - -Assert::match(<<<'XX' -DOMNodeList #%d% - length: 1 - items: array (1) - | 0 => DOMElement #%d% ... -XX - , Dumper::toText($nodeList, [Dumper::DEPTH => 2])); - - -Assert::match(<<<'XX' -DOMNamedNodeMap #%d% - length: 1 - items: array (1) - | 'class' => DOMAttr #%d% - | | attributes: null - | | baseURI: null - | | childNodes: DOMNodeList #%d% ... - | | firstChild: DOMText #%d% ... - | | lastChild: DOMText #%d% ... - | | localName: 'class' - | | name: 'class' - | | namespaceURI: null - | | nextSibling: null - | | nodeName: 'class' - | | nodeType: 2 - | | nodeValue: 'a' - | | ownerDocument: DOMDocument #%d% ... - | | ownerElement: DOMElement #%d% ... - | | parentNode: DOMElement #%d% ... - | | prefix: '' - | | previousSibling: null - | | schemaTypeInfo: null - | | specified: true - | | textContent: 'a' - | | value: 'a' -XX - , Dumper::toText($namedNodeMap, [Dumper::DEPTH => 3])); - - -Assert::match(<<<'XX' -DOMElement #%d% - attributes: DOMNamedNodeMap #%d% ... - baseURI: null -%A% - previousSibling: null - schemaTypeInfo: null - tagName: 'li' - textContent: 'Ahoj' -XX - , Dumper::toText($element, [Dumper::DEPTH => 1])); - - -Assert::match(<<<'XX' -DOMXPath #%d%%A% -XX - , Dumper::toText($xpath, [Dumper::DEPTH => 1])); +Assert::match( + <<<'XX' + DOMDocument #%d% + actualEncoding: null + attributes: null + baseURI: null + %A% + doctype: DOMDocumentType #%d% + | attributes: null + | baseURI: null + | childNodes: %a% + | entities: DOMNamedNodeMap #%d% ... + | firstChild: null + | internalSubset: null + | lastChild: null + | localName: null + | name: 'html' + | namespaceURI: null + | nextSibling: DOMElement #%d% see below + | nodeName: 'html' + | nodeType: 10 + | nodeValue: null + | notations: DOMNamedNodeMap #%d% ... + | ownerDocument: DOMDocument #%d% RECURSION + | parentNode: DOMDocument #%d% RECURSION + | prefix: '' + | previousSibling: null + | publicId: '' + | systemId: '' + | textContent: '' + documentElement: DOMElement #%d% + | attributes: DOMNamedNodeMap #%d% ... + %A% + localName: null + namespaceURI: null + nextSibling: null + nodeName: '#document' + nodeType: 13 + nodeValue: null + ownerDocument: null + parentNode: null + prefix: '' + preserveWhiteSpace: true + previousSibling: null + recover: false + resolveExternals: false + standalone: true + strictErrorChecking: true + substituteEntities: false + textContent: 'Ahoj' + validateOnParse: false + version: null + xmlEncoding: null + xmlStandalone: true + xmlVersion: null + XX, + Dumper::toText($dom, [Dumper::DEPTH => 2]), +); + + +Assert::match( + <<<'XX' + DOMNodeList #%d% + length: 1 + items: array (1) + | 0 => DOMElement #%d% ... + XX, + Dumper::toText($nodeList, [Dumper::DEPTH => 2]), +); + + +Assert::match( + <<<'XX' + DOMNamedNodeMap #%d% + length: 1 + items: array (1) + | 'class' => DOMAttr #%d% + | | attributes: null + | | baseURI: null + | | childNodes: DOMNodeList #%d% ... + | | firstChild: DOMText #%d% ... + | | lastChild: DOMText #%d% ... + | | localName: 'class' + | | name: 'class' + | | namespaceURI: null + | | nextSibling: null + | | nodeName: 'class' + | | nodeType: 2 + | | nodeValue: 'a' + | | ownerDocument: DOMDocument #%d% ... + | | ownerElement: DOMElement #%d% ... + | | parentNode: DOMElement #%d% ... + | | prefix: '' + | | previousSibling: null + | | schemaTypeInfo: null + | | specified: true + | | textContent: 'a' + | | value: 'a' + XX, + Dumper::toText($namedNodeMap, [Dumper::DEPTH => 3]), +); + + +Assert::match( + <<<'XX' + DOMElement #%d% + attributes: DOMNamedNodeMap #%d% ... + baseURI: null + %A% + previousSibling: null + schemaTypeInfo: null + tagName: 'li' + textContent: 'Ahoj' + XX, + Dumper::toText($element, [Dumper::DEPTH => 1]), +); + + +Assert::match( + <<<'XX' + DOMXPath #%d%%A% + XX, + Dumper::toText($xpath, [Dumper::DEPTH => 1]), +); diff --git a/tests/Tracy/Dumper.toText().specials.ds.phpt b/tests/Tracy/Dumper.toText().specials.ds.phpt index a99533276..b2460650b 100644 --- a/tests/Tracy/Dumper.toText().specials.ds.phpt +++ b/tests/Tracy/Dumper.toText().specials.ds.phpt @@ -14,19 +14,23 @@ require __DIR__ . '/../bootstrap.php'; $collection = new Ds\Vector(['value']); -Assert::match(<<<'XX' -Ds\Vector #%d% - 0: 'value' -XX - , Dumper::toText($collection)); +Assert::match( + <<<'XX' + Ds\Vector #%d% + 0: 'value' + XX, + Dumper::toText($collection), +); $map = new Ds\Map; $map->put('key', 'value'); -Assert::match(<<<'XX' -Ds\Map #%d% - 0: Ds\Pair #%d% - | key: 'key' - | value: 'value' -XX - , Dumper::toText($map)); +Assert::match( + <<<'XX' + Ds\Map #%d% + 0: Ds\Pair #%d% + | key: 'key' + | value: 'value' + XX, + Dumper::toText($map), +); diff --git a/tests/Tracy/Dumper.toText().specials.enum.phpt b/tests/Tracy/Dumper.toText().specials.enum.phpt index 2bdc78e04..10c522ae6 100644 --- a/tests/Tracy/Dumper.toText().specials.enum.phpt +++ b/tests/Tracy/Dumper.toText().specials.enum.phpt @@ -27,11 +27,13 @@ enum Methods: string case POST = 'post'; } -Assert::match(<<<'XX' -array (3) - 0 => Suit::Clubs #%d% - 1 => Methods::GET #%d% - | value: 'get' - 2 => Methods::GET #%d% see above -XX - , Dumper::toText([Suit::Clubs, Methods::GET, Methods::GET])); +Assert::match( + <<<'XX' + array (3) + 0 => Suit::Clubs #%d% + 1 => Methods::GET #%d% + | value: 'get' + 2 => Methods::GET #%d% see above + XX, + Dumper::toText([Suit::Clubs, Methods::GET, Methods::GET]), +); diff --git a/tests/Tracy/Dumper.toText().specials.fiber.phpt b/tests/Tracy/Dumper.toText().specials.fiber.phpt index 0a8361b7e..285e4de3a 100644 --- a/tests/Tracy/Dumper.toText().specials.fiber.phpt +++ b/tests/Tracy/Dumper.toText().specials.fiber.phpt @@ -20,12 +20,14 @@ $fiber = new Fiber(function (): void { Assert::match('Fiber (not started) #%d%', Dumper::toText($fiber)); $fiber->start(); -Assert::match(<<<'XX' -Fiber #%d% - file: '%a%:%d%' - callable: Closure() #%d% -XX - , Dumper::toText($fiber)); +Assert::match( + <<<'XX' + Fiber #%d% + file: '%a%:%d%' + callable: Closure() #%d% + XX, + Dumper::toText($fiber), +); $fiber->resume(); Assert::match('Fiber (terminated) #%d%', Dumper::toText($fiber)); diff --git a/tests/Tracy/Dumper.toText().specials.generator.phpt b/tests/Tracy/Dumper.toText().specials.generator.phpt index 555ed9e71..18b08a5b9 100644 --- a/tests/Tracy/Dumper.toText().specials.generator.phpt +++ b/tests/Tracy/Dumper.toText().specials.generator.phpt @@ -20,12 +20,14 @@ function gen() $gen = gen(); -Assert::match(<<<'XX' -Generator #%d% - file: '%a%:%d%' - this: null -XX - , Dumper::toText($gen)); +Assert::match( + <<<'XX' + Generator #%d% + file: '%a%:%d%' + this: null + XX, + Dumper::toText($gen), +); $gen->next(); Assert::match('Generator (terminated) #%d%', Dumper::toText($gen)); @@ -40,9 +42,11 @@ function gen2() $gen = gen2(); -Assert::match(<<<'XX' -Generator #%d% - file: '%a%:%d%' - this: null -XX - , Dumper::toText($gen)); +Assert::match( + <<<'XX' + Generator #%d% + file: '%a%:%d%' + this: null + XX, + Dumper::toText($gen), +); diff --git a/tests/Tracy/Dumper.toText().specials.phpt b/tests/Tracy/Dumper.toText().specials.phpt index 0dc5dca2b..16e5784ca 100644 --- a/tests/Tracy/Dumper.toText().specials.phpt +++ b/tests/Tracy/Dumper.toText().specials.phpt @@ -21,19 +21,23 @@ Assert::match('closed resource @%d%', Dumper::toText($f)); // closure -Assert::match(<<<'XX' -Closure() #%d% -XX - , Dumper::toText(function () {})); +Assert::match( + <<<'XX' + Closure() #%d% + XX, + Dumper::toText(function () {}), +); -Assert::match(<<<'XX' -Closure($x, $y) #%d% - file: '%a%:%d%' - use: $use - | $use: null -XX - , Dumper::toText(function ($x, int $y = 1) use (&$use) {}, [Dumper::LOCATION => Dumper::LOCATION_CLASS])); +Assert::match( + <<<'XX' + Closure($x, $y) #%d% + file: '%a%:%d%' + use: $use + | $use: null + XX, + Dumper::toText(function ($x, int $y = 1) use (&$use) {}, [Dumper::LOCATION => Dumper::LOCATION_CLASS]), +); // new class @@ -57,30 +61,34 @@ $objStorage[$o2] = 'o2'; $objStorage->next(); $key = $objStorage->key(); -Assert::match(<<<'XX' -SplObjectStorage #%d% - 0: array (2) - | 'object' => stdClass #%d% - | 'data' => 'o1' - 1: array (2) - | 'object' => stdClass #%d% - | | foo: 'bar' - | 'data' => 'o2' -XX - , Dumper::toText($objStorage)); +Assert::match( + <<<'XX' + SplObjectStorage #%d% + 0: array (2) + | 'object' => stdClass #%d% + | 'data' => 'o1' + 1: array (2) + | 'object' => stdClass #%d% + | | foo: 'bar' + | 'data' => 'o2' + XX, + Dumper::toText($objStorage), +); Assert::same($key, $objStorage->key()); // ArrayObject $obj = new ArrayObject(['a' => 1, 'b' => 2]); -Assert::match(<<<'XX' -ArrayObject #%d% - storage: array (2) - | 'a' => 1 - | 'b' => 2 -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + ArrayObject #%d% + storage: array (2) + | 'a' => 1 + | 'b' => 2 + XX, + Dumper::toText($obj), +); class ArrayObjectChild extends ArrayObject { @@ -88,11 +96,13 @@ class ArrayObjectChild extends ArrayObject } $obj = new ArrayObjectChild(['a' => 1, 'b' => 2]); -Assert::match(<<<'XX' -ArrayObjectChild #%d% - prop: 123 - storage: array (2) - | 'a' => 1 - | 'b' => 2 -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + ArrayObjectChild #%d% + prop: 123 + storage: array (2) + | 'a' => 1 + | 'b' => 2 + XX, + Dumper::toText($obj), +); diff --git a/tests/Tracy/dump().html.phpt b/tests/Tracy/dump().html.phpt index 0d424fc24..61e14f5da 100644 --- a/tests/Tracy/dump().html.phpt +++ b/tests/Tracy/dump().html.phpt @@ -20,15 +20,17 @@ test('html mode', function () { setHtmlMode(); ob_start(); dump(123); - Assert::match(<<<'XX' - - -
dump(123) 📍123
-
-XX - , ob_get_clean()); + Assert::match( + <<<'XX' + + +
dump(123) 📍123
+
+ XX, + ob_get_clean(), + ); }); @@ -37,13 +39,15 @@ test('dark theme', function () { ob_start(); dump(123); - Assert::match(<<<'XX' -
dump(123) 📍123
-
-XX - , ob_get_clean()); + Assert::match( + <<<'XX' +
dump(123) 📍123
+
+ XX, + ob_get_clean(), + ); }); From 9c5046008a5ece89e300fd1aa6d424e66e1d04fa Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 7 Apr 2022 18:06:37 +0200 Subject: [PATCH 09/22] coding style: reformatted Assert::exception --- tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt | 31 ++++++++++--------- tests/Tracy/Debugger.log().error.phpt | 16 ++++++---- tests/Tracy/Logger.log().errors.phpt | 22 +++++++------ 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt b/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt index 44d8db727..20b87966a 100644 --- a/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt +++ b/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt @@ -39,17 +39,20 @@ class TestClass $obj = new TestClass; -Assert::exception(function () use ($obj) { - // Invalid argument #1 - $obj->test1('hello'); -}, TypeError::class, 'Argument 1 passed to TestClass::test1() must be %a% array, string given, called in %a%'); - -Assert::exception(function () use ($obj) { - // Invalid argument #2 - $obj->test2('hello'); -}, TypeError::class, 'Argument 1 passed to TestClass::test2() must be an instance of TestClass, string given, called in %a%'); - -Assert::exception(function () use ($obj) { - // Invalid toString - echo $obj; -}, ErrorException::class, 'Method TestClass::__toString() must return a string value'); +Assert::exception( + fn() => $obj->test1('hello'), + TypeError::class, + 'Argument 1 passed to TestClass::test1() must be %a% array, string given, called in %a%', +); + +Assert::exception( + fn() => $obj->test2('hello'), + TypeError::class, + 'Argument 1 passed to TestClass::test2() must be an instance of TestClass, string given, called in %a%', +); + +Assert::exception( + fn() => (string) $obj, + ErrorException::class, + 'Method TestClass::__toString() must return a string value', +); diff --git a/tests/Tracy/Debugger.log().error.phpt b/tests/Tracy/Debugger.log().error.phpt index 319f30c6a..f1488f754 100644 --- a/tests/Tracy/Debugger.log().error.phpt +++ b/tests/Tracy/Debugger.log().error.phpt @@ -12,9 +12,11 @@ use Tracy\Debugger; require __DIR__ . '/../bootstrap.php'; -Assert::exception(function () { - Debugger::log('Hello'); -}, LogicException::class, 'Logging directory is not specified.'); +Assert::exception( + fn() => Debugger::log('Hello'), + LogicException::class, + 'Logging directory is not specified.', +); // no error @@ -23,6 +25,8 @@ Debugger::log('Hello'); Debugger::$logDirectory = getTempDir() . '/unknown'; -Assert::exception(function () { - Debugger::log('Hello'); -}, RuntimeException::class, "Logging directory '%a%' is not found or is not directory."); +Assert::exception( + fn() => Debugger::log('Hello'), + RuntimeException::class, + "Logging directory '%a%' is not found or is not directory.", +); diff --git a/tests/Tracy/Logger.log().errors.phpt b/tests/Tracy/Logger.log().errors.phpt index 05807c0c9..238e325da 100644 --- a/tests/Tracy/Logger.log().errors.phpt +++ b/tests/Tracy/Logger.log().errors.phpt @@ -16,14 +16,18 @@ $logger = new Logger(getTempDir()); $logger->log('Hello'); // no error -Assert::exception(function () { - $logger = new Logger(getTempDir() . '/unknown'); - $logger->log('Hello'); -}, RuntimeException::class, "Logging directory '%a%' is not found or is not directory."); +$logger = new Logger(getTempDir() . '/unknown'); +Assert::exception( + fn() => $logger->log('Hello'), + RuntimeException::class, + "Logging directory '%a%' is not found or is not directory.", +); -Assert::exception(function () { - $logger = new Logger(getTempDir()); - mkdir(getTempDir() . '/test.log'); - $logger->log('Hello', 'test'); -}, RuntimeException::class, "Unable to write to log file '%a%'. Is directory writable?"); +$logger = new Logger(getTempDir()); +mkdir(getTempDir() . '/test.log'); +Assert::exception( + fn() => $logger->log('Hello', 'test'), + RuntimeException::class, + "Unable to write to log file '%a%'. Is directory writable?", +); From 3a73e38fb460b20ee014ce72301d455e0b204197 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 5 Dec 2022 01:21:34 +0100 Subject: [PATCH 10/22] uses PascalCase constants --- src/Bridges/Nette/TracyExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bridges/Nette/TracyExtension.php b/src/Bridges/Nette/TracyExtension.php index c2e39ebe5..4a14c0def 100644 --- a/src/Bridges/Nette/TracyExtension.php +++ b/src/Bridges/Nette/TracyExtension.php @@ -130,7 +130,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) if ($this->debugMode) { foreach ($this->config->bar as $item) { if (is_string($item) && substr($item, 0, 1) === '@') { - $item = new Statement(['@' . $builder::THIS_CONTAINER, 'getService'], [substr($item, 1)]); + $item = new Statement(['@' . $builder::ThisContainer, 'getService'], [substr($item, 1)]); } elseif (is_string($item)) { $item = new Statement($item); } From 380d7499bdfa9bcf8d3d3dae7fd95538f185955d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 12 Dec 2021 07:21:06 +0100 Subject: [PATCH 11/22] used native PHP 8 functions --- src/Tracy/BlueScreen/BlueScreen.php | 4 ++-- src/Tracy/BlueScreen/assets/section-exception-exception.phtml | 2 +- src/Tracy/Debugger/Debugger.php | 2 +- src/Tracy/Logger/FireLogger.php | 2 +- tools/create-phar/create-phar.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index a1666920e..4c022dcc7 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -159,7 +159,7 @@ private function renderTemplate(\Throwable $exception, string $template, $toScre [$generators, $fibers] = $this->findGeneratorsAndFibers($exception); $headersSent = headers_sent($headersFile, $headersLine); $obStatus = Debugger::$obStatus; - $showEnvironment = $this->showEnvironment && (strpos($exception->getMessage(), 'Allowed memory size') === false); + $showEnvironment = $this->showEnvironment && (!str_contains($exception->getMessage(), 'Allowed memory size')); $info = array_filter($this->info); $source = Helpers::getSource(); $title = $exception instanceof \ErrorException @@ -538,7 +538,7 @@ private function renderPhpInfo(): void @phpinfo(INFO_CONFIGURATION | INFO_MODULES); // @ phpinfo may be disabled $info = ob_get_clean(); - if (strpos($license, '', Helpers::escapeHtml($info), '
'; } else { $info = str_replace(' diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index b6e9380f3..5e48f200a 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -320,7 +320,7 @@ public static function exceptionHandler(\Throwable $exception): void self::$obStatus = ob_get_status(true); if (!headers_sent()) { - http_response_code(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') !== false ? 503 : 500); + http_response_code(isset($_SERVER['HTTP_USER_AGENT']) && str_contains($_SERVER['HTTP_USER_AGENT'], 'MSIE ') ? 503 : 500); } Helpers::improveException($exception); diff --git a/src/Tracy/Logger/FireLogger.php b/src/Tracy/Logger/FireLogger.php index afad35aeb..fd606d10a 100644 --- a/src/Tracy/Logger/FireLogger.php +++ b/src/Tracy/Logger/FireLogger.php @@ -155,7 +155,7 @@ private function jsonDump(&$var, int $level = 0) return " \xE2\x80\xA6 "; } } elseif (is_object($var)) { - $arr = (array) $var; + $arr = get_mangled_object_vars($var); static $list = []; if (in_array($var, $list, true)) { return "\xE2\x80\xA6RECURSION\xE2\x80\xA6"; diff --git a/tools/create-phar/create-phar.php b/tools/create-phar/create-phar.php index f1c1af0c4..58af56d35 100644 --- a/tools/create-phar/create-phar.php +++ b/tools/create-phar/create-phar.php @@ -47,7 +47,7 @@ function compressCss(string $s): string echo "adding: {$iterator->getSubPathname()}\n"; $s = file_get_contents($file->getPathname()); - if (strpos($s, '@tracySkipLocation') === false) { + if (!str_contains($s, '@tracySkipLocation')) { $s = php_strip_whitespace($file->getPathname()); } @@ -61,7 +61,7 @@ function compressCss(string $s): string $s = preg_replace_callback('#(<(script|style).*(?)(.*)( Date: Mon, 9 May 2022 15:50:03 +0200 Subject: [PATCH 12/22] Dumper: uses get_mangled_object_vars() ArrayIterator customizes the casting to array --- src/Tracy/Dumper/Dumper.php | 1 + src/Tracy/Dumper/Exposer.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index d28b0f44c..6377f9cab 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -76,6 +76,7 @@ class Dumper \Closure::class => [Exposer::class, 'exposeClosure'], \UnitEnum::class => [Exposer::class, 'exposeEnum'], \ArrayObject::class => [Exposer::class, 'exposeArrayObject'], + \ArrayIterator::class => [Exposer::class, 'exposeArrayIterator'], \SplFileInfo::class => [Exposer::class, 'exposeSplFileInfo'], \SplObjectStorage::class => [Exposer::class, 'exposeSplObjectStorage'], \__PHP_Incomplete_Class::class => [Exposer::class, 'exposePhpIncompleteClass'], diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 1d415ec15..210f32317 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -19,7 +19,7 @@ final class Exposer { public static function exposeObject(object $obj, Value $value, Describer $describer): void { - $values = (array) $obj; + $values = get_mangled_object_vars($obj); $props = self::getProperties($obj::class); foreach (array_diff_key($values, $props) as $k => $v) { @@ -132,6 +132,12 @@ public static function exposeArrayObject(\ArrayObject $obj, Value $value, Descri } + public static function exposeArrayIterator(\ArrayIterator $obj, Value $value, Describer $describer): void + { + self::exposeObject((object) $obj->getArrayCopy(), $value, $describer); + } + + public static function exposeDOMNode(\DOMNode $obj, Value $value, Describer $describer): void { $props = preg_match_all('#^\s*\[([^\]]+)\] =>#m', print_r($obj, true), $tmp) ? $tmp[1] : []; @@ -201,7 +207,7 @@ public static function exposePhpIncompleteClass( Describer $describer, ): void { - $values = (array) $obj; + $values = get_mangled_object_vars($obj); $class = $values['__PHP_Incomplete_Class_Name']; unset($values['__PHP_Incomplete_Class_Name']); foreach ($values as $k => $v) { From 54ae6e83e7257fac8c8aea1e667af8f5c11db042 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 15 Dec 2021 05:05:33 +0100 Subject: [PATCH 13/22] removed FireLogger --- examples/firelogger.php | 45 ----- readme.md | 29 --- src/Tracy/Debugger/Debugger.php | 31 +-- src/Tracy/Debugger/DevelopmentStrategy.php | 8 +- src/Tracy/Logger/FireLogger.php | 187 ------------------ src/tracy.php | 1 - tests/Tracy/Debugger.fireLog().basic.phpt | 35 ---- tests/Tracy/Debugger.fireLog().exception.phpt | 52 ----- .../Tracy/Debugger.fireLog().production.phpt | 25 --- 9 files changed, 3 insertions(+), 410 deletions(-) delete mode 100644 examples/firelogger.php delete mode 100644 src/Tracy/Logger/FireLogger.php delete mode 100644 tests/Tracy/Debugger.fireLog().basic.phpt delete mode 100644 tests/Tracy/Debugger.fireLog().exception.phpt delete mode 100644 tests/Tracy/Debugger.fireLog().production.phpt diff --git a/examples/firelogger.php b/examples/firelogger.php deleted file mode 100644 index a6d885f98..000000000 --- a/examples/firelogger.php +++ /dev/null @@ -1,45 +0,0 @@ - 'val1', 'key2' => true]]; - -// will show in FireLogger -Debugger::fireLog('Hello World'); -Debugger::fireLog($arr); - - -function first($arg1, $arg2) -{ - second(true, false); -} - - -function second($arg1, $arg2) -{ - third([1, 2, 3]); -} - - -function third($arg1) -{ - throw new Exception('The my exception', 123); -} - - -try { - first(10, 'any string'); -} catch (Throwable $e) { - Debugger::fireLog($e); -} - -?> - - -

Tracy: FireLogger demo

- -

How to enable FireLogger?

diff --git a/readme.md b/readme.md index 2efa780e8..eec4c2d31 100644 --- a/readme.md +++ b/readme.md @@ -343,35 +343,6 @@ echo Debugger::timer(); // elapsed time in seconds ``` -FireLogger ----------- - -You cannot always send debugging information to the browser window. This applies to AJAX requests or generating XML files to output. In such cases, you can send the messages by a separate channel into FireLogger. Error, Notice and Warning levels are sent to FireLogger window automatically. It is also possible to log suppressed exceptions in running application when attention to them is important. - -How to do it? - -- install extension [FireLogger for Chrome](https://chrome.google.com/webstore/detail/firelogger-for-chrome/hmagilfopmdjkeomnjpchokglfdfjfeh) -- turn on Chrome DevTools (using Ctrl-Shift-I key) and open Console - -Navigate to the [demo page](https://examples.nette.org/tracy/) and you will see messages sent from PHP. - -Because Tracy\Debugger communicates with FireLogger via HTTP headers, you must call the logging function before the PHP script sends anything to output. It is also possible to enable output buffering and delay the output. - -```php -use Tracy\Debugger; - -Debugger::fireLog('Hello World'); // send string into FireLogger console - -Debugger::fireLog($_SERVER); // or even arrays and objects - -Debugger::fireLog(new Exception('Test Exception')); // or exceptions -``` - -The result looks like this: - -![FireLogger](https://nette.github.io/tracy/images/tracy-firelogger.png) - - Custom Logger ------------- diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 5e48f200a..0df72fc79 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -39,9 +39,6 @@ class Debugger /** @var bool whether to display debug bar in development mode */ public static $showBar = true; - /** @var bool whether to send data to FireLogger in development mode */ - public static $showFireLogger = true; - /** @var int size of reserved memory */ public static $reservedMemorySize = 500000; @@ -102,7 +99,7 @@ class Debugger /** @var string|array email(s) to which send error notifications */ public static $email; - /** for Debugger::log() and Debugger::fireLog() */ + /** for Debugger::log() */ public const DEBUG = ILogger::DEBUG, INFO = ILogger::INFO, @@ -151,9 +148,6 @@ class Debugger /** @var ILogger */ private static $logger; - /** @var ILogger */ - private static $fireLogger; - /** @var array{DevelopmentStrategy, ProductionStrategy} */ private static $strategy; @@ -242,7 +236,6 @@ public static function enable($mode = null, ?string $logDirectory = null, $email 'Dumper/Exposer', 'Dumper/Renderer', 'Dumper/Value', - 'Logger/FireLogger', 'Logger/Logger', 'Session/SessionStorage', 'Session/FileSession', @@ -442,16 +435,6 @@ public static function getLogger(): ILogger } - public static function getFireLogger(): ILogger - { - if (!self::$fireLogger) { - self::$fireLogger = new FireLogger; - } - - return self::$fireLogger; - } - - /** @return ProductionStrategy|DevelopmentStrategy @internal */ public static function getStrategy() { @@ -582,18 +565,6 @@ public static function log($message, string $level = ILogger::INFO) } - /** - * Sends message to FireLogger console. - * @param mixed $message - */ - public static function fireLog($message): bool - { - return !self::$productionMode && self::$showFireLogger - ? self::getFireLogger()->log($message) - : false; - } - - /** @internal */ public static function addSourceMapper(callable $mapper): void { diff --git a/src/Tracy/Debugger/DevelopmentStrategy.php b/src/Tracy/Debugger/DevelopmentStrategy.php index 370a9652d..d6a20beeb 100644 --- a/src/Tracy/Debugger/DevelopmentStrategy.php +++ b/src/Tracy/Debugger/DevelopmentStrategy.php @@ -49,7 +49,6 @@ public function handleException(\Throwable $exception, bool $firstTime): void $this->blueScreen->render($exception); } else { - Debugger::fireLog($exception); $this->renderExceptionCli($exception); } } @@ -103,11 +102,8 @@ public function handleError( $message = 'PHP ' . Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message); $count = &$this->bar->getPanel('Tracy:errors')->data["$file|$line|$message"]; - if (!$count++) { // not repeated error - Debugger::fireLog(new ErrorException($message, 0, $severity, $file, $line)); - if (!Helpers::isHtmlMode() && !Helpers::isAjax()) { - echo "\n$message in $file on line $line\n"; - } + if (!$count++ && !Helpers::isHtmlMode() && !Helpers::isAjax()) { + echo "\n$message in $file on line $line\n"; } if (function_exists('ini_set')) { diff --git a/src/Tracy/Logger/FireLogger.php b/src/Tracy/Logger/FireLogger.php deleted file mode 100644 index fd606d10a..000000000 --- a/src/Tracy/Logger/FireLogger.php +++ /dev/null @@ -1,187 +0,0 @@ - []]; - - - /** - * Sends message to FireLogger console. - * @param mixed $message - */ - public function log($message, $level = self::DEBUG): bool - { - if (!isset($_SERVER['HTTP_X_FIRELOGGER']) || headers_sent()) { - return false; - } - - $item = [ - 'name' => 'PHP', - 'level' => $level, - 'order' => count($this->payload['logs']), - 'time' => str_pad(number_format((microtime(true) - Debugger::$time) * 1000, 1, '.', ' '), 8, '0', STR_PAD_LEFT) . ' ms', - 'template' => '', - 'message' => '', - 'style' => 'background:#767ab6', - ]; - - $args = func_get_args(); - if (isset($args[0]) && is_string($args[0])) { - $item['template'] = array_shift($args); - } - - if (isset($args[0]) && $args[0] instanceof \Throwable) { - $e = array_shift($args); - $trace = $e->getTrace(); - if ( - isset($trace[0]['class']) - && $trace[0]['class'] === Debugger::class - && ($trace[0]['function'] === 'shutdownHandler' || $trace[0]['function'] === 'errorHandler') - ) { - unset($trace[0]); - } - - $file = str_replace(dirname($e->getFile(), 3), "\xE2\x80\xA6", $e->getFile()); - $item['template'] = ($e instanceof \ErrorException ? '' : Helpers::getClass($e) . ': ') - . $e->getMessage() . ($e->getCode() ? ' #' . $e->getCode() : '') . ' in ' . $file . ':' . $e->getLine(); - $item['pathname'] = $e->getFile(); - $item['lineno'] = $e->getLine(); - - } else { - $trace = debug_backtrace(); - if ( - isset($trace[1]['class']) - && $trace[1]['class'] === Debugger::class - && ($trace[1]['function'] === 'fireLog') - ) { - unset($trace[0]); - } - - foreach ($trace as $frame) { - if (isset($frame['file']) && is_file($frame['file'])) { - $item['pathname'] = $frame['file']; - $item['lineno'] = $frame['line']; - break; - } - } - } - - $item['exc_info'] = ['', '', []]; - $item['exc_frames'] = []; - - foreach ($trace as $frame) { - $frame += ['file' => null, 'line' => null, 'class' => null, 'type' => null, 'function' => null, 'object' => null, 'args' => null]; - $item['exc_info'][2][] = [$frame['file'], $frame['line'], "$frame[class]$frame[type]$frame[function]", $frame['object']]; - $item['exc_frames'][] = $frame['args']; - } - - if ( - isset($args[0]) - && in_array($args[0], [self::DEBUG, self::INFO, self::WARNING, self::ERROR, self::CRITICAL], true) - ) { - $item['level'] = array_shift($args); - } - - $item['args'] = $args; - - $this->payload['logs'][] = $this->jsonDump($item, -1); - foreach (str_split(base64_encode(json_encode($this->payload, JSON_INVALID_UTF8_SUBSTITUTE)), 4990) as $k => $v) { - header("FireLogger-de11e-$k: $v"); - } - - return true; - } - - - /** - * Dump implementation for JSON. - * @param mixed $var - * @return array|int|float|bool|string|null - */ - private function jsonDump(&$var, int $level = 0) - { - if (is_bool($var) || $var === null || is_int($var) || is_float($var)) { - return $var; - - } elseif (is_string($var)) { - $var = Helpers::encodeString($var, $this->maxLength); - return htmlspecialchars_decode(strip_tags($var)); - - } elseif (is_array($var)) { - static $marker; - if ($marker === null) { - $marker = uniqid("\x00", true); - } - - if (isset($var[$marker])) { - return "\xE2\x80\xA6RECURSION\xE2\x80\xA6"; - - } elseif ($level < $this->maxDepth || !$this->maxDepth) { - $var[$marker] = true; - $res = []; - foreach ($var as $k => &$v) { - if ($k !== $marker) { - $res[$this->jsonDump($k)] = $this->jsonDump($v, $level + 1); - } - } - - unset($var[$marker]); - return $res; - - } else { - return " \xE2\x80\xA6 "; - } - } elseif (is_object($var)) { - $arr = get_mangled_object_vars($var); - static $list = []; - if (in_array($var, $list, true)) { - return "\xE2\x80\xA6RECURSION\xE2\x80\xA6"; - - } elseif ($level < $this->maxDepth || !$this->maxDepth) { - $list[] = $var; - $res = ["\x00" => '(object) ' . Helpers::getClass($var)]; - foreach ($arr as $k => &$v) { - if (isset($k[0]) && $k[0] === "\x00") { - $k = substr($k, strrpos($k, "\x00") + 1); - } - - $res[$this->jsonDump($k)] = $this->jsonDump($v, $level + 1); - } - - array_pop($list); - return $res; - - } else { - return " \xE2\x80\xA6 "; - } - } elseif (is_resource($var)) { - return 'resource ' . get_resource_type($var); - - } else { - return 'unknown type'; - } - } -} diff --git a/src/tracy.php b/src/tracy.php index 73259adff..46b60189c 100644 --- a/src/tracy.php +++ b/src/tracy.php @@ -18,7 +18,6 @@ require __DIR__ . '/Tracy/Dumper/Exposer.php'; require __DIR__ . '/Tracy/Dumper/Renderer.php'; require __DIR__ . '/Tracy/Logger/ILogger.php'; -require __DIR__ . '/Tracy/Logger/FireLogger.php'; require __DIR__ . '/Tracy/Logger/Logger.php'; require __DIR__ . '/Tracy/Debugger/Debugger.php'; require __DIR__ . '/Tracy/Debugger/DeferredContent.php'; diff --git a/tests/Tracy/Debugger.fireLog().basic.phpt b/tests/Tracy/Debugger.fireLog().basic.phpt deleted file mode 100644 index b802b6c65..000000000 --- a/tests/Tracy/Debugger.fireLog().basic.phpt +++ /dev/null @@ -1,35 +0,0 @@ - 'val1', 'key2' => true], (object) ['key1' => 'val1', 'key2' => true]]; - -// will show in FireLogger -Debugger::fireLog('Hello World'); // Tracy\Debugger::DEBUG -Debugger::fireLog('Info message', Debugger::INFO); -Debugger::fireLog('Warn message', Debugger::WARNING); -Debugger::fireLog('Error message', Debugger::ERROR); -Debugger::fireLog($arr); - -preg_match('#^FireLogger-de11e-0:(.+)#m', implode("\n", headers_list()), $matches); -Assert::true(isset($matches[1])); diff --git a/tests/Tracy/Debugger.fireLog().exception.phpt b/tests/Tracy/Debugger.fireLog().exception.phpt deleted file mode 100644 index e9c1773e1..000000000 --- a/tests/Tracy/Debugger.fireLog().exception.phpt +++ /dev/null @@ -1,52 +0,0 @@ - Date: Mon, 20 Dec 2021 13:36:00 +0100 Subject: [PATCH 14/22] removed bridge for Latte --- src/Bridges/Nette/Bridge.php | 74 +----------------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/src/Bridges/Nette/Bridge.php b/src/Bridges/Nette/Bridge.php index 15c49f500..41d68033a 100644 --- a/src/Bridges/Nette/Bridge.php +++ b/src/Bridges/Nette/Bridge.php @@ -9,7 +9,6 @@ namespace Tracy\Bridges\Nette; -use Latte; use Nette; use Tracy; use Tracy\BlueScreen; @@ -17,89 +16,18 @@ /** - * Bridge for NEON & Latte. + * Bridge for NEON. */ class Bridge { public static function initialize(): void { $blueScreen = Tracy\Debugger::getBlueScreen(); - if (!class_exists(Latte\Bridges\Tracy\BlueScreenPanel::class)) { - $blueScreen->addPanel([self::class, 'renderLatteError']); - $blueScreen->addAction([self::class, 'renderLatteUnknownMacro']); - $blueScreen->addFileGenerator(function (string $file) { - return substr($file, -6) === '.latte' - ? "{block content}\n\$END\$" - : null; - }); - Tracy\Debugger::addSourceMapper([self::class, 'mapLatteSourceCode']); - } - $blueScreen->addAction([self::class, 'renderMemberAccessException']); $blueScreen->addPanel([self::class, 'renderNeonError']); } - public static function renderLatteError(?\Throwable $e): ?array - { - if ($e instanceof Latte\CompileException && $e->sourceName) { - return [ - 'tab' => 'Template', - 'panel' => (preg_match('#\n|\?#', $e->sourceName) - ? '' - : '

' - . (@is_file($e->sourceName) // @ - may trigger error - ? 'File: ' . Helpers::editorLink($e->sourceName, $e->sourceLine) - : '' . htmlspecialchars($e->sourceName . ($e->sourceLine ? ':' . $e->sourceLine : '')) . '') - . '

') - . BlueScreen::highlightFile($e->sourceCode, $e->sourceLine, 15, false), - ]; - } - - return null; - } - - - public static function renderLatteUnknownMacro(?\Throwable $e): ?array - { - if ( - $e instanceof Latte\CompileException - && $e->sourceName - && @is_file($e->sourceName) // @ - may trigger error - && (preg_match('#Unknown macro (\{\w+)\}, did you mean (\{\w+)\}\?#A', $e->getMessage(), $m) - || preg_match('#Unknown attribute (n:\w+), did you mean (n:\w+)\?#A', $e->getMessage(), $m)) - ) { - return [ - 'link' => Helpers::editorUri($e->sourceName, $e->sourceLine, 'fix', $m[1], $m[2]), - 'label' => 'fix it', - ]; - } - - return null; - } - - - /** @return array{file: string, line: int, label: string, active: bool} */ - public static function mapLatteSourceCode(string $file, int $line): ?array - { - if (!strpos($file, '.latte--')) { - return null; - } - - $lines = file($file); - if ( - !preg_match('#^/(?:\*\*|/) source: (\S+\.latte)#m', implode('', array_slice($lines, 0, 10)), $m) - || !@is_file($m[1]) // @ - may trigger error - ) { - return null; - } - - $file = $m[1]; - $line = $line && preg_match('#/\* line (\d+) \*/#', $lines[$line - 1], $m) ? (int) $m[1] : 0; - return ['file' => $file, 'line' => $line, 'label' => 'Latte', 'active' => true]; - } - - public static function renderMemberAccessException(?\Throwable $e): ?array { if (!$e instanceof Nette\MemberAccessException && !$e instanceof \LogicException) { From 7e7f39fc0718b2e703952143be7a20afffe40172 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 3 Feb 2022 17:37:54 +0100 Subject: [PATCH 15/22] added property typehints --- src/Bridges/Nette/MailSender.php | 5 +- src/Bridges/Nette/TracyExtension.php | 7 +- src/Bridges/Psr/PsrToTracyLoggerAdapter.php | 3 +- src/Bridges/Psr/TracyToPsrLoggerAdapter.php | 3 +- src/Tracy/Bar/Bar.php | 6 +- src/Tracy/BlueScreen/BlueScreen.php | 30 ++--- src/Tracy/Debugger/Debugger.php | 122 +++++++++--------- src/Tracy/Debugger/DeferredContent.php | 11 +- src/Tracy/Debugger/DevelopmentStrategy.php | 11 +- src/Tracy/Dumper/Describer.php | 30 ++--- src/Tracy/Dumper/Dumper.php | 20 +-- src/Tracy/Dumper/Renderer.php | 41 ++---- src/Tracy/Dumper/Value.php | 35 ++--- src/Tracy/Logger/Logger.php | 19 ++- src/Tracy/OutputDebugger/OutputDebugger.php | 2 +- src/Tracy/Session/FileSession.php | 15 +-- .../PsrToTracyLoggerAdapter.phpt | 2 +- .../TracyToPsrLoggerAdapter.phpt | 2 +- 18 files changed, 139 insertions(+), 225 deletions(-) diff --git a/src/Bridges/Nette/MailSender.php b/src/Bridges/Nette/MailSender.php index dd4c43c59..b6fde2130 100644 --- a/src/Bridges/Nette/MailSender.php +++ b/src/Bridges/Nette/MailSender.php @@ -20,11 +20,10 @@ class MailSender { use Nette\SmartObject; - /** @var Nette\Mail\IMailer */ - private $mailer; + private Nette\Mail\IMailer $mailer; /** @var string|null sender of email notifications */ - private $fromEmail; + private ?string $fromEmail = null; public function __construct(Nette\Mail\IMailer $mailer, ?string $fromEmail = null) diff --git a/src/Bridges/Nette/TracyExtension.php b/src/Bridges/Nette/TracyExtension.php index 4a14c0def..ead3e6ce3 100644 --- a/src/Bridges/Nette/TracyExtension.php +++ b/src/Bridges/Nette/TracyExtension.php @@ -22,11 +22,8 @@ class TracyExtension extends Nette\DI\CompilerExtension { private const ErrorSeverityPattern = 'E_(?:ALL|PARSE|STRICT|RECOVERABLE_ERROR|(?:CORE|COMPILE)_(?:ERROR|WARNING)|(?:USER_)?(?:ERROR|WARNING|NOTICE|DEPRECATED))'; - /** @var bool */ - private $debugMode; - - /** @var bool */ - private $cliMode; + private bool $debugMode; + private bool $cliMode; public function __construct(bool $debugMode = false, bool $cliMode = false) diff --git a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php index 28fac20eb..291b06084 100644 --- a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php +++ b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php @@ -28,8 +28,7 @@ class PsrToTracyLoggerAdapter implements Tracy\ILogger Tracy\ILogger::CRITICAL => Psr\Log\LogLevel::CRITICAL, ]; - /** @var Psr\Log\LoggerInterface */ - private $psrLogger; + private Psr\Log\LoggerInterface $psrLogger; public function __construct(Psr\Log\LoggerInterface $psrLogger) diff --git a/src/Bridges/Psr/TracyToPsrLoggerAdapter.php b/src/Bridges/Psr/TracyToPsrLoggerAdapter.php index 663846159..3c52f3b9e 100644 --- a/src/Bridges/Psr/TracyToPsrLoggerAdapter.php +++ b/src/Bridges/Psr/TracyToPsrLoggerAdapter.php @@ -30,8 +30,7 @@ class TracyToPsrLoggerAdapter extends Psr\Log\AbstractLogger Psr\Log\LogLevel::DEBUG => Tracy\ILogger::DEBUG, ]; - /** @var Tracy\ILogger */ - private $tracyLogger; + private Tracy\ILogger $tracyLogger; public function __construct(Tracy\ILogger $tracyLogger) diff --git a/src/Tracy/Bar/Bar.php b/src/Tracy/Bar/Bar.php index 6778e3fec..037bc3cee 100644 --- a/src/Tracy/Bar/Bar.php +++ b/src/Tracy/Bar/Bar.php @@ -16,10 +16,8 @@ class Bar { /** @var IBarPanel[] */ - private $panels = []; - - /** @var bool */ - private $loaderRendered = false; + private array $panels = []; + private bool $loaderRendered = false; /** diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index 4c022dcc7..b437d2a83 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -18,43 +18,37 @@ class BlueScreen private const MaxMessageLength = 2000; /** @var string[] */ - public $info = []; + public array $info = []; /** @var string[] paths to be collapsed in stack trace (e.g. core libraries) */ - public $collapsePaths = []; + public array $collapsePaths = []; - /** @var int */ - public $maxDepth = 5; + public int $maxDepth = 5; - /** @var int */ - public $maxLength = 150; + public int $maxLength = 150; - /** @var int */ - public $maxItems = 100; + public int $maxItems = 100; /** @var callable|null a callable returning true for sensitive data; fn(string $key, mixed $val): bool */ public $scrubber; /** @var string[] */ - public $keysToHide = ['password', 'passwd', 'pass', 'pwd', 'creditcard', 'credit card', 'cc', 'pin', self::class . '::$snapshot']; + public array $keysToHide = ['password', 'passwd', 'pass', 'pwd', 'creditcard', 'credit card', 'cc', 'pin', self::class . '::$snapshot']; - /** @var bool */ - public $showEnvironment = true; + public bool $showEnvironment = true; /** @var callable[] */ - private $panels = []; + private array $panels = []; /** @var callable[] functions that returns action for exceptions */ - private $actions = []; + private array $actions = []; - /** @var callable[] */ - private $fileGenerators = []; + private array $fileGenerators = []; - /** @var array */ - private $snapshot; + private ?array $snapshot = null; /** @var \WeakMap<\Fiber|\Generator> */ - private $fibers; + private \WeakMap $fibers; public function __construct() diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 0df72fc79..abfd1ff9a 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -33,71 +33,70 @@ class Debugger public const CookieSecret = 'tracy-debug'; public const COOKIE_SECRET = self::CookieSecret; - /** @var bool in production mode is suppressed any debugging output */ - public static $productionMode = self::Detect; + /** in production mode is suppressed any debugging output */ + public static ?bool $productionMode = self::DETECT; - /** @var bool whether to display debug bar in development mode */ - public static $showBar = true; + /** whether to display debug bar in development mode */ + public static bool $showBar = true; - /** @var int size of reserved memory */ - public static $reservedMemorySize = 500000; + /** size of reserved memory */ + public static int $reservedMemorySize = 500000; - /** @var bool */ - private static $enabled = false; + private static bool $enabled = false; - /** @var string|null reserved memory; also prevents double rendering */ - private static $reserved; + /** reserved memory; also prevents double rendering */ + private static ?string $reserved = null; - /** @var int initial output buffer level */ - private static $obLevel; + /** initial output buffer level */ + private static int $obLevel; - /** @var ?array output buffer status @internal */ - public static $obStatus; + /** output buffer status @internal */ + public static ?array $obStatus = null; /********************* errors and exceptions reporting ****************d*g**/ - /** @var bool|int determines whether any error will cause immediate death in development mode; if integer that it's matched against error severity */ - public static $strictMode = false; + /** determines whether any error will cause immediate death in development mode; if integer that it's matched against error severity */ + public static bool|int $strictMode = false; - /** @var bool|int disables the @ (shut-up) operator so that notices and warnings are no longer hidden; if integer than it's matched against error severity */ - public static $scream = false; + /** disables the @ (shut-up) operator so that notices and warnings are no longer hidden; if integer than it's matched against error severity */ + public static bool|int $scream = false; /** @var callable[] functions that are automatically called after fatal error */ - public static $onFatalError = []; + public static array $onFatalError = []; /********************* Debugger::dump() ****************d*g**/ - /** @var int how many nested levels of array/object properties display by dump() */ - public static $maxDepth = 15; + /** how many nested levels of array/object properties display by dump() */ + public static int $maxDepth = 15; - /** @var int how long strings display by dump() */ - public static $maxLength = 150; + /** how long strings display by dump() */ + public static int $maxLength = 150; - /** @var int how many items in array/object display by dump() */ - public static $maxItems = 100; + /** how many items in array/object display by dump() */ + public static int $maxItems = 100; - /** @var bool display location by dump()? */ - public static $showLocation; + /** display location by dump()? */ + public static ?bool $showLocation = null; /** @var string[] sensitive keys not displayed by dump() */ - public static $keysToHide = []; + public static array $keysToHide = []; - /** @var string theme for dump() */ - public static $dumpTheme = 'light'; + /** theme for dump() */ + public static string $dumpTheme = 'light'; /** @deprecated */ public static $maxLen; /********************* logging ****************d*g**/ - /** @var string|null name of the directory where errors should be logged */ - public static $logDirectory; + /** name of the directory where errors should be logged */ + public static ?string $logDirectory = null; - /** @var int log bluescreen in production mode for this error severity */ - public static $logSeverity = 0; + /** log bluescreen in production mode for this error severity */ + public static int $logSeverity = 0; - /** @var string|array email(s) to which send error notifications */ - public static $email; + /** email(s) to which send error notifications */ + public static string|array|null $email = null; /** for Debugger::log() */ public const @@ -110,49 +109,44 @@ class Debugger /********************* misc ****************d*g**/ - /** @var float timestamp with microseconds of the start of the request */ - public static $time; + /** timestamp with microseconds of the start of the request */ + public static float $time; - /** @var string URI pattern mask to open editor */ - public static $editor = 'editor://%action/?file=%file&line=%line&search=%search&replace=%replace'; + /** URI pattern mask to open editor */ + public static ?string $editor = 'editor://%action/?file=%file&line=%line&search=%search&replace=%replace'; - /** @var array replacements in path */ - public static $editorMapping = []; + /** replacements in path */ + public static array $editorMapping = []; - /** @var string command to open browser (use 'start ""' in Windows) */ - public static $browser; + /** command to open browser (use 'start ""' in Windows) */ + public static string $browser; - /** @var string custom static error template */ - public static $errorTemplate; + /** custom static error template */ + public static ?string $errorTemplate = null; /** @var string[] */ - public static $customCssFiles = []; + public static array $customCssFiles = []; /** @var string[] */ - public static $customJsFiles = []; + public static array $customJsFiles = []; /** @var callable[] */ private static $sourceMappers = []; - /** @var array|null */ - private static $cpuUsage; + private static ?array $cpuUsage = null; /********************* services ****************d*g**/ - /** @var BlueScreen */ - private static $blueScreen; + private static BlueScreen $blueScreen; - /** @var Bar */ - private static $bar; + private static Bar $bar; - /** @var ILogger */ - private static $logger; + private static ILogger $logger; /** @var array{DevelopmentStrategy, ProductionStrategy} */ - private static $strategy; + private static array $strategy; - /** @var SessionStorage */ - private static $sessionStorage; + private static SessionStorage $sessionStorage; /** @@ -391,7 +385,7 @@ public static function removeOutputBuffers(bool $errorOccurred): void public static function getBlueScreen(): BlueScreen { - if (!self::$blueScreen) { + if (empty(self::$blueScreen)) { self::$blueScreen = new BlueScreen; self::$blueScreen->info = [ 'PHP ' . PHP_VERSION, @@ -406,7 +400,7 @@ public static function getBlueScreen(): BlueScreen public static function getBar(): Bar { - if (!self::$bar) { + if (empty(self::$bar)) { self::$bar = new Bar; self::$bar->addPanel($info = new DefaultBarPanel('info'), 'Tracy:info'); $info->cpuUsage = self::$cpuUsage; @@ -425,7 +419,7 @@ public static function setLogger(ILogger $logger): void public static function getLogger(): ILogger { - if (!self::$logger) { + if (empty(self::$logger)) { self::$logger = new Logger(self::$logDirectory, self::$email, self::getBlueScreen()); self::$logger->directory = &self::$logDirectory; // back compatiblity self::$logger->email = &self::$email; @@ -450,7 +444,7 @@ public static function getStrategy() public static function setSessionStorage(SessionStorage $storage): void { - if (self::$sessionStorage) { + if (isset(self::$sessionStorage)) { throw new \Exception('Storage is already set.'); } @@ -461,7 +455,7 @@ public static function setSessionStorage(SessionStorage $storage): void /** @internal */ public static function getSessionStorage(): SessionStorage { - if (!self::$sessionStorage) { + if (empty(self::$sessionStorage)) { self::$sessionStorage = @is_dir($dir = session_save_path()) || @is_dir($dir = ini_get('upload_tmp_dir')) || @is_dir($dir = sys_get_temp_dir()) diff --git a/src/Tracy/Debugger/DeferredContent.php b/src/Tracy/Debugger/DeferredContent.php index 038578eb7..ba3b11a72 100644 --- a/src/Tracy/Debugger/DeferredContent.php +++ b/src/Tracy/Debugger/DeferredContent.php @@ -15,14 +15,9 @@ */ final class DeferredContent { - /** @var SessionStorage */ - private $sessionStorage; - - /** @var string */ - private $requestId; - - /** @var bool */ - private $useSession = false; + private SessionStorage $sessionStorage; + private string $requestId; + private bool $useSession = false; public function __construct(SessionStorage $sessionStorage) diff --git a/src/Tracy/Debugger/DevelopmentStrategy.php b/src/Tracy/Debugger/DevelopmentStrategy.php index d6a20beeb..e43649943 100644 --- a/src/Tracy/Debugger/DevelopmentStrategy.php +++ b/src/Tracy/Debugger/DevelopmentStrategy.php @@ -17,14 +17,9 @@ */ final class DevelopmentStrategy { - /** @var Bar */ - private $bar; - - /** @var BlueScreen */ - private $blueScreen; - - /** @var DeferredContent */ - private $defer; + private Bar $bar; + private BlueScreen $blueScreen; + private DeferredContent $defer; public function __construct(Bar $bar, BlueScreen $blueScreen, DeferredContent $defer) diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index c370befd1..dd0fc68e5 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -24,38 +24,28 @@ final class Describer // Number.MAX_SAFE_INTEGER private const JsSafeInteger = 1 << 53 - 1; - /** @var int */ - public $maxDepth = 7; - - /** @var int */ - public $maxLength = 150; - - /** @var int */ - public $maxItems = 100; + public int $maxDepth = 7; + public int $maxLength = 150; + public int $maxItems = 100; /** @var Value[] */ - public $snapshot = []; - - /** @var bool */ - public $debugInfo = false; - - /** @var array */ - public $keysToHide = []; + public array $snapshot = []; + public bool $debugInfo = false; + public array $keysToHide = []; /** @var callable|null fn(string $key, mixed $val): bool */ public $scrubber; - /** @var bool */ - public $location = false; + public bool $location = false; /** @var callable[] */ - public $resourceExposers; + public array $resourceExposers; /** @var array */ - public $objectExposers; + public array $objectExposers; /** @var (int|\stdClass)[] */ - public $references = []; + public array $references = []; public function describe($var): \stdClass diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index 6377f9cab..0fe267b74 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -45,10 +45,9 @@ class Dumper public const HIDDEN_VALUE = Describer::HiddenValue; /** @var Dumper\Value[] */ - public static $liveSnapshot = []; + public static array $liveSnapshot = []; - /** @var array */ - public static $terminalColors = [ + public static ?array $terminalColors = [ 'bool' => '1;33', 'null' => '1;33', 'number' => '1;32', @@ -64,15 +63,13 @@ class Dumper 'indent' => '1;30', ]; - /** @var array */ - public static $resources = [ + public static array $resources = [ 'stream' => 'stream_get_meta_data', 'stream-context' => 'stream_context_get_options', 'curl' => 'curl_getinfo', ]; - /** @var array */ - public static $objectExporters = [ + public static array $objectExporters = [ \Closure::class => [Exposer::class, 'exposeClosure'], \UnitEnum::class => [Exposer::class, 'exposeEnum'], \ArrayObject::class => [Exposer::class, 'exposeArrayObject'], @@ -89,11 +86,8 @@ class Dumper Ds\Map::class => [Exposer::class, 'exposeDsMap'], ]; - /** @var Describer */ - private $describer; - - /** @var Renderer */ - private $renderer; + private Describer $describer; + private Renderer $renderer; /** @@ -211,7 +205,7 @@ private function __construct(array $options = []) : ($options[self::LAZY] ?? $renderer->lazy); $renderer->sourceLocation = !(~$location & self::LOCATION_SOURCE); $renderer->classLocation = !(~$location & self::LOCATION_CLASS); - $renderer->theme = $options[self::THEME] ?? $renderer->theme; + $renderer->theme = ($options[self::THEME] ?? $renderer->theme) ?: null; $renderer->hash = $options[self::HASH] ?? true; } diff --git a/src/Tracy/Dumper/Renderer.php b/src/Tracy/Dumper/Renderer.php index e8c78f5f1..04fda0016 100644 --- a/src/Tracy/Dumper/Renderer.php +++ b/src/Tracy/Dumper/Renderer.php @@ -20,41 +20,24 @@ final class Renderer { private const TypeArrayKey = 'array'; - /** @var int|bool */ - public $collapseTop = 14; - - /** @var int */ - public $collapseSub = 7; - - /** @var bool */ - public $classLocation = false; - - /** @var bool */ - public $sourceLocation = false; + public int|bool $collapseTop = 14; + public int $collapseSub = 7; + public bool $classLocation = false; + public bool $sourceLocation = false; /** @var bool|null lazy-loading via JavaScript? true=full, false=none, null=collapsed parts */ - public $lazy; - - /** @var bool */ - public $hash = true; - - /** @var string */ - public $theme = 'light'; - - /** @var bool */ - public $collectingMode = false; + public ?bool $lazy = null; + public bool $hash = true; + public ?string $theme = 'light'; + public bool $collectingMode = false; /** @var Value[] */ - private $snapshot = []; + private array $snapshot = []; /** @var Value[]|null */ - private $snapshotSelection; - - /** @var array */ - private $parents = []; - - /** @var array */ - private $above = []; + private ?array $snapshotSelection = null; + private array $parents = []; + private array $above = []; public function renderAsHtml(\stdClass $model): string diff --git a/src/Tracy/Dumper/Value.php b/src/Tracy/Dumper/Value.php index 3fa521556..25d178213 100644 --- a/src/Tracy/Dumper/Value.php +++ b/src/Tracy/Dumper/Value.php @@ -32,32 +32,15 @@ final class Value implements \JsonSerializable PropertyDynamic = 3, PropertyVirtual = 4; - /** @var string */ - public $type; - - /** @var string|int */ - public $value; - - /** @var ?int */ - public $length; - - /** @var ?int */ - public $depth; - - /** @var int|string */ - public $id; - - /** @var object */ - public $holder; - - /** @var ?array */ - public $items; - - /** @var ?\stdClass */ - public $editor; - - /** @var ?bool */ - public $collapsed; + public string $type; + public string|int|null $value; + public ?int $length; + public ?int $depth = null; + public int|string|null $id = null; + public object $holder; + public ?array $items = null; + public ?\stdClass $editor = null; + public ?bool $collapsed = null; public function __construct(string $type, $value = null, ?int $length = null) diff --git a/src/Tracy/Logger/Logger.php b/src/Tracy/Logger/Logger.php index 2a50a8e78..c1e9cf16f 100644 --- a/src/Tracy/Logger/Logger.php +++ b/src/Tracy/Logger/Logger.php @@ -15,23 +15,22 @@ */ class Logger implements ILogger { - /** @var string|null name of the directory where errors should be logged */ - public $directory; + /** name of the directory where errors should be logged */ + public ?string $directory = null; - /** @var string|array|null email or emails to which send error notifications */ - public $email; + /** email or emails to which send error notifications */ + public string|array|null $email = null; - /** @var string|null sender of email notifications */ - public $fromEmail; + /** sender of email notifications */ + public ?string $fromEmail = null; - /** @var mixed interval for sending email is 2 days */ - public $emailSnooze = '2 days'; + /** interval for sending email is 2 days */ + public mixed $emailSnooze = '2 days'; /** @var callable handler for sending emails */ public $mailer; - /** @var BlueScreen|null */ - private $blueScreen; + private ?BlueScreen $blueScreen = null; /** diff --git a/src/Tracy/OutputDebugger/OutputDebugger.php b/src/Tracy/OutputDebugger/OutputDebugger.php index 53692d2c2..4c8c74cf8 100644 --- a/src/Tracy/OutputDebugger/OutputDebugger.php +++ b/src/Tracy/OutputDebugger/OutputDebugger.php @@ -18,7 +18,7 @@ final class OutputDebugger private const BOM = "\xEF\xBB\xBF"; /** @var array of [file, line, output, stack] */ - private $list = []; + private array $list = []; public static function enable(): void diff --git a/src/Tracy/Session/FileSession.php b/src/Tracy/Session/FileSession.php index f68b8d581..8e4172c19 100644 --- a/src/Tracy/Session/FileSession.php +++ b/src/Tracy/Session/FileSession.php @@ -15,20 +15,15 @@ class FileSession implements SessionStorage private const FilePrefix = 'tracy-'; private const CookieLifetime = 31_557_600; - /** @var string */ - public $cookieName = 'tracy-session'; + public string $cookieName = 'tracy-session'; - /** @var float probability that the clean() routine is started */ - public $gcProbability = 0.001; - - /** @var string */ - private $dir; + /** probability that the clean() routine is started */ + public float $gcProbability = 0.001; + private string $dir; /** @var resource */ private $file; - - /** @var array */ - private $data = []; + private array $data = []; public function __construct(string $dir) diff --git a/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt b/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt index 3bd85779a..6852a2eb0 100644 --- a/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt +++ b/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt @@ -16,7 +16,7 @@ require __DIR__ . '/../bootstrap.php'; class DummyPsrLogger extends Psr\Log\AbstractLogger { /** @var array */ - public $entries = []; + public array $entries = []; public function log($level, $message, array $context = []): void diff --git a/tests/Tracy.Bridges/TracyToPsrLoggerAdapter.phpt b/tests/Tracy.Bridges/TracyToPsrLoggerAdapter.phpt index ef242b0ac..ce69a1cd4 100644 --- a/tests/Tracy.Bridges/TracyToPsrLoggerAdapter.phpt +++ b/tests/Tracy.Bridges/TracyToPsrLoggerAdapter.phpt @@ -16,7 +16,7 @@ require __DIR__ . '/../bootstrap.php'; class DummyTracyLogger implements ILogger { /** @var array */ - public $entries = []; + public array $entries = []; public function log($value, $priority = self::INFO) From d6f1b100d5e79306ac6761ba8747ae9759561177 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 16 Dec 2021 04:06:26 +0100 Subject: [PATCH 16/22] added PHP 8 typehints --- src/Bridges/Nette/MailSender.php | 5 +---- src/Bridges/Nette/TracyExtension.php | 2 +- src/Tracy/BlueScreen/BlueScreen.php | 6 +---- src/Tracy/Debugger/Debugger.php | 21 +++++++++--------- src/Tracy/Dumper/Describer.php | 33 +++++++--------------------- src/Tracy/Dumper/Dumper.php | 2 +- src/Tracy/Dumper/Exposer.php | 9 ++++---- src/Tracy/Dumper/Renderer.php | 17 +++----------- src/Tracy/Logger/Logger.php | 23 +++++-------------- 9 files changed, 36 insertions(+), 82 deletions(-) diff --git a/src/Bridges/Nette/MailSender.php b/src/Bridges/Nette/MailSender.php index b6fde2130..bac96ae50 100644 --- a/src/Bridges/Nette/MailSender.php +++ b/src/Bridges/Nette/MailSender.php @@ -33,10 +33,7 @@ public function __construct(Nette\Mail\IMailer $mailer, ?string $fromEmail = nul } - /** - * @param mixed $message - */ - public function send($message, string $email): void + public function send(mixed $message, string $email): void { $host = preg_replace('#[^\w.-]+#', '', $_SERVER['SERVER_NAME'] ?? php_uname('n')); diff --git a/src/Bridges/Nette/TracyExtension.php b/src/Bridges/Nette/TracyExtension.php index ead3e6ce3..a8efe6974 100644 --- a/src/Bridges/Nette/TracyExtension.php +++ b/src/Bridges/Nette/TracyExtension.php @@ -168,7 +168,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class) /** * @param string|string[] $value */ - private function parseErrorSeverity($value): int + private function parseErrorSeverity(string|array $value): int { $value = implode('|', (array) $value); $res = (int) @parse_ini_string('e = ' . $value)['e']; // @ may fail diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index b437d2a83..3bb031b48 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -98,11 +98,7 @@ public function addFileGenerator(callable $generator): self } - /** - * @param \Fiber|\Generator $fiber - * @return static - */ - public function addFiber($fiber): self + public function addFiber(\Fiber|\Generator $fiber): static { $this->fibers[$fiber] = true; return $this; diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index abfd1ff9a..c51f188ce 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -164,7 +164,11 @@ final public function __construct() * @param string $logDirectory error log directory * @param string|array $email administrator email; enables email sending in production mode */ - public static function enable($mode = null, ?string $logDirectory = null, $email = null): void + public static function enable( + bool|string|array|null $mode = null, + ?string $logDirectory = null, + string|array|null $email = null, + ): void { if ($mode !== null || self::$productionMode === null) { self::$productionMode = is_bool($mode) @@ -429,8 +433,8 @@ public static function getLogger(): ILogger } - /** @return ProductionStrategy|DevelopmentStrategy @internal */ - public static function getStrategy() + /** @internal */ + public static function getStrategy(): ProductionStrategy|DevelopmentStrategy { if (empty(self::$strategy[self::$productionMode])) { self::$strategy[self::$productionMode] = self::$productionMode @@ -478,7 +482,7 @@ public static function getSessionStorage(): SessionStorage * @param bool $return return output instead of printing it? (bypasses $productionMode) * @return mixed variable itself or dump */ - public static function dump($var, bool $return = false) + public static function dump(mixed $var, bool $return = false): mixed { if ($return) { $options = [ @@ -525,10 +529,9 @@ public static function timer(?string $name = null): float /** * Dumps information about a variable in Tracy Debug Bar. * @tracySkipLocation - * @param mixed $var * @return mixed variable itself */ - public static function barDump($var, ?string $title = null, array $options = []) + public static function barDump(mixed $var, ?string $title = null, array $options = []): mixed { if (!self::$productionMode) { static $panel; @@ -550,10 +553,8 @@ public static function barDump($var, ?string $title = null, array $options = []) /** * Logs message or exception. - * @param mixed $message - * @return mixed */ - public static function log($message, string $level = ILogger::INFO) + public static function log(mixed $message, string $level = ILogger::INFO): mixed { return self::getLogger()->log($message, $level); } @@ -583,7 +584,7 @@ public static function mapSource(string $file, int $line): ?array * Detects debug mode by IP address. * @param string|array $list IP addresses or computer names whitelist detection */ - public static function detectDebugMode($list = null): bool + public static function detectDebugMode(string|array|null $list = null): bool { $addr = $_SERVER['REMOTE_ADDR'] ?? php_uname('n'); $secret = isset($_COOKIE[self::CookieSecret]) && is_string($_COOKIE[self::CookieSecret]) diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index dd0fc68e5..df07b4c69 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -67,10 +67,7 @@ public function describe($var): \stdClass } - /** - * @return mixed - */ - private function describeVar($var, int $depth = 0, ?int $refId = null) + private function describeVar($var, int $depth = 0, ?int $refId = null): mixed { if ($var === null || is_bool($var)) { return $var; @@ -81,10 +78,7 @@ private function describeVar($var, int $depth = 0, ?int $refId = null) } - /** - * @return Value|int - */ - private function describeInteger(int $num) + private function describeInteger(int $num): Value|int { return $num <= self::JsSafeInteger && $num >= -self::JsSafeInteger ? $num @@ -92,10 +86,7 @@ private function describeInteger(int $num) } - /** - * @return Value|float - */ - private function describeDouble(float $num) + private function describeDouble(float $num): Value|float { if (!is_finite($num)) { return new Value(Value::TypeNumber, (string) $num); @@ -108,10 +99,7 @@ private function describeDouble(float $num) } - /** - * @return Value|string - */ - private function describeString(string $s, int $depth = 0) + private function describeString(string $s, int $depth = 0): Value|string { $encoded = Helpers::encodeString($s, $depth ? $this->maxLength : null); if ($encoded === $s) { @@ -124,10 +112,7 @@ private function describeString(string $s, int $depth = 0) } - /** - * @return Value|array - */ - private function describeArray(array $arr, int $depth = 0, ?int $refId = null) + private function describeArray(array $arr, int $depth = 0, ?int $refId = null): Value|array { if ($refId) { $res = new Value(Value::TypeRef, 'p' . $refId); @@ -231,10 +216,7 @@ private function describeResource($resource, int $depth = 0): Value } - /** - * @return Value|string - */ - public function describeKey(string $key) + public function describeKey(string $key): Value|string { if (preg_match('#^[\w!\#$%&*+./;<>?@^{|}~-]{1,50}$#D', $key) && !preg_match('#^(true|false|null)$#iD', $key)) { return $key; @@ -254,7 +236,8 @@ public function addPropertyTo( $type = Value::PropertyVirtual, ?int $refId = null, ?string $class = null, - ) { + ): void + { if ($value->depth && $this->maxItems && count($value->items ?? []) >= $this->maxItems) { $value->length = ($value->length ?? count($value->items)) + 1; return; diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index 0fe267b74..d59677081 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -94,7 +94,7 @@ class Dumper * Dumps variable to the output. * @return mixed variable */ - public static function dump($var, array $options = []) + public static function dump($var, array $options = []): mixed { if (Helpers::isCli()) { $useColors = self::$terminalColors && Helpers::detectColors(); diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 210f32317..e548b99e0 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -148,10 +148,11 @@ public static function exposeDOMNode(\DOMNode $obj, Value $value, Describer $des } - /** - * @param \DOMNodeList|\DOMNamedNodeMap $obj - */ - public static function exposeDOMNodeList($obj, Value $value, Describer $describer): void + public static function exposeDOMNodeList( + \DOMNodeList|\DOMNamedNodeMap $obj, + Value $value, + Describer $describer, + ): void { $describer->addPropertyTo($value, 'length', $obj->length, Value::PropertyPublic); $describer->addPropertyTo($value, 'items', iterator_to_array($obj)); diff --git a/src/Tracy/Dumper/Renderer.php b/src/Tracy/Dumper/Renderer.php index 04fda0016..b066d9324 100644 --- a/src/Tracy/Dumper/Renderer.php +++ b/src/Tracy/Dumper/Renderer.php @@ -113,11 +113,7 @@ public function renderAsText(\stdClass $model, array $colors = []): string } - /** - * @param mixed $value - * @param string|int|null $keyType - */ - private function renderVar($value, int $depth = 0, $keyType = null): string + private function renderVar(mixed $value, int $depth = 0, string|int|null $keyType = null): string { switch (true) { case $value === null: @@ -164,11 +160,7 @@ private function renderVar($value, int $depth = 0, $keyType = null): string } - /** - * @param string|Value $str - * @param string|int|null $keyType - */ - private function renderString($str, int $depth, $keyType): string + private function renderString(string|Value $str, int $depth, string|int|null $keyType): string { if ($keyType === self::TypeArrayKey) { $indent = ' ' . str_repeat('| ', $depth - 1) . ' '; @@ -241,10 +233,7 @@ private function renderString($str, int $depth, $keyType): string } - /** - * @param array|Value $array - */ - private function renderArray($array, int $depth): string + private function renderArray(array|Value $array, int $depth): string { $out = 'array ('; diff --git a/src/Tracy/Logger/Logger.php b/src/Tracy/Logger/Logger.php index c1e9cf16f..f4dad1796 100644 --- a/src/Tracy/Logger/Logger.php +++ b/src/Tracy/Logger/Logger.php @@ -33,10 +33,7 @@ class Logger implements ILogger private ?BlueScreen $blueScreen = null; - /** - * @param string|array|null $email - */ - public function __construct(?string $directory, $email = null, ?BlueScreen $blueScreen = null) + public function __construct(?string $directory, string|array|null $email = null, ?BlueScreen $blueScreen = null) { $this->directory = $directory; $this->email = $email; @@ -81,10 +78,7 @@ public function log($message, $level = self::INFO) } - /** - * @param mixed $message - */ - public static function formatMessage($message): string + public static function formatMessage(mixed $message): string { if ($message instanceof \Throwable) { foreach (Helpers::getExceptionChain($message) as $exception) { @@ -104,10 +98,7 @@ public static function formatMessage($message): string } - /** - * @param mixed $message - */ - public static function formatLogLine($message, ?string $exceptionFile = null): string + public static function formatLogLine(mixed $message, ?string $exceptionFile = null): string { return implode(' ', [ date('[Y-m-d H-i-s]'), @@ -155,10 +146,7 @@ protected function logException(\Throwable $exception, ?string $file = null): st } - /** - * @param mixed $message - */ - protected function sendEmail($message): void + protected function sendEmail(mixed $message): void { $snooze = is_numeric($this->emailSnooze) ? $this->emailSnooze @@ -177,10 +165,9 @@ protected function sendEmail($message): void /** * Default mailer. - * @param mixed $message * @internal */ - public function defaultMailer($message, string $email): void + public function defaultMailer(mixed $message, string $email): void { $host = preg_replace('#[^\w.-]+#', '', $_SERVER['SERVER_NAME'] ?? php_uname('n')); $parts = str_replace( From a41ac67973e7340623402cbe4d16a2ffd5cb5c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Kep=C3=A1k?= Date: Sat, 1 Jan 2022 11:19:11 +0100 Subject: [PATCH 17/22] Debugger::timer: switch from microtime to hrtime hrtime is faster on virtual machines, due microtime use system call that need to change context from user to kernel (PHP7.3+) --- src/Tracy/Debugger/Debugger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index c51f188ce..9472222ce 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -519,10 +519,10 @@ public static function dump(mixed $var, bool $return = false): mixed public static function timer(?string $name = null): float { static $time = []; - $now = microtime(true); + $now = hrtime(true); $delta = isset($time[$name]) ? $now - $time[$name] : 0; $time[$name] = $now; - return $delta; + return $delta / 1e+9; } From d6253d2e2a5a200c1182eaf25e7357ddfc1c8764 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 6 May 2022 18:17:45 +0200 Subject: [PATCH 18/22] CSP: requires 'script-dynamic' --- readme.md | 8 ++++---- src/Tracy/Bar/assets/bar.js | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index eec4c2d31..542a20e92 100644 --- a/readme.md +++ b/readme.md @@ -49,7 +49,7 @@ Alternatively, you can download the whole package or [tracy.phar](https://github | Tracy | compatible with PHP | compatible with browsers |-----------|---------------|---------- -| Tracy 3.0 | PHP 8.0 – 8.2 | Chrome 64+, Firefox 69+, Safari 13.1+ and iOS Safari 13.4+ +| Tracy 3.0 | PHP 8.0 – 8.2 | Chrome 64+, Firefox 69+, Safari 15.4+ and iOS Safari 15.4+ | Tracy 2.9 | PHP 7.2 – 8.2 | Chrome 64+, Firefox 69+, Safari 13.1+ and iOS Safari 13.4+ | Tracy 2.8 | PHP 7.2 – 8.1 | Chrome 55+, Firefox 53+, Safari 11+ and iOS Safari 11+ | Tracy 2.7 | PHP 7.1 – 8.0 | Chrome 55+, Firefox 53+, MS Edge 16+, Safari 11+ and iOS Safari 11+ @@ -144,7 +144,7 @@ In order to detect misspellings when assigning to an object, we use [trait Nette Content Security Policy ----------------------- -If your site uses Content Security Policy, you'll need to add `'nonce-'` to `script-src` for Tracy to work properly. Some 3rd plugins may require additional directives. +If your site uses Content Security Policy, you'll need to add `'nonce-'` and `'strict-dynamic'` to `script-src` for Tracy to work properly. Some 3rd plugins may require additional directives. Nonce is not supported in the `style-src` directive, if you use this directive you need to add `'unsafe-inline'`, but this should be avoided in production mode. Configuration example for [Nette Framework](https://nette.org): @@ -152,14 +152,14 @@ Configuration example for [Nette Framework](https://nette.org): ```neon http: csp: - script-src: nonce + script-src: [nonce, strict-dynamic] ``` Example in pure PHP: ```php $nonce = base64_encode(random_bytes(20)); -header("Content-Security-Policy: script-src 'nonce-$nonce';"); +header("Content-Security-Policy: script-src 'nonce-$nonce' 'strict-dynamic';"); ``` diff --git a/src/Tracy/Bar/assets/bar.js b/src/Tracy/Bar/assets/bar.js index 58c7a65df..0cb96849d 100644 --- a/src/Tracy/Bar/assets/bar.js +++ b/src/Tracy/Bar/assets/bar.js @@ -2,8 +2,7 @@ * This file is part of the Tracy (https://tracy.nette.org) */ -let nonce = document.currentScript.getAttribute('nonce') || document.currentScript.nonce, - requestId = document.currentScript.dataset.id, +let requestId = document.currentScript.dataset.id, ajaxCounter = 1, baseUrl = location.href.split('#')[0]; @@ -520,7 +519,6 @@ class Debug } Debug.scriptElem = document.createElement('script'); Debug.scriptElem.src = url; - Debug.scriptElem.setAttribute('nonce', nonce); (document.body || document.documentElement).appendChild(Debug.scriptElem); } } @@ -532,7 +530,6 @@ function evalScripts(elem) { let document = script.ownerDocument; let dolly = document.createElement('script'); dolly.textContent = script.textContent; - dolly.setAttribute('nonce', nonce); (document.body || document.documentElement).appendChild(dolly); script.tracyEvaluated = true; } From 94e9e442edd6b7ead5734ae5a24ca8d78981b68a Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 31 May 2022 21:35:38 +0200 Subject: [PATCH 19/22] shadow dom for dumper [WIP] --- examples/assets/style.css | 4 +- src/Tracy/BlueScreen/assets/bluescreen.js | 5 ++- src/Tracy/Debugger/Debugger.php | 8 ++-- src/Tracy/Dumper/Dumper.php | 11 +++--- src/Tracy/Dumper/assets/dumper-dark.css | 9 ++++- src/Tracy/Dumper/assets/dumper-light.css | 9 ++++- src/Tracy/Dumper/assets/dumper.js | 47 +++++++++++++++++------ src/Tracy/assets/table-sort.js | 5 ++- src/Tracy/assets/tabs.js | 5 ++- src/Tracy/assets/toggle.js | 11 +++--- 10 files changed, 76 insertions(+), 38 deletions(-) diff --git a/examples/assets/style.css b/examples/assets/style.css index 6a75aeacc..ebc3b9e89 100644 --- a/examples/assets/style.css +++ b/examples/assets/style.css @@ -22,10 +22,8 @@ h2 { font-size: 140%; } -pre.tracy-dump { +tracy-dump { border: 1px solid silver; - padding: 1em; - margin: 1em 0; } a { diff --git a/src/Tracy/BlueScreen/assets/bluescreen.js b/src/Tracy/BlueScreen/assets/bluescreen.js index 7a1b5b68f..42985fad7 100644 --- a/src/Tracy/BlueScreen/assets/bluescreen.js +++ b/src/Tracy/BlueScreen/assets/bluescreen.js @@ -15,10 +15,11 @@ class BlueScreen } blueScreen.addEventListener('tracy-toggle', (e) => { - if (e.target.matches('#tracy-bs-toggle')) { // blue screen toggle + let target = e.composedPath()[0]; + if (target.matches('#tracy-bs-toggle')) { // blue screen toggle document.documentElement.classList.toggle('tracy-bs-visible', !e.detail.collapsed); - } else if (!e.target.matches('.tracy-dump *') && e.detail.originalEvent) { // panel toggle + } else if (!target.matches('.tracy-dump *') && e.detail.originalEvent) { // panel toggle e.detail.relatedTarget.classList.toggle('tracy-panel-fadein', !e.detail.collapsed); } }); diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 9472222ce..f298074c7 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -495,8 +495,10 @@ public static function dump(mixed $var, bool $return = false): mixed : Helpers::capture(fn() => Dumper::dump($var, $options)); } elseif (!self::$productionMode) { - $html = Helpers::isHtmlMode(); - echo $html ? '' : ''; + if ($html = Helpers::isHtmlMode()) { + Dumper::renderAssets(); + echo ''; + } Dumper::dump($var, [ Dumper::DEPTH => self::$maxDepth, Dumper::TRUNCATE => self::$maxLength, @@ -505,7 +507,7 @@ public static function dump(mixed $var, bool $return = false): mixed Dumper::THEME => self::$dumpTheme, Dumper::KEYS_TO_HIDE => self::$keysToHide, ]); - echo $html ? '' : ''; + echo $html ? '' : ''; } return $var; diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index d59677081..15a692074 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -103,7 +103,6 @@ public static function dump($var, array $options = []): mixed } elseif (Helpers::isHtmlMode()) { $options[self::LOCATION] ??= true; - self::renderAssets(); echo self::toHtml($var, $options); } else { @@ -153,18 +152,18 @@ public static function renderAssets(): void $sent = true; + echo '\n"; - if (!Debugger::isEnabled()) { - $s = '(function(){' . file_get_contents(__DIR__ . '/../assets/toggle.js') . '})();' - . '(function(){' . file_get_contents(__DIR__ . '/../Dumper/assets/dumper.js') . '})();'; - echo "", str_replace([' - - + + > From 37022c8b45da0ca330ac3399b11c4e0a5d5b171e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Forg=C3=A1=C4=8D?= Date: Wed, 15 Feb 2023 11:39:34 +0100 Subject: [PATCH 22/22] Debugger::barDump() can be temporarily disabled/enabled --- src/Tracy/Debugger/Debugger.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index f298074c7..70a5a3f26 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -36,6 +36,9 @@ class Debugger /** in production mode is suppressed any debugging output */ public static ?bool $productionMode = self::DETECT; + /** barDumps can be disabled or enabled on demand */ + public static bool $barDumpOn = true; + /** whether to display debug bar in development mode */ public static bool $showBar = true; @@ -535,7 +538,7 @@ public static function timer(?string $name = null): float */ public static function barDump(mixed $var, ?string $title = null, array $options = []): mixed { - if (!self::$productionMode) { + if (!self::$productionMode && self::$barDumpOn) { static $panel; if (!$panel) { self::getBar()->addPanel($panel = new DefaultBarPanel('dumps'), 'Tracy:dumps');