From 060461b90c7c06e3f6a6481a92d5124fb1f949bd Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 13 Oct 2022 01:13:20 +0200 Subject: [PATCH 01/30] 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 f2ff25a4c..fd889d042 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -66,7 +66,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 7088fb5be..136f7aa7d 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 02/30] 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 136f7aa7d..d6fa3d8af 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 2b136ada18026eaae541d248dd1c852f148c4bf1 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 22 Apr 2022 17:11:23 +0200 Subject: [PATCH 03/30] 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 d6fa3d8af..217735acf 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 ebe8fd4f77a28c15b2cef754873b628cec150b64 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 15 Dec 2021 05:05:33 +0100 Subject: [PATCH 04/30] removed FireLogger (BC break) --- 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 b883db257..84dfb1825 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 217735acf..18817f857 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() { @@ -584,18 +567,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 afad35aeb..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 = (array) $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: Fri, 10 Dec 2021 06:34:13 +0100 Subject: [PATCH 05/30] 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 d149ed2e92f4e86a57dbdb9c2d581d6f65e5b0de Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 8 Mar 2023 02:01:23 +0100 Subject: [PATCH 06/30] coding style --- src/Bridges/Nette/Bridge.php | 6 +- 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 | 6 +- 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 | 82 +++--- 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.sensitiveValue.phpt | 34 +-- 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 | 120 +++++---- tests/Tracy/dump().html.phpt | 36 +-- 62 files changed, 1916 insertions(+), 1681 deletions(-) diff --git a/src/Bridges/Nette/Bridge.php b/src/Bridges/Nette/Bridge.php index 15c49f500..1819ab024 100644 --- a/src/Bridges/Nette/Bridge.php +++ b/src/Bridges/Nette/Bridge.php @@ -27,11 +27,9 @@ public static function initialize(): void 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' + $blueScreen->addFileGenerator(fn(string $file) => substr($file, -6) === '.latte' ? "{block content}\n\$END\$" - : null; - }); + : null); Tracy\Debugger::addSourceMapper([self::class, 'mapLatteSourceCode']); } 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 fd889d042..8ddfeefb3 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -134,9 +134,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'))); } @@ -177,8 +175,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; @@ -319,7 +317,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 @@ -398,14 +396,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); @@ -451,7 +449,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; @@ -479,17 +477,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); } @@ -501,7 +497,7 @@ public function formatMessage(\Throwable $exception): string $msg = preg_replace( '#\'\S(?:[^\']|\\\\\')*\S\'|"\S(?:[^"]|\\\\")*\S"#', '$0', - $msg + $msg, ); // clickable class & methods @@ -520,18 +516,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 18817f857..495f981fc 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -40,7 +40,7 @@ class Debugger public static $showBar = true; /** @var int size of reserved memory */ - public static $reservedMemorySize = 500000; + public static $reservedMemorySize = 500_000; /** @var bool */ private static $enabled = false; @@ -494,9 +494,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..1fd045760 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; @@ -367,7 +365,7 @@ private static function escapeArg(string $s): string */ public static function capture(callable $func): string { - ob_start(function () {}); + ob_start(fn() => null); try { $func(); return ob_get_clean(); @@ -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.sensitiveValue.phpt b/tests/Tracy/Dumper.sensitiveValue.phpt index 33d5d6f24..1e437e43d 100644 --- a/tests/Tracy/Dumper.sensitiveValue.phpt +++ b/tests/Tracy/Dumper.sensitiveValue.phpt @@ -15,7 +15,7 @@ require __DIR__ . '/../bootstrap.php'; function sensitiveParameters( #[SensitiveParameter] string $secret, - string $normal + string $normal, ) { throw new Exception; } @@ -28,21 +28,21 @@ try { $expect = <<<'XX' -Exception #%d% - message: '' - string: '' - code: 0 - file: '%a%' - line: %d% - trace: array (1) - | 0 => array (4) - | | 'file' => '%a%' - | | 'line' => %d% - | | 'function' => 'sensitiveParameters' - | | 'args' => array (2) - | | | 0 => ***** (string) - | | | 1 => 'normal' - previous: null -XX; + Exception #%d% + message: '' + string: '' + code: 0 + file: '%a%' + line: %d% + trace: array (1) + | 0 => array (4) + | | 'file' => '%a%' + | | 'line' => %d% + | | 'function' => 'sensitiveParameters' + | | 'args' => array (2) + | | | 0 => ***** (string) + | | | 1 => 'normal' + previous: null + XX; Assert::match($expect, Dumper::toText($e)); 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 587e827d9..d92ecf3d3 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 { @@ -89,37 +97,41 @@ 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 + ArrayObjectChild #%d% + prop: 123 + storage: array (2) + | 'a' => 1 + | 'b' => 2 + XX , Dumper::toText($obj)); // ArrayIterator $obj = new ArrayIterator(['a' => 1, 'b' => 2]); -Assert::match(<<<'XX' -ArrayIterator #%d% - a: 1 - b: 2 -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + ArrayIterator #%d% + a: 1 + b: 2 + XX, + Dumper::toText($obj), +); // Tracy\Dumper\Value $obj = new Tracy\Dumper\Value(Tracy\Dumper\Value::TypeText, 'ahoj'); -Assert::match(<<<'XX' -Tracy\Dumper\Value #%d% - type: 'text' - value: 'ahoj' - length: null - depth: null - id: null - holder: null - items: null - editor: null - collapsed: null -XX - , Dumper::toText($obj)); +Assert::match( + <<<'XX' + Tracy\Dumper\Value #%d% + type: 'text' + value: 'ahoj' + length: null + depth: null + id: null + holder: null + items: null + editor: null + collapsed: null + 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 31ee43e7f52ca72890d62f7a0d225d164511fb44 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 7 Apr 2022 18:06:37 +0200 Subject: [PATCH 07/30] 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 10ad9b33e5678ae08b1a9a91dde57a0e8c7e6f2f Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 3 Feb 2022 17:37:54 +0100 Subject: [PATCH 08/30] 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 | 34 ++--- src/Tracy/Debugger/Debugger.php | 125 ++++++++---------- src/Tracy/Debugger/DeferredContent.php | 11 +- src/Tracy/Debugger/DevelopmentStrategy.php | 11 +- src/Tracy/Dumper/Describer.php | 32 ++--- src/Tracy/Dumper/Dumper.php | 20 +-- src/Tracy/Dumper/Renderer.php | 43 ++---- src/Tracy/Dumper/Value.php | 35 ++--- src/Tracy/OutputDebugger/OutputDebugger.php | 2 +- src/Tracy/Session/FileSession.php | 15 +-- .../PsrToTracyLoggerAdapter.phpt | 2 +- .../TracyToPsrLoggerAdapter.phpt | 2 +- tests/Tracy/Dumper.toText().specials.phpt | 2 +- 18 files changed, 133 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 c2e39ebe5..a467f2acf 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 8ddfeefb3..c082bf486 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -18,46 +18,36 @@ 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; - - /** @var int */ - public $maxLength = 150; - - /** @var int */ - public $maxItems = 100; + public int $maxDepth = 5; + public int $maxLength = 150; + 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 = [ + public array $keysToHide = [ 'password', 'passwd', 'pass', 'pwd', 'creditcard', 'credit card', 'cc', 'pin', 'authorization', 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 = []; - - /** @var callable[] */ - private $fileGenerators = []; - - /** @var array */ - private $snapshot; + private array $actions = []; + private array $fileGenerators = []; + 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 495f981fc..c3b4df966 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 = 500_000; + /** size of reserved memory */ + public static int $reservedMemorySize = 500_000; - /** @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,41 @@ 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 = null; - /** @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; - - /** @var Bar */ - private static $bar; - - /** @var ILogger */ - private static $logger; + private static BlueScreen $blueScreen; + private static Bar $bar; + private static ILogger $logger; /** @var array{DevelopmentStrategy, ProductionStrategy} */ - private static $strategy; - - /** @var SessionStorage */ - private static $sessionStorage; + private static array $strategy; + private static SessionStorage $sessionStorage; /** @@ -391,7 +382,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 +397,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 +416,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 +441,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 +452,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..9458631db 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 */ + /** @var (callable(string, mixed): bool)|null */ 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 d28b0f44c..ca024d2c8 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'], @@ -88,11 +85,8 @@ class Dumper Ds\Map::class => [Exposer::class, 'exposeDsMap'], ]; - /** @var Describer */ - private $describer; - - /** @var Renderer */ - private $renderer; + private Describer $describer; + private Renderer $renderer; /** @@ -210,7 +204,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..42bda8a5d 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; + public int|bool $collapseTop = 14; + public int $collapseSub = 7; + public bool $classLocation = false; + public bool $sourceLocation = false; - /** @var int */ - public $collapseSub = 7; - - /** @var bool */ - public $classLocation = false; - - /** @var bool */ - public $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; + /** lazy-loading via JavaScript? true=full, false=none, null=collapsed parts */ + 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/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) diff --git a/tests/Tracy/Dumper.toText().specials.phpt b/tests/Tracy/Dumper.toText().specials.phpt index d92ecf3d3..ecda7d269 100644 --- a/tests/Tracy/Dumper.toText().specials.phpt +++ b/tests/Tracy/Dumper.toText().specials.phpt @@ -128,7 +128,7 @@ Assert::match( length: null depth: null id: null - holder: null + holder: unset items: null editor: null collapsed: null From df64c1967b5ef59a3f6ca69fe830fe7d60d54cb5 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 16 Dec 2021 04:06:26 +0100 Subject: [PATCH 09/30] added PHP 8 typehints --- src/Bridges/Nette/MailSender.php | 5 +-- src/Bridges/Nette/TracyExtension.php | 2 +- src/Bridges/Psr/PsrToTracyLoggerAdapter.php | 2 +- src/Tracy/BlueScreen/BlueScreen.php | 8 +--- src/Tracy/Debugger/Debugger.php | 21 +++++----- src/Tracy/Debugger/DeferredContent.php | 2 +- src/Tracy/Dumper/Describer.php | 45 +++++++-------------- src/Tracy/Dumper/Dumper.php | 13 +++--- src/Tracy/Dumper/Exposer.php | 11 ++--- src/Tracy/Dumper/Renderer.php | 23 +++-------- src/Tracy/Dumper/Value.php | 2 +- src/Tracy/Helpers.php | 8 ++-- src/Tracy/Logger/ILogger.php | 2 +- src/Tracy/Logger/Logger.php | 10 ++--- src/Tracy/functions.php | 6 +-- 15 files changed, 61 insertions(+), 99 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 a467f2acf..736071cc4 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/Bridges/Psr/PsrToTracyLoggerAdapter.php b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php index 291b06084..ab9cc3bc3 100644 --- a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php +++ b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php @@ -37,7 +37,7 @@ public function __construct(Psr\Log\LoggerInterface $psrLogger) } - public function log($value, $level = self::INFO) + public function log(mixed $value, string $level = self::INFO) { if ($value instanceof \Throwable) { $message = Tracy\Helpers::getClass($value) . ': ' . $value->getMessage() . ($value->getCode() ? ' #' . $value->getCode() : '') . ' in ' . $value->getFile() . ':' . $value->getLine(); diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index c082bf486..b1df8ca8e 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -97,11 +97,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; @@ -147,7 +143,7 @@ public function renderToFile(\Throwable $exception, string $file): bool } - private function renderTemplate(\Throwable $exception, string $template, $toScreen = true): void + private function renderTemplate(\Throwable $exception, string $template, bool $toScreen = true): void { [$generators, $fibers] = $this->findGeneratorsAndFibers($exception); $headersSent = headers_sent($headersFile, $headersLine); diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index c3b4df966..4b34bbc19 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -161,7 +161,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) @@ -426,8 +430,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 @@ -475,7 +479,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 = [ @@ -522,10 +526,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; @@ -547,10 +550,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); } @@ -580,7 +581,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/Debugger/DeferredContent.php b/src/Tracy/Debugger/DeferredContent.php index ba3b11a72..2ed27ffca 100644 --- a/src/Tracy/Debugger/DeferredContent.php +++ b/src/Tracy/Debugger/DeferredContent.php @@ -47,7 +47,7 @@ public function &getItems(string $key): array } - public function addSetup(string $method, $argument): void + public function addSetup(string $method, mixed $argument): void { $argument = json_encode($argument, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE); $item = &$this->getItems('setup')[$this->requestId]; diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index 9458631db..a392881ee 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -48,7 +48,7 @@ final class Describer public array $references = []; - public function describe($var): \stdClass + public function describe(mixed $var): \stdClass { uksort($this->objectExposers, fn($a, $b): int => $b === '' || (class_exists($a, false) && is_subclass_of($a, $b)) ? -1 : 1); @@ -67,10 +67,7 @@ public function describe($var): \stdClass } - /** - * @return mixed - */ - private function describeVar($var, int $depth = 0, ?int $refId = null) + private function describeVar(mixed $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; @@ -250,11 +232,12 @@ public function describeKey(string $key) public function addPropertyTo( Value $value, string $k, - $v, - $type = Value::PropertyVirtual, + mixed $v, + int $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; @@ -288,7 +271,7 @@ private function exposeObject(object $obj, Value $value): ?array } - private function isSensitive(string $key, $val, ?string $class = null): bool + private function isSensitive(string $key, mixed $val, ?string $class = null): bool { return $val instanceof \SensitiveParameterValue || ($this->scrubber !== null && ($this->scrubber)($key, $val, $class)) @@ -297,7 +280,7 @@ private function isSensitive(string $key, $val, ?string $class = null): bool } - private static function hideValue($val): string + private static function hideValue(mixed $val): string { if ($val instanceof \SensitiveParameterValue) { $val = $val->getValue(); @@ -307,7 +290,7 @@ private static function hideValue($val): string } - public function getReferenceId($arr, $key): ?int + public function getReferenceId(array $arr, string|int $key): ?int { if ((!$rr = \ReflectionReference::fromArrayElement($arr, $key))) { return null; diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index ca024d2c8..0cc1ae7b9 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -91,9 +91,8 @@ class Dumper /** * Dumps variable to the output. - * @return mixed variable */ - public static function dump($var, array $options = []) + public static function dump(mixed $var, array $options = []): mixed { if (Helpers::isCli()) { $useColors = self::$terminalColors && Helpers::detectColors(); @@ -116,7 +115,7 @@ public static function dump($var, array $options = []) /** * Dumps variable to HTML. */ - public static function toHtml($var, array $options = [], $key = null): string + public static function toHtml(mixed $var, array $options = [], mixed $key = null): string { return (new self($options))->asHtml($var, $key); } @@ -125,7 +124,7 @@ public static function toHtml($var, array $options = [], $key = null): string /** * Dumps variable to plain text. */ - public static function toText($var, array $options = []): string + public static function toText(mixed $var, array $options = []): string { return (new self($options))->asTerminal($var); } @@ -134,7 +133,7 @@ public static function toText($var, array $options = []): string /** * Dumps variable to x-terminal. */ - public static function toTerminal($var, array $options = []): string + public static function toTerminal(mixed $var, array $options = []): string { return (new self($options))->asTerminal($var, self::$terminalColors); } @@ -212,7 +211,7 @@ private function __construct(array $options = []) /** * Dumps variable to HTML. */ - private function asHtml($var, $key = null): string + private function asHtml(mixed $var, mixed $key = null): string { if ($key === null) { $model = $this->describer->describe($var); @@ -228,7 +227,7 @@ private function asHtml($var, $key = null): string /** * Dumps variable to x-terminal. */ - private function asTerminal($var, array $colors = []): string + private function asTerminal(mixed $var, array $colors = []): string { $model = $this->describer->describe($var); return $this->renderer->renderAsText($model, $colors); diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 1d415ec15..36dbc6c5b 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -53,7 +53,7 @@ public static function exposeObject(object $obj, Value $value, Describer $descri } - private static function getProperties($class): array + private static function getProperties(string $class): array { static $cache; if (isset($cache[$class])) { @@ -142,10 +142,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 42bda8a5d..8f42c486a 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 ('; @@ -422,7 +411,7 @@ private function renderResource(Value $resource, int $depth): string } - private function copySnapshot($value): void + private function copySnapshot(mixed $value): void { if ($this->collectingMode) { return; @@ -449,11 +438,11 @@ private function copySnapshot($value): void } - public static function jsonEncode($snapshot): string + public static function jsonEncode(mixed $value): string { $old = @ini_set('serialize_precision', '-1'); // @ may be disabled try { - return json_encode($snapshot, JSON_HEX_APOS | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + return json_encode($value, JSON_HEX_APOS | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } finally { if ($old !== false) { ini_set('serialize_precision', $old); diff --git a/src/Tracy/Dumper/Value.php b/src/Tracy/Dumper/Value.php index 25d178213..5fa6e44c6 100644 --- a/src/Tracy/Dumper/Value.php +++ b/src/Tracy/Dumper/Value.php @@ -43,7 +43,7 @@ final class Value implements \JsonSerializable public ?bool $collapsed = null; - public function __construct(string $type, $value = null, ?int $length = null) + public function __construct(string $type, string|int|null $value = null, ?int $length = null) { $this->type = $type; $this->value = $value; diff --git a/src/Tracy/Helpers.php b/src/Tracy/Helpers.php index 1fd045760..c51948a71 100644 --- a/src/Tracy/Helpers.php +++ b/src/Tracy/Helpers.php @@ -85,13 +85,13 @@ public static function formatHtml(string $mask): string } - public static function escapeHtml($s): string + public static function escapeHtml(mixed $s): string { return htmlspecialchars((string) $s, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8'); } - public static function findTrace(array $trace, $method, ?int &$index = null): ?array + public static function findTrace(array $trace, array|string $method, ?int &$index = null): ?array { $m = is_array($method) ? $method : explode('::', $method); foreach ($trace as $i => $item) { @@ -110,7 +110,7 @@ public static function findTrace(array $trace, $method, ?int &$index = null): ?a } - public static function getClass($obj): string + public static function getClass(object $obj): string { return explode("\x00", $obj::class)[0]; } @@ -579,7 +579,7 @@ public static function getExceptionChain(\Throwable $ex): array } - public static function traverseValue($val, callable $callback, array &$skip = [], ?string $refId = null): void + public static function traverseValue(mixed $val, callable $callback, array &$skip = [], ?string $refId = null): void { if (is_object($val)) { $id = spl_object_id($val); diff --git a/src/Tracy/Logger/ILogger.php b/src/Tracy/Logger/ILogger.php index 6df8b6017..de32dab75 100644 --- a/src/Tracy/Logger/ILogger.php +++ b/src/Tracy/Logger/ILogger.php @@ -23,5 +23,5 @@ interface ILogger EXCEPTION = 'exception', CRITICAL = 'critical'; - function log($value, $level = self::INFO); + function log(mixed $value, string $level = self::INFO); } diff --git a/src/Tracy/Logger/Logger.php b/src/Tracy/Logger/Logger.php index 2a50a8e78..760de01e4 100644 --- a/src/Tracy/Logger/Logger.php +++ b/src/Tracy/Logger/Logger.php @@ -34,10 +34,7 @@ class Logger implements ILogger private $blueScreen; - /** - * @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; @@ -48,11 +45,10 @@ public function __construct(?string $directory, $email = null, ?BlueScreen $blue /** * Logs message or exception to file and sends email notification. - * @param mixed $message - * @param string $level one of constant ILogger::INFO, WARNING, ERROR (sends email), EXCEPTION (sends email), CRITICAL (sends email) + * For levels ERROR, EXCEPTION and CRITICAL it sends email. * @return string|null logged error filename */ - public function log($message, $level = self::INFO) + public function log(mixed $message, string $level = self::INFO) { if (!$this->directory) { throw new \LogicException('Logging directory is not specified.'); diff --git a/src/Tracy/functions.php b/src/Tracy/functions.php index f110f228a..ab00b0d7a 100644 --- a/src/Tracy/functions.php +++ b/src/Tracy/functions.php @@ -12,7 +12,7 @@ * Tracy\Debugger::dump() shortcut. * @tracySkipLocation */ - function dump($var) + function dump(mixed $var): mixed { array_map([Tracy\Debugger::class, 'dump'], func_get_args()); return $var; @@ -24,7 +24,7 @@ function dump($var) * Tracy\Debugger::dump() & exit shortcut. * @tracySkipLocation */ - function dumpe($var): void + function dumpe(mixed $var): void { array_map([Tracy\Debugger::class, 'dump'], func_get_args()); if (!Tracy\Debugger::$productionMode) { @@ -38,7 +38,7 @@ function dumpe($var): void * Tracy\Debugger::barDump() shortcut. * @tracySkipLocation */ - function bdump($var) + function bdump(mixed $var): mixed { Tracy\Debugger::barDump(...func_get_args()); return $var; From 8fd56c0ec5128b37c4d1c6ba1bc7404e7b776126 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 2 Mar 2023 12:18:31 +0100 Subject: [PATCH 10/30] used constructor promotion --- src/Bridges/Nette/TracyExtension.php | 11 ++++------- src/Bridges/Psr/PsrToTracyLoggerAdapter.php | 8 +++----- src/Bridges/Psr/TracyToPsrLoggerAdapter.php | 8 +++----- src/Tracy/Debugger/DevelopmentStrategy.php | 15 +++++---------- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/Bridges/Nette/TracyExtension.php b/src/Bridges/Nette/TracyExtension.php index 736071cc4..cb0142122 100644 --- a/src/Bridges/Nette/TracyExtension.php +++ b/src/Bridges/Nette/TracyExtension.php @@ -22,14 +22,11 @@ class TracyExtension extends Nette\DI\CompilerExtension { private const ErrorSeverityPattern = 'E_(?:ALL|PARSE|STRICT|RECOVERABLE_ERROR|(?:CORE|COMPILE)_(?:ERROR|WARNING)|(?:USER_)?(?:ERROR|WARNING|NOTICE|DEPRECATED))'; - private bool $debugMode; - private bool $cliMode; - - public function __construct(bool $debugMode = false, bool $cliMode = false) - { - $this->debugMode = $debugMode; - $this->cliMode = $cliMode; + public function __construct( + private bool $debugMode = false, + private bool $cliMode = false, + ) { } diff --git a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php index ab9cc3bc3..c1ba5956e 100644 --- a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php +++ b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php @@ -28,12 +28,10 @@ class PsrToTracyLoggerAdapter implements Tracy\ILogger Tracy\ILogger::CRITICAL => Psr\Log\LogLevel::CRITICAL, ]; - private Psr\Log\LoggerInterface $psrLogger; - - public function __construct(Psr\Log\LoggerInterface $psrLogger) - { - $this->psrLogger = $psrLogger; + public function __construct( + private Psr\Log\LoggerInterface $psrLogger, + ) { } diff --git a/src/Bridges/Psr/TracyToPsrLoggerAdapter.php b/src/Bridges/Psr/TracyToPsrLoggerAdapter.php index 3c52f3b9e..7b1f578e9 100644 --- a/src/Bridges/Psr/TracyToPsrLoggerAdapter.php +++ b/src/Bridges/Psr/TracyToPsrLoggerAdapter.php @@ -30,12 +30,10 @@ class TracyToPsrLoggerAdapter extends Psr\Log\AbstractLogger Psr\Log\LogLevel::DEBUG => Tracy\ILogger::DEBUG, ]; - private Tracy\ILogger $tracyLogger; - - public function __construct(Tracy\ILogger $tracyLogger) - { - $this->tracyLogger = $tracyLogger; + public function __construct( + private Tracy\ILogger $tracyLogger, + ) { } diff --git a/src/Tracy/Debugger/DevelopmentStrategy.php b/src/Tracy/Debugger/DevelopmentStrategy.php index e43649943..d778027d3 100644 --- a/src/Tracy/Debugger/DevelopmentStrategy.php +++ b/src/Tracy/Debugger/DevelopmentStrategy.php @@ -17,16 +17,11 @@ */ final class DevelopmentStrategy { - private Bar $bar; - private BlueScreen $blueScreen; - private DeferredContent $defer; - - - public function __construct(Bar $bar, BlueScreen $blueScreen, DeferredContent $defer) - { - $this->bar = $bar; - $this->blueScreen = $blueScreen; - $this->defer = $defer; + public function __construct( + private Bar $bar, + private BlueScreen $blueScreen, + private DeferredContent $defer, + ) { } From ec5276c0db1e9d0a66189a3c03f682445a9db289 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 9 May 2022 15:50:03 +0200 Subject: [PATCH 11/30] Dumper: added ArrayIterator exposer needed to use get_mangled_object_vars() --- src/Tracy/Dumper/Dumper.php | 1 + src/Tracy/Dumper/Exposer.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index 0cc1ae7b9..0939fb773 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -73,6 +73,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 36dbc6c5b..590e53bff 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -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] : []; From 905c3d0644191773258369aedd187ef7bfeacc3a Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 12 Dec 2021 07:21:06 +0100 Subject: [PATCH 12/30] used native PHP 8 features --- src/Bridges/Psr/PsrToTracyLoggerAdapter.php | 2 +- src/Tracy/BlueScreen/BlueScreen.php | 8 ++++---- src/Tracy/BlueScreen/assets/page.phtml | 2 +- .../BlueScreen/assets/section-exception-exception.phtml | 2 +- src/Tracy/BlueScreen/assets/section-header.phtml | 4 ++-- src/Tracy/BlueScreen/assets/section-stack-callStack.phtml | 2 +- src/Tracy/Debugger/Debugger.php | 2 +- src/Tracy/Dumper/Describer.php | 4 ++-- src/Tracy/Dumper/Exposer.php | 4 ++-- src/Tracy/Helpers.php | 6 ------ src/Tracy/Logger/Logger.php | 2 +- tests/Tracy/Dumper.keysToHide.phpt | 2 +- tests/Tracy/Dumper.scrubber.phpt | 8 ++++---- tests/Tracy/Dumper.toHtml().key.phpt | 2 +- tools/create-phar/create-phar.php | 4 ++-- 15 files changed, 24 insertions(+), 30 deletions(-) diff --git a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php index c1ba5956e..5d8b0430b 100644 --- a/src/Bridges/Psr/PsrToTracyLoggerAdapter.php +++ b/src/Bridges/Psr/PsrToTracyLoggerAdapter.php @@ -38,7 +38,7 @@ public function __construct( public function log(mixed $value, string $level = self::INFO) { if ($value instanceof \Throwable) { - $message = Tracy\Helpers::getClass($value) . ': ' . $value->getMessage() . ($value->getCode() ? ' #' . $value->getCode() : '') . ' in ' . $value->getFile() . ':' . $value->getLine(); + $message = get_debug_type($value) . ': ' . $value->getMessage() . ($value->getCode() ? ' #' . $value->getCode() : '') . ' in ' . $value->getFile() . ':' . $value->getLine(); $context = ['exception' => $value]; } elseif (!is_string($value)) { diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index b1df8ca8e..766831be9 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -148,12 +148,12 @@ private function renderTemplate(\Throwable $exception, string $template, bool $t [$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 ? Helpers::errorTypeToString($exception->getSeverity()) - : Helpers::getClass($exception); + : get_debug_type($exception); $lastError = $exception instanceof \ErrorException || $exception instanceof \Error ? null : error_get_last(); @@ -272,7 +272,7 @@ private function renderActions(\Throwable $ex): array ]; } - $query = ($ex instanceof \ErrorException ? '' : Helpers::getClass($ex) . ' ') + $query = ($ex instanceof \ErrorException ? '' : get_debug_type($ex) . ' ') . preg_replace('#\'.*\'|".*"#Us', '', $ex->getMessage()); $actions[] = [ 'link' => 'https://www.google.com/search?sourceid=tracy&q=' . urlencode($query), @@ -527,7 +527,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('getFile() . ':' . $exception->getLine())) ?> --> 1): ?> diff --git a/src/Tracy/BlueScreen/assets/section-exception-exception.phtml b/src/Tracy/BlueScreen/assets/section-exception-exception.phtml index 82af273bc..104edd4e3 100644 --- a/src/Tracy/BlueScreen/assets/section-exception-exception.phtml +++ b/src/Tracy/BlueScreen/assets/section-exception-exception.phtml @@ -9,7 +9,7 @@ namespace Tracy; * @var callable $dump */ -if (count((array) $ex) <= count((array) new \Exception)) { +if (count(get_mangled_object_vars($ex)) <= count(get_mangled_object_vars(new \Exception))) { return; } ?> diff --git a/src/Tracy/BlueScreen/assets/section-header.phtml b/src/Tracy/BlueScreen/assets/section-header.phtml index 8be19a997..a6f049473 100644 --- a/src/Tracy/BlueScreen/assets/section-header.phtml +++ b/src/Tracy/BlueScreen/assets/section-header.phtml @@ -13,7 +13,7 @@ namespace Tracy; $title = $ex instanceof \ErrorException ? Helpers::errorTypeToString($ex->getSeverity()) - : Helpers::getClass($ex); + : get_debug_type($ex); $code = $ex->getCode() ? ' #' . $ex->getCode() : ''; ?> @@ -30,6 +30,6 @@ $code = $ex->getCode() ? ' #' . $ex->getCode() : ''; getPrevious()): ?> diff --git a/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml b/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml index fa94d4e51..9b9cbe639 100644 --- a/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml +++ b/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml @@ -72,7 +72,7 @@ if (!$stack) { try { $r = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']); $params = $r->getParameters(); - } catch (\Exception $e) { + } catch (\Exception) { $params = []; } foreach ($row['args'] as $k => $v) { diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 4b34bbc19..ec98af32e 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -308,7 +308,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/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index a392881ee..8126662e4 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -167,7 +167,7 @@ private function describeObject(object $obj, int $depth = 0): Value return new Value(Value::TypeRef, $id); } - $value = new Value(Value::TypeObject, Helpers::getClass($obj)); + $value = new Value(Value::TypeObject, get_debug_type($obj)); $value->id = $id; $value->depth = $depth; $value->holder = $obj; // to be not released by garbage collector in collecting mode @@ -286,7 +286,7 @@ private static function hideValue(mixed $val): string $val = $val->getValue(); } - return self::HiddenValue . ' (' . (is_object($val) ? Helpers::getClass($val) : gettype($val)) . ')'; + return self::HiddenValue . ' (' . get_debug_type($val) . ')'; } diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 590e53bff..b4812da93 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) { @@ -208,7 +208,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) { diff --git a/src/Tracy/Helpers.php b/src/Tracy/Helpers.php index c51948a71..dc27bdfce 100644 --- a/src/Tracy/Helpers.php +++ b/src/Tracy/Helpers.php @@ -110,12 +110,6 @@ public static function findTrace(array $trace, array|string $method, ?int &$inde } - public static function getClass(object $obj): string - { - return explode("\x00", $obj::class)[0]; - } - - /** @internal */ public static function fixStack(\Throwable $exception): \Throwable { diff --git a/src/Tracy/Logger/Logger.php b/src/Tracy/Logger/Logger.php index 760de01e4..4ef677798 100644 --- a/src/Tracy/Logger/Logger.php +++ b/src/Tracy/Logger/Logger.php @@ -87,7 +87,7 @@ public static function formatMessage($message): string foreach (Helpers::getExceptionChain($message) as $exception) { $tmp[] = ($exception instanceof \ErrorException ? Helpers::errorTypeToString($exception->getSeverity()) . ': ' . $exception->getMessage() - : Helpers::getClass($exception) . ': ' . $exception->getMessage() . ($exception->getCode() ? ' #' . $exception->getCode() : '') + : get_debug_type($exception) . ': ' . $exception->getMessage() . ($exception->getCode() ? ' #' . $exception->getCode() : '') ) . ' in ' . $exception->getFile() . ':' . $exception->getLine(); } diff --git a/tests/Tracy/Dumper.keysToHide.phpt b/tests/Tracy/Dumper.keysToHide.phpt index a6a826171..613d884c3 100644 --- a/tests/Tracy/Dumper.keysToHide.phpt +++ b/tests/Tracy/Dumper.keysToHide.phpt @@ -25,7 +25,7 @@ $obj = (object) [ Assert::match( <<<'XX' stdClass #%d% - a: ***** (integer) + a: ***** (int) password: ***** (string) PASSWORD: ***** (string) Pin: ***** (string) diff --git a/tests/Tracy/Dumper.scrubber.phpt b/tests/Tracy/Dumper.scrubber.phpt index 567d1910b..40f63280a 100644 --- a/tests/Tracy/Dumper.scrubber.phpt +++ b/tests/Tracy/Dumper.scrubber.phpt @@ -33,13 +33,13 @@ $expect1 = <<<'XX' PASSWORD: 'secret2' Pin: ***** (string) foo: ***** (string) - q: ***** (integer) + q: ***** (int) inner: array (5) | 'a' => 123 | 'password' => 'secret4' | 'PASSWORD' => 'secret5' | 'Pin' => ***** (string) - | 'bar' => ***** (integer) + | 'bar' => ***** (int) XX; Assert::match($expect1, Dumper::toText($obj, [Dumper::SCRUBBER => $scrubber])); @@ -52,13 +52,13 @@ $expect2 = <<<'XX' PASSWORD: ***** (string) Pin: ***** (string) foo: ***** (string) - q: ***** (integer) + q: ***** (int) inner: array (5) | 'a' => 123 | 'password' => ***** (string) | 'PASSWORD' => ***** (string) | 'Pin' => ***** (string) - | 'bar' => ***** (integer) + | 'bar' => ***** (int) XX; Assert::match($expect2, Dumper::toText($obj, [Dumper::SCRUBBER => $scrubber, Dumper::KEYS_TO_HIDE => ['password']])); diff --git a/tests/Tracy/Dumper.toHtml().key.phpt b/tests/Tracy/Dumper.toHtml().key.phpt index 07618db8e..6c4f40e0d 100644 --- a/tests/Tracy/Dumper.toHtml().key.phpt +++ b/tests/Tracy/Dumper.toHtml().key.phpt @@ -15,6 +15,6 @@ Assert::match( ); Assert::match( - '
***** (integer)
', + '
***** (int)
', Dumper::toHtml(123, [Dumper::KEYS_TO_HIDE => ['password', 'pin']], 'password'), ); 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: Fri, 6 May 2022 18:17:45 +0200 Subject: [PATCH 13/30] 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 84dfb1825..799c0435d 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 2.10| PHP 8.0 – 8.2 | Chrome 64+, Firefox 69+, Safari 13.1+ and iOS Safari 13.4+ +| Tracy 2.10| 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 50f36902c..c37a48809 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]; @@ -525,7 +524,6 @@ class Debug } Debug.scriptElem = document.createElement('script'); Debug.scriptElem.src = url; - Debug.scriptElem.setAttribute('nonce', nonce); (document.body || document.documentElement).appendChild(Debug.scriptElem); } } @@ -537,7 +535,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 ae32c0f8cd99f91e65815017b02e5592abd54790 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 14/30] 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 ec98af32e..4d2c43877 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -516,10 +516,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 / 1e9; } From df85dcb4d2b9bb9fd7e5727452d374fe2c7ef93c Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 27 Feb 2023 20:10:52 +0100 Subject: [PATCH 15/30] BlueScreen: added support for sensitive markers /*sensitive{*/ and /*}*/ [Closes #426] --- src/Tracy/BlueScreen/BlueScreen.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index 766831be9..e9bdce188 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -338,6 +338,7 @@ public static function highlightPhp(string $source, int $line, int $lines = 15, $source = preg_replace('#(__halt_compiler\s*\(\)\s*;).*#is', '$1', $source); $source = str_replace(["\r\n", "\r"], "\n", $source); + $source = preg_replace('#/\*sensitive\{\*/.*?/\*\}\*/#s', Dumper\Describer::HiddenValue, $source); $source = explode("\n", highlight_string($source, true)); $out = $source[0]; // $source = str_replace('
', "\n", $source[1]); From 960e86ca8e96f077e7ff136d20d308212c3bfdbd Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 7 Mar 2023 01:01:09 +0100 Subject: [PATCH 16/30] Describer::addPropertyTo() added $described --- src/Tracy/Dumper/Describer.php | 3 ++- src/Tracy/Dumper/Exposer.php | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index 8126662e4..cd057e462 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -236,6 +236,7 @@ public function addPropertyTo( int $type = Value::PropertyVirtual, ?int $refId = null, ?string $class = null, + ?Value $described = null, ): void { if ($value->depth && $this->maxItems && count($value->items ?? []) >= $this->maxItems) { @@ -248,7 +249,7 @@ public function addPropertyTo( $this->describeKey($k), $type !== Value::PropertyVirtual && $this->isSensitive($k, $v, $class) ? new Value(Value::TypeText, self::hideValue($v)) - : $this->describeVar($v, $value->depth + 1, $refId), + : ($described ?? $this->describeVar($v, $value->depth + 1, $refId)), $type === Value::PropertyPrivate ? $class : $type, ] + ($refId ? [3 => $refId] : []); } diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index b4812da93..2472d52c3 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -43,11 +43,14 @@ public static function exposeObject(object $obj, Value $value, Describer $descri $class, ); } else { - $value->items[] = [ + $describer->addPropertyTo( + $value, $name, - new Value(Value::TypeText, 'unset'), - $type === Value::PropertyPrivate ? $class : $type, - ]; + null, + $type, + class: $class, + described: new Value(Value::TypeText, 'unset'), + ); } } } @@ -107,7 +110,7 @@ public static function exposeClosure(\Closure $obj, Value $value, Describer $des if ($uses) { $useValue->value = implode(', ', $uses); $useValue->collapsed = true; - $value->items[] = ['use', $useValue]; + $describer->addPropertyTo($value, 'use', null, described: $useValue); } } From 1363c8236520fd11afa16b27d29c478d079a6f7d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 7 Mar 2023 01:01:09 +0100 Subject: [PATCH 17/30] Dumper: added support for enum/flags properties --- src/Tracy/Dumper/Describer.php | 18 +++ src/Tracy/Dumper/Dumper.php | 10 ++ src/Tracy/Dumper/Exposer.php | 5 +- src/Tracy/Helpers.php | 25 +++++ ...Dumper.toText().enumProperty.PhpToken.phpt | 54 +++++++++ tests/Tracy/Dumper.toText().enumProperty.phpt | 105 ++++++++++++++++++ 6 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 tests/Tracy/Dumper.toText().enumProperty.PhpToken.phpt create mode 100644 tests/Tracy/Dumper.toText().enumProperty.phpt diff --git a/src/Tracy/Dumper/Describer.php b/src/Tracy/Dumper/Describer.php index cd057e462..be0d6e1c2 100644 --- a/src/Tracy/Dumper/Describer.php +++ b/src/Tracy/Dumper/Describer.php @@ -44,6 +44,9 @@ final class Describer /** @var array */ public array $objectExposers = []; + /** @var array */ + public array $enumProperties = []; + /** @var (int|\stdClass)[] */ public array $references = []; @@ -291,6 +294,21 @@ private static function hideValue(mixed $val): string } + public function describeEnumProperty(string $class, string $property, mixed $value): ?Value + { + [$set, $constants] = $this->enumProperties["$class::$property"] ?? null; + if (!is_int($value) + || !$constants + || !($constants = Helpers::decomposeFlags($value, $set, $constants)) + ) { + return null; + } + + $constants = array_map(fn(string $const): string => str_replace("$class::", 'self::', $const), $constants); + return new Value(Value::TypeNumber, implode(' | ', $constants) . " ($value)"); + } + + public function getReferenceId(array $arr, string|int $key): ?int { if ((!$rr = \ReflectionReference::fromArrayElement($arr, $key))) { diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index 0939fb773..06bece26a 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -86,6 +86,9 @@ class Dumper Ds\Map::class => [Exposer::class, 'exposeDsMap'], ]; + /** @var array */ + private static array $enumProperties = []; + private Describer $describer; private Renderer $renderer; @@ -181,6 +184,7 @@ private function __construct(array $options = []) $describer->keysToHide = array_flip(array_map('strtolower', $options[self::KEYS_TO_HIDE] ?? [])); $describer->resourceExposers = ($options['resourceExporters'] ?? []) + self::$resources; $describer->objectExposers = ($options[self::OBJECT_EXPORTERS] ?? []) + self::$objectExporters; + $describer->enumProperties = self::$enumProperties; $describer->location = (bool) $location; if ($options[self::LIVE] ?? false) { $tmp = &self::$liveSnapshot; @@ -241,4 +245,10 @@ public static function formatSnapshotAttribute(array &$snapshot): string $snapshot = []; return $res; } + + + public static function addEnumProperty(string $class, string $property, array $constants, bool $set = false): void + { + self::$enumProperties["$class::$property"] = [$set, $constants]; + } } diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index 2472d52c3..0e72a4242 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -41,6 +41,7 @@ public static function exposeObject(object $obj, Value $value, Describer $descri $type, $describer->getReferenceId($values, $k), $class, + $describer->describeEnumProperty($class, $name, $values[$k]), ); } else { $describer->addPropertyTo( @@ -241,7 +242,7 @@ public static function exposeDsCollection( ): void { foreach ($obj as $k => $v) { - $describer->addPropertyTo($value, (string) $k, $v, Value::PropertyVirtual); + $describer->addPropertyTo($value, (string) $k, $v); } } @@ -254,7 +255,7 @@ public static function exposeDsMap( { $i = 0; foreach ($obj as $k => $v) { - $describer->addPropertyTo($value, (string) $i++, new Ds\Pair($k, $v), Value::PropertyVirtual); + $describer->addPropertyTo($value, (string) $i++, new Ds\Pair($k, $v)); } } } diff --git a/src/Tracy/Helpers.php b/src/Tracy/Helpers.php index dc27bdfce..93811b4a4 100644 --- a/src/Tracy/Helpers.php +++ b/src/Tracy/Helpers.php @@ -597,4 +597,29 @@ public static function traverseValue(mixed $val, callable $callback, array &$ski } } } + + + /** @internal */ + public static function decomposeFlags(int $flags, bool $set, array $constants): ?array + { + $res = null; + foreach ($constants as $constant) { + if (defined($constant)) { + $v = constant($constant); + if ($set) { + if ($v && ($flags & $v) === $v) { + $res[] = $constant; + $flags &= ~$v; + } + } elseif ($flags === $v) { + return [$constant]; + } + } + } + + if ($flags && $res && $set) { + $res[] = (string) $flags; + } + return $res; + } } diff --git a/tests/Tracy/Dumper.toText().enumProperty.PhpToken.phpt b/tests/Tracy/Dumper.toText().enumProperty.PhpToken.phpt new file mode 100644 index 000000000..af0415f49 --- /dev/null +++ b/tests/Tracy/Dumper.toText().enumProperty.PhpToken.phpt @@ -0,0 +1,54 @@ + PhpToken #%d% + | id: T_OPEN_TAG (%d%) + | text: ' PhpToken #%d% + | id: T_ECHO (%d%) + | text: 'echo' + | line: 1 + | pos: 6 + 2 => PhpToken #%d% + | id: 40 + | text: '(' + | line: 1 + | pos: 10 + 3 => PhpToken #%d% + | id: T_LNUMBER (%d%) + | text: '10' + | line: 1 + | pos: 11 + 4 => PhpToken #%d% + | id: 41 + | text: ')' + | line: 1 + | pos: 13 + 5 => PhpToken #%d% + | id: 59 + | text: ';' + | line: 1 + | pos: 14 + XX, + Dumper::toText($tokens), +); diff --git a/tests/Tracy/Dumper.toText().enumProperty.phpt b/tests/Tracy/Dumper.toText().enumProperty.phpt new file mode 100644 index 000000000..dce593b1b --- /dev/null +++ b/tests/Tracy/Dumper.toText().enumProperty.phpt @@ -0,0 +1,105 @@ +flag = $child::B; +$child->flags = $child::A | $child::B; + +Assert::match( + <<<'XX' + Child #%d% + flag: self::B (2) + flags: self::A | self::B (3) + XX, + Dumper::toText($child), +); + + +// all +$child = new Child; +$child->flags = $child::All; + +Assert::match( + <<<'XX' + Child #%d% + flag: unset + flags: self::All (7) + XX, + Dumper::toText($child), +); + + +// null +$child = new Child; +$child->flag = 0; +$child->flags = 0; + +Assert::match( + <<<'XX' + Child #%d% + flag: self::Null (0) + flags: 0 + XX, + Dumper::toText($child), +); + + +// invalid +$child = new Child; +$child->flag = 16; +$child->flags = 16; + +Assert::match( + <<<'XX' + Child #%d% + flag: 16 + flags: 16 + XX, + Dumper::toText($child), +); + + +// mixed +$child = new Child; +$child->flags = $child::B | $child::A | 16; + +Assert::match( + <<<'XX' + Child #%d% + flag: unset + flags: self::A | self::B | 16 (19) + XX, + Dumper::toText($child), +); From d97a773e6e2670ba9d3f6ec6c32c41545a2de3be Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 8 Mar 2023 05:16:20 +0100 Subject: [PATCH 18/30] BlueScreen: simplified HTML comment escaping --- src/Tracy/BlueScreen/assets/page.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tracy/BlueScreen/assets/page.phtml b/src/Tracy/BlueScreen/assets/page.phtml index e12bba35a..59d01aae7 100644 --- a/src/Tracy/BlueScreen/assets/page.phtml +++ b/src/Tracy/BlueScreen/assets/page.phtml @@ -22,10 +22,10 @@ $chain = Helpers::getExceptionChain($exception); <?= Helpers::escapeHtml($title . ': ' . $exception->getMessage() . $code) ?> - + 1): ?> From c50307fdd25330108c6320ace3d6d8f30ed9e9f9 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 8 Mar 2023 05:15:25 +0100 Subject: [PATCH 19/30] BlueScreen: added source to header --- src/Tracy/BlueScreen/assets/page.phtml | 2 ++ tests/Tracy/expected/Debugger.E_ERROR.html.expect | 1 + tests/Tracy/expected/Debugger.error-in-eval.expect | 1 + tests/Tracy/expected/Debugger.exception.fiber.html.expect | 1 + tests/Tracy/expected/Debugger.exception.generator.html.expect | 1 + tests/Tracy/expected/Debugger.exception.html.expect | 1 + tests/Tracy/expected/Debugger.strict.html.expect | 1 + 7 files changed, 8 insertions(+) diff --git a/src/Tracy/BlueScreen/assets/page.phtml b/src/Tracy/BlueScreen/assets/page.phtml index 59d01aae7..0dff01fbb 100644 --- a/src/Tracy/BlueScreen/assets/page.phtml +++ b/src/Tracy/BlueScreen/assets/page.phtml @@ -9,6 +9,7 @@ namespace Tracy; * @var string $title * @var ?string $nonce * @var string $css + * @var string $source */ $code = $exception->getCode() ? ' #' . $exception->getCode() : ''; @@ -28,6 +29,7 @@ $chain = Helpers::getExceptionChain($exception); echo Helpers::escapeHtml("\n\tcaused by " . get_debug_type($ex) . ': ' . $ex->getMessage() . ($ex->getCode() ? ' #' . $ex->getCode() : '')); } ?> --> + \n"; + 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 1ac7a0ad39752b345652698f040b48529a98b8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Wed, 8 Mar 2023 22:32:32 +0100 Subject: [PATCH 29/30] Logger: add StreamLogger --- src/Tracy/Logger/StreamLogger.php | 66 ++++++++++++++++++++++++++++ tests/Tracy/StreamLogger.log().phpt | 21 +++++++++ tests/Tracy/StreamLogger.stdout.phpt | 19 ++++++++ 3 files changed, 106 insertions(+) create mode 100644 src/Tracy/Logger/StreamLogger.php create mode 100644 tests/Tracy/StreamLogger.log().phpt create mode 100644 tests/Tracy/StreamLogger.stdout.phpt diff --git a/src/Tracy/Logger/StreamLogger.php b/src/Tracy/Logger/StreamLogger.php new file mode 100644 index 000000000..12ea99519 --- /dev/null +++ b/src/Tracy/Logger/StreamLogger.php @@ -0,0 +1,66 @@ +path = $path; + } + + + public function log(mixed $message, string $level = self::INFO) + { + $line = $this->formatLogLine($message); + + if (!@file_put_contents($this->path, $line . PHP_EOL)) { // @ is escalated to exception + throw new \RuntimeException("Unable to write to log file '{$this->path}'. Is directory writable?"); + } + } + + + public static function formatMessage(mixed $message): string + { + if ($message instanceof \Throwable) { + foreach (Helpers::getExceptionChain($message) as $exception) { + $tmp[] = ($exception instanceof \ErrorException + ? Helpers::errorTypeToString($exception->getSeverity()) . ': ' . $exception->getMessage() + : get_debug_type($exception) . ': ' . $exception->getMessage() . ($exception->getCode() ? ' #' . $exception->getCode() : '') + ) . ' in ' . $exception->getFile() . ':' . $exception->getLine(); + } + + $message = implode("\ncaused by ", $tmp); + + } elseif (!is_string($message)) { + $message = Dumper::toText($message); + } + + return trim($message); + } + + + public static function formatLogLine(mixed $message): string + { + return implode(' ', [ + date('[Y-m-d H-i-s]'), + preg_replace('#\s*\r?\n\s*#', ' ', static::formatMessage($message)), + ' @ ' . Helpers::getSource() + ]); + } + + +} diff --git a/tests/Tracy/StreamLogger.log().phpt b/tests/Tracy/StreamLogger.log().phpt new file mode 100644 index 000000000..cf4e918ef --- /dev/null +++ b/tests/Tracy/StreamLogger.log().phpt @@ -0,0 +1,21 @@ +log($e, 'a'); + Assert::match('[%a%] Exception: First in %a%:%d% %A%', file_get_contents($path)); +}); diff --git a/tests/Tracy/StreamLogger.stdout.phpt b/tests/Tracy/StreamLogger.stdout.phpt new file mode 100644 index 000000000..afff2936b --- /dev/null +++ b/tests/Tracy/StreamLogger.stdout.phpt @@ -0,0 +1,19 @@ +log($e); +}); From 60d4fa85f850dae6f61b17b134ae767eee5e1cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Wed, 8 Mar 2023 22:32:37 +0100 Subject: [PATCH 30/30] Logger: add MultiLogger --- src/Tracy/Logger/MultiLogger.php | 42 +++++++++++++++++++++++++++++ tests/Tracy/MultiLogger.log().phpt | 29 ++++++++++++++++++++ tests/Tracy/MultiLogger.stdout.phpt | 21 +++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 src/Tracy/Logger/MultiLogger.php create mode 100644 tests/Tracy/MultiLogger.log().phpt create mode 100644 tests/Tracy/MultiLogger.stdout.phpt diff --git a/src/Tracy/Logger/MultiLogger.php b/src/Tracy/Logger/MultiLogger.php new file mode 100644 index 000000000..d05c33f6e --- /dev/null +++ b/src/Tracy/Logger/MultiLogger.php @@ -0,0 +1,42 @@ +loggers = $loggers; + } + + + public function addLogger(ILogger $logger): void + { + $this->loggers[] = $logger; + } + + + public function log(mixed $message, string $level = self::INFO) + { + foreach ($this->loggers as $logger) { + $logger->log($message, $level); + } + } + +} diff --git a/tests/Tracy/MultiLogger.log().phpt b/tests/Tracy/MultiLogger.log().phpt new file mode 100644 index 000000000..fdd837b64 --- /dev/null +++ b/tests/Tracy/MultiLogger.log().phpt @@ -0,0 +1,29 @@ +log($e, 'a'); + + Assert::match('[%a%] Exception: First in %a%:%d% %A%', file_get_contents($path1)); + Assert::match('[%a%] Exception: First in %a%:%d% %A%', file_get_contents($path2)); +}); diff --git a/tests/Tracy/MultiLogger.stdout.phpt b/tests/Tracy/MultiLogger.stdout.phpt new file mode 100644 index 000000000..1e26a3312 --- /dev/null +++ b/tests/Tracy/MultiLogger.stdout.phpt @@ -0,0 +1,21 @@ +log($e); +});