Closed KaspervdHeijden closed 1 year ago
Fixed the issue with this patch:
diff --git a/src/NoOperationMonologHandler.php b/src/NoOperationMonologHandler.php
index f319d76..5dc8a0e 100644
--- a/src/NoOperationMonologHandler.php
+++ b/src/NoOperationMonologHandler.php
@@ -3,17 +3,18 @@
namespace JiraRestApi;
use Monolog\Handler\AbstractProcessingHandler;
+use Monolog\LogRecord;
class NoOperationMonologHandler extends AbstractProcessingHandler
{
/**
* Writes the record down to the log of the implementing handler.
*
- * @param array $record
+ * @param LogRecord $record
*
* @return void
*/
- protected function write(array $record): void
+ protected function write(LogRecord $record): void
{
// do nothing
}
Hi @KaspervdHeijden Thank you for your contribution.
Your code will be working well, however, Monolog has a broken change between 2.x and 3.x, so if I merge it then 2.x users will face the errors.
I will push new code instead of merging your suggestions.
Thanks!
Problem synopsis
Got the following exception:
It seems the parent abstract class has the argument typehinted as
LogRecord
, but theNoOperationMonologHandler::write()
method usesarray
instead.How to reproduce?
Switch off logging (E.g. by passing
'jiraLogEnabled' => false
)