From 5a06f317d0d32e2d67484c9bae80eac8e132ade8 Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Tue, 13 Feb 2018 14:37:03 +0100 Subject: [PATCH] Fix code standard --- src/Framework/Dumper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Framework/Dumper.php b/src/Framework/Dumper.php index 3be125b4..479b1fcc 100644 --- a/src/Framework/Dumper.php +++ b/src/Framework/Dumper.php @@ -301,6 +301,7 @@ public static function dumpException(\Throwable $e): string return $s; } + /** * @param AssertException $assertException * @param string $testFile @@ -327,7 +328,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi for ($i = 0; $i < strlen($actual) && isset($expected[$i]) && $actual[$i] === $expected[$i]; $i++) ; for (; $i && $i < strlen($actual) && $actual[$i - 1] >= "\x80" && $actual[$i] >= "\x80" && $actual[$i] < "\xC0"; $i--) ; $i = max(0, min( - $i - (int)(self::$maxLength / 3), // try to display 1/3 of shorter string + $i - (int) (self::$maxLength / 3), // try to display 1/3 of shorter string max(strlen($actual), strlen($expected)) - self::$maxLength + 3 // 3 = length of ... )); if ($i) { @@ -342,8 +343,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi ) { if (($delta = strlen($m[1]) - strlen($m[3])) >= 3) { $message = "$m[1]$m[2]\n" . str_repeat(' ', $delta - 3) . "...$m[3]$m[4]"; - } - else { + } else { $message = "$m[1]$m[2]$m[3]\n" . str_repeat(' ', strlen($m[1]) - 4) . "... $m[4]"; } } @@ -354,6 +354,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi ]); } + /** * Dumps data to folder 'output'. * @internal