Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
wip

x

x

wip
  • Loading branch information
dg committed Dec 5, 2023
1 parent c5eff68 commit 16afdf9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Framework/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class_exists(Assert::class);
self::$checkAssertions = !isset($annotations['outputmatch']) && !isset($annotations['outputmatchfile']);

if (getenv(self::VariableCoverage) && getenv(self::VariableCoverageEngine)) {
CodeCoverage\Collector::start(getenv(self::VariableCoverage), getenv(self::VariableCoverageEngine));
//CodeCoverage\Collector::start(getenv(self::VariableCoverage), getenv(self::VariableCoverageEngine));
}

if (getenv('TERMINAL_EMULATOR') === 'JetBrains-JediTerm') {
Expand All @@ -91,11 +91,11 @@ public static function setupColors(): void
: @stream_isatty(STDOUT)) // @ may trigger error 'cannot cast a filtered stream on this system'
);

ob_start(
fn(string $s): string => self::$useColors ? $s : Dumper::removeColors($s),
/*ob_start(
static fn(string $s): string => self::$useColors ? $s : Dumper::removeColors($s),
1,
PHP_OUTPUT_HANDLER_FLUSHABLE,
);
);*/
}


Expand All @@ -111,7 +111,7 @@ public static function setupErrors(): void

set_exception_handler([self::class, 'handleException']);

set_error_handler(function (int $severity, string $message, string $file, int $line): ?bool {
set_error_handler(static function (int $severity, string $message, string $file, int $line): ?bool {
if (
in_array($severity, [E_RECOVERABLE_ERROR, E_USER_ERROR], true)
|| ($severity & error_reporting()) === $severity
Expand All @@ -121,12 +121,12 @@ public static function setupErrors(): void

return false;
});

register_shutdown_function(function (): void {
/*
register_shutdown_function(static function (): void {
Assert::$onFailure = [self::class, 'handleException'];
$error = error_get_last();
register_shutdown_function(function () use ($error): void {
register_shutdown_function(static function () use ($error): void {
if (in_array($error['type'] ?? null, [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE], true)) {
if (($error['type'] & error_reporting()) !== $error['type']) { // show fatal errors hidden by @shutup
self::print("\n" . Dumper::color('white/red', "Fatal error: $error[message] in $error[file] on line $error[line]"));
Expand All @@ -138,7 +138,7 @@ public static function setupErrors(): void
self::print("\n" . (self::$exitCode ? Dumper::color('white/red', 'FAILURE') : Dumper::color('white/green', 'OK')));
}
});
});
});*/
}


Expand Down

0 comments on commit 16afdf9

Please sign in to comment.