Problem/Motivation
Upon enabling Push Logs, a fatal error is generated:
Fatal error: Declaration of Drupal\push_logs\Logger\PushedLog::log($level, $message, array $context = []) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, Stringable|string $message, array $context = []): void in /------/------/modules/contrib/push_logs/src/Logger/PushedLog.php on line 79
Steps to reproduce
- Install Push Logs via Composer:
composer require 'drupal/push_logs:^1.0' - Enable Push Logs with Drupal 10 UI.
- Immediate fatal error:
Fatal error: Declaration of Drupal\push_logs\Logger\PushedLog::log($level, $message, array $context = []) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, Stringable|string $message, array $context = []): void in /------/------/web/modules/contrib/push_logs/src/Logger/PushedLog.php on line 79
Proposed resolution
From that I can see, it appears to be a matter of adding a "void" to the function argument default values:
public function log($level, $message, array $context = []): void {
vs.
public function log($level, $message, array $context = []) {
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Issue fork push_logs-3362244
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
emathy commentedComment #6
r_h-l commentedCommit looks good, merged and new release created. Thank you!
Comment #7
r_h-l commented