Improve resulting HTML of syntax highlighting in EchoHandler
(#112)
#664
Annotations
11 warnings
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Run roave infection.:
src/ClosureExporter.php#L51
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @return string String containing PHP code.
*/
- public function export(Closure $closure, int $level = 0) : string
+ public function export(Closure $closure, int $level = -1) : string
{
$reflection = new ReflectionFunction($closure);
$fileName = $reflection->getFileName();
|
Run roave infection.:
src/ClosureExporter.php#L51
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*
* @return string String containing PHP code.
*/
- public function export(Closure $closure, int $level = 0) : string
+ public function export(Closure $closure, int $level = 1) : string
{
$reflection = new ReflectionFunction($closure);
$fileName = $reflection->getFileName();
|
Run roave infection.:
src/ClosureExporter.php#L59
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
$fileName = $reflection->getFileName();
$start = $reflection->getStartLine();
$end = $reflection->getEndLine();
- if ($fileName === false || $start === false || $end === false || ($fileContent = file($fileName)) === false) {
+ if ($fileName === false && $start === false || $end === false || ($fileContent = file($fileName)) === false) {
return 'function () {/* Error: unable to determine Closure source */}';
}
--$start;
|
Run roave infection.:
src/ClosureExporter.php#L59
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
$fileName = $reflection->getFileName();
$start = $reflection->getStartLine();
$end = $reflection->getEndLine();
- if ($fileName === false || $start === false || $end === false || ($fileContent = file($fileName)) === false) {
+ if (($fileName === false || $start === false) && $end === false || ($fileContent = file($fileName)) === false) {
return 'function () {/* Error: unable to determine Closure source */}';
}
--$start;
|
Run roave infection.:
src/ClosureExporter.php#L65
Escaped Mutant for Mutator "Minus":
--- Original
+++ New
@@ @@
}
--$start;
$uses = $this->useStatementParser->fromFile($fileName);
- $tokens = token_get_all('<?php ' . implode('', array_slice($fileContent, $start, $end - $start)));
+ $tokens = token_get_all('<?php ' . implode('', array_slice($fileContent, $start, $end + $start)));
array_shift($tokens);
$bufferUse = '';
$closureTokens = [];
|
Run roave infection.:
src/ClosureExporter.php#L66
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
--$start;
$uses = $this->useStatementParser->fromFile($fileName);
$tokens = token_get_all('<?php ' . implode('', array_slice($fileContent, $start, $end - $start)));
- array_shift($tokens);
+
$bufferUse = '';
$closureTokens = [];
$pendingParenthesisCount = 0;
|
Run roave infection.:
src/ClosureExporter.php#L90
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
$readableToken = $this->processFullUse($readableToken, $uses);
$bufferUse = '';
} elseif (isset($uses[$readableToken])) {
- if (isset($tokens[$i + 1]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
+ if (isset($tokens[$i + 0]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
$bufferUse .= $uses[$readableToken];
continue;
}
|
Run roave infection.:
src/ClosureExporter.php#L90
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
$readableToken = $this->processFullUse($readableToken, $uses);
$bufferUse = '';
} elseif (isset($uses[$readableToken])) {
- if (isset($tokens[$i + 1]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
+ if (isset($tokens[$i + 2]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
$bufferUse .= $uses[$readableToken];
continue;
}
|
Run roave infection.:
src/ClosureExporter.php#L90
Escaped Mutant for Mutator "Plus":
--- Original
+++ New
@@ @@
$readableToken = $this->processFullUse($readableToken, $uses);
$bufferUse = '';
} elseif (isset($uses[$readableToken])) {
- if (isset($tokens[$i + 1]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
+ if (isset($tokens[$i - 1]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
$bufferUse .= $uses[$readableToken];
continue;
}
|
Run roave infection.:
src/ClosureExporter.php#L90
Escaped Mutant for Mutator "Plus":
--- Original
+++ New
@@ @@
$readableToken = $this->processFullUse($readableToken, $uses);
$bufferUse = '';
} elseif (isset($uses[$readableToken])) {
- if (isset($tokens[$i + 1]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i + 1])) {
+ if (isset($tokens[$i + 1]) && $this->useStatementParser->isTokenIsPartOfUse($tokens[$i - 1])) {
$bufferUse .= $uses[$readableToken];
continue;
}
|
Loading