Skip to content

Commit

Permalink
fixes for PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 13, 2019
1 parent ddae463 commit c853ebe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Framework/Environment.php
Expand Up @@ -106,7 +106,7 @@ public static function setupErrors(): void

$error = error_get_last();
register_shutdown_function(function () use ($error): void {
if (in_array($error['type'], [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE], true)) {
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::removeOutputBuffers();
echo "\n", Dumper::color('white/red', "Fatal error: $error[message] in $error[file] on line $error[line]"), "\n";
Expand Down
6 changes: 6 additions & 0 deletions src/Framework/FileMock.php
Expand Up @@ -162,6 +162,12 @@ public function stream_truncate(int $size): bool
}


public function stream_set_option(int $option, int $arg1, int $arg2): bool
{
return true;
}


public function stream_stat(): array
{
return ['mode' => 0100666, 'size' => strlen($this->content)];
Expand Down

0 comments on commit c853ebe

Please sign in to comment.