From 13d79f09910b7af61d72e19cccc4b0eb5aed40c2 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 27 Feb 2019 14:23:05 +0100 Subject: [PATCH] used ::class --- src/Framework/Dumper.php | 2 +- src/Framework/Environment.php | 6 +++--- src/Runner/PhpInterpreter.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Framework/Dumper.php b/src/Framework/Dumper.php index b3d62d4c..9908ba50 100644 --- a/src/Framework/Dumper.php +++ b/src/Framework/Dumper.php @@ -314,7 +314,7 @@ public static function dumpException(\Throwable $e): string if ($e instanceof AssertException && $item['file'] === __DIR__ . DIRECTORY_SEPARATOR . 'Assert.php') { continue; } - $line = $item['class'] === 'Tester\Assert' && method_exists($item['class'], $item['function']) + $line = $item['class'] === Assert::class && method_exists($item['class'], $item['function']) && strpos($tmp = file($item['file'])[$item['line'] - 1], "::$item[function](") ? $tmp : null; $s .= 'in ' diff --git a/src/Framework/Environment.php b/src/Framework/Environment.php index 982ebabf..3905056a 100644 --- a/src/Framework/Environment.php +++ b/src/Framework/Environment.php @@ -49,9 +49,9 @@ public static function setup(): void self::setupColors(); self::$obLevel = ob_get_level(); - class_exists('Tester\Runner\Job'); - class_exists('Tester\Dumper'); - class_exists('Tester\Assert'); + class_exists(Runner\Job::class); + class_exists(Dumper::class); + class_exists(Assert::class); $annotations = self::getTestAnnotations(); self::$checkAssertions = !isset($annotations['outputmatch']) && !isset($annotations['outputmatchfile']); diff --git a/src/Runner/PhpInterpreter.php b/src/Runner/PhpInterpreter.php index c9400dc9..af0c37b6 100644 --- a/src/Runner/PhpInterpreter.php +++ b/src/Runner/PhpInterpreter.php @@ -48,7 +48,7 @@ public function __construct(string $path, array $args = []) $output = stream_get_contents($pipes[1]); proc_close($proc); - $args = ' ' . implode(' ', array_map(['Tester\Helpers', 'escapeArg'], $args)); + $args = ' ' . implode(' ', array_map([Helpers::class, 'escapeArg'], $args)); if (strpos($output, 'phpdbg') !== false) { $args = ' -qrrb -S cli' . $args; }