Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6be1fba

Browse files
[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors
1 parent 9efa555 commit 6be1fba

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

src/Symfony/Bridge/Monolog/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.2.0
5+
-----
6+
7+
* added `ProcessorInterface`: an optional interface to allow autoconfiguration of monolog processors
8+
49
4.1.0
510
-----
611

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\Monolog\Processor;
13+
14+
/**
15+
* An optional interface to allow autoconfiguration of monolog processors.
16+
*
17+
* @author Nicolas Grekas <[email protected]>
18+
*/
19+
interface ProcessorInterface
20+
{
21+
/**
22+
* @return array The processed records
23+
*/
24+
public function __invoke(array $records);
25+
}

src/Symfony/Bridge/Monolog/Processor/TokenProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @author Dany Maillard <[email protected]>
2020
*/
21-
class TokenProcessor
21+
class TokenProcessor implements ProcessorInterface
2222
{
2323
private $tokenStorage;
2424

src/Symfony/Bridge/Monolog/Processor/WebProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @author Jordi Boggiano <[email protected]>
2323
*/
24-
class WebProcessor extends BaseWebProcessor implements EventSubscriberInterface
24+
class WebProcessor extends BaseWebProcessor implements EventSubscriberInterface, ProcessorInterface
2525
{
2626
public function __construct(array $extraFields = null)
2727
{

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Doctrine\Common\Annotations\Reader;
1515
use Doctrine\Common\Annotations\AnnotationRegistry;
1616
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
17+
use Symfony\Bridge\Monolog\Processor\ProcessorInterface;
1718
use Symfony\Bridge\Twig\Extension\CsrfExtension;
1819
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1920
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -324,6 +325,8 @@ public function load(array $configs, ContainerBuilder $container)
324325
->addTag('kernel.event_subscriber');
325326
$container->registerForAutoconfiguration(ResettableInterface::class)
326327
->addTag('kernel.reset', array('method' => 'reset'));
328+
$container->registerForAutoconfiguration(ProcessorInterface::class)
329+
->addTag('monolog.processor');
327330
$container->registerForAutoconfiguration(PropertyListExtractorInterface::class)
328331
->addTag('property_info.list_extractor');
329332
$container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class)

0 commit comments

Comments
 (0)