Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf27c3a8

Browse files
committed
feature#27801 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors (nicolas-grekas)
This PR was merged into the 4.2-dev branch.Discussion----------[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR |symfony/symfony-docs#9996Using this, enabling e.g. TokenProcessor or WebProcessor just needs one line in `services.yaml`:```yamlservices: Symfony\Bridge\Monolog\Processor\TokenProcessor: ~ Symfony\Bridge\Monolog\Processor\WebProcessor: ~```Commits-------28a4912 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors
2 parents9da0454 +28a4912 commitf27c3a8

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 <fabien@symfony.com>
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+
namespaceSymfony\Bridge\Monolog\Processor;
13+
14+
/**
15+
* An optional interface to allow autoconfiguration of Monolog processors.
16+
*
17+
* @author Nicolas Grekas <p@tchwork.com>
18+
*/
19+
interface ProcessorInterface
20+
{
21+
/**
22+
* @return array The processed records
23+
*/
24+
publicfunction__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 <danymaillard93b@gmail.com>
2020
*/
21-
class TokenProcessor
21+
class TokenProcessorimplements 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 <j.boggiano@seld.be>
2323
*/
24-
class WebProcessorextends BaseWebProcessorimplements EventSubscriberInterface
24+
class WebProcessorextends BaseWebProcessorimplements EventSubscriberInterface, ProcessorInterface
2525
{
2626
publicfunction__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
useDoctrine\Common\Annotations\Reader;
1515
useDoctrine\Common\Annotations\AnnotationRegistry;
1616
useSymfony\Bridge\Monolog\Processor\DebugProcessor;
17+
useSymfony\Bridge\Monolog\Processor\ProcessorInterface;
1718
useSymfony\Bridge\Twig\Extension\CsrfExtension;
1819
useSymfony\Bundle\FrameworkBundle\Controller\AbstractController;
1920
useSymfony\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)

[8]ページ先頭

©2009-2025 Movatter.jp