Skip to content

Commit

Permalink
Fix code standard
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed May 30, 2018
1 parent cbc56cd commit 5a06f31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Framework/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public static function dumpException(\Throwable $e): string
return $s;
}


/**
* @param AssertException $assertException
* @param string $testFile
Expand All @@ -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) {
Expand All @@ -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]";
}
}
Expand All @@ -354,6 +354,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi
]);
}


/**
* Dumps data to folder 'output'.
* @internal
Expand Down

0 comments on commit 5a06f31

Please sign in to comment.