Skip to content

Commit

Permalink
Add support for monolog 3 (#30)
Browse files Browse the repository at this point in the history
* Add support for monolog 3

* Fix compatibility to Monolog 3

* Update Profiler/Handler/CollectionHandler.php

Co-authored-by: Luca Rath-Heel <luca-rath@hotmail.com>

Co-authored-by: Luca Rath-Heel <luca-rath@hotmail.com>
  • Loading branch information
alexander-schranz and luca-rath authored Aug 8, 2022
1 parent fd55794 commit 23b14de
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 60 deletions.
4 changes: 0 additions & 4 deletions Profiler/ElasticsearchProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\VarDumper\Caster\CutStub;
use Symfony\Component\VarDumper\Cloner\Data;
use Symfony\Component\VarDumper\Cloner\Stub;
use Symfony\Component\VarDumper\Cloner\VarCloner;

/**
* Data collector for profiling elasticsearch bundle.
Expand Down
21 changes: 0 additions & 21 deletions Profiler/Handler/BackwardCompatibilityWriteTrait.php

This file was deleted.

14 changes: 0 additions & 14 deletions Profiler/Handler/BackwardCompatibilityWriteTrait71.php

This file was deleted.

14 changes: 0 additions & 14 deletions Profiler/Handler/BackwardCompatibilityWriteTrait72.php

This file was deleted.

11 changes: 5 additions & 6 deletions Profiler/Handler/CollectionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,30 @@
namespace ONGR\ElasticsearchBundle\Profiler\Handler;

use Monolog\Handler\AbstractProcessingHandler;
use Monolog\LogRecord;

/**
* Handler that saves all records to him self.
*/
class CollectionHandler extends AbstractProcessingHandler
{
use BackwardCompatibilityWriteTrait;

/**
* @var array
* @var array[]|LogRecord[]
*/
private $records = [];

/**
* {@inheritdoc}
* @param array|LogRecord $record
*/
protected function doWrite(array $record)
protected function write($record): void
{
$this->records[] = $record;
}

/**
* Returns recorded data.
*
* @return array
* @return array[]|LogRecord[]
*/
public function getRecords()
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"doctrine/inflector": "^1.0 || ^2.0",
"doctrine/cache": "~1.4",
"doctrine/collections": "~1.4",
"monolog/monolog": "^1.10 || ^2.0",
"monolog/monolog": "^1.10 || ^2.0 || ^3.0",
"handcraftedinthealps/elasticsearch-dsl": "^5.0.7.1|^6.2.0.1|^7.2.0.1",
"symfony/event-dispatcher": "^2.8|^3.0|^4|^5|^6"
},
Expand Down

0 comments on commit 23b14de

Please sign in to comment.