Skip to content

Commit

Permalink
Add partial support for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Oct 28, 2024
1 parent ed0afed commit 9132844
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jobs:
castor:
bin: 'bin/castor'
method: 'bin/castor'
- php: "8.4"
castor:
bin: 'bin/castor'
method: 'bin/castor'
allow_failures: true

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Add support for custom php.ini in compile command
* Do not validate commande options/args as soon as `#[AsRawTokens] is used
* Update all PHP vendor
* Add partial support for PHP 8.4 (`ssh_()` functions are not supported yet)

### Fixes

Expand Down
11 changes: 8 additions & 3 deletions src/Listener/ConfigureCastorListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function configureCastor(BeforeBootEvent $event): void
$this->logger->pushHandler(new ConsoleHandler($this->output));
}

$this->errorHandler->setDefaultLogger($this->logger, [
$map = [
\E_COMPILE_WARNING => LogLevel::WARNING,
\E_CORE_WARNING => LogLevel::WARNING,
\E_USER_WARNING => LogLevel::WARNING,
Expand All @@ -43,8 +43,13 @@ public function configureCastor(BeforeBootEvent $event): void
\E_ERROR => LogLevel::ERROR,
\E_PARSE => LogLevel::ERROR,
\E_RECOVERABLE_ERROR => LogLevel::ERROR,
\E_STRICT => LogLevel::ERROR,
\E_USER_ERROR => LogLevel::ERROR,
]);
];

if (\PHP_VERSION_ID < 80400) {
$map[\E_STRICT] = LogLevel::ERROR;
}

$this->errorHandler->setDefaultLogger($this->logger, $map);
}
}

0 comments on commit 9132844

Please sign in to comment.