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

Skip to content

Commit ee37c80

Browse files
feature #22791 [MonologBridge] remove deprecated features (xabbuh)
This PR was merged into the 4.0-dev branch. Discussion ---------- [MonologBridge] remove deprecated features | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 731065a [MonologBridge] remove deprecated features
2 parents 68cc207 + 731065a commit ee37c80

File tree

4 files changed

+9
-131
lines changed

4 files changed

+9
-131
lines changed

src/Symfony/Bridge/Monolog/CHANGELOG.md

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

4+
4.0.0
5+
-----
6+
7+
* the `$format`, `$dateFormat`, `$allowInlineLineBreaks`, and `$ignoreEmptyContextAndExtra`
8+
constructor arguments of the `ConsoleFormatter` class have been removed, use
9+
`$options` instead
10+
* the `DebugHandler` class has been removed
11+
412
3.3.0
513
-----
614

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,8 @@ class ConsoleFormatter implements FormatterInterface
5555
* * colors: If true, the log string contains ANSI code to add color;
5656
* * multiline: If false, "context" and "extra" are dumped on one line.
5757
*/
58-
public function __construct($options = array())
58+
public function __construct(array $options = array())
5959
{
60-
// BC Layer
61-
if (!is_array($options)) {
62-
@trigger_error(sprintf('The constructor arguments $format, $dateFormat, $allowInlineLineBreaks, $ignoreEmptyContextAndExtra of "%s" are deprecated since 3.3 and will be removed in 4.0. Use $options instead.', self::class), E_USER_DEPRECATED);
63-
$args = func_get_args();
64-
$options = array();
65-
if (isset($args[0])) {
66-
$options['format'] = $args[0];
67-
}
68-
if (isset($args[1])) {
69-
$options['date_format'] = $args[1];
70-
}
71-
if (isset($args[2])) {
72-
$options['multiline'] = $args[2];
73-
}
74-
}
75-
7660
$this->options = array_replace(array(
7761
'format' => self::SIMPLE_FORMAT,
7862
'date_format' => self::SIMPLE_DATE,

src/Symfony/Bridge/Monolog/Handler/DebugHandler.php

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/Symfony/Bridge/Monolog/Tests/LoggerTest.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,11 @@
1313

1414
use Monolog\Handler\TestHandler;
1515
use PHPUnit\Framework\TestCase;
16-
use Symfony\Bridge\Monolog\Handler\DebugHandler;
1716
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
1817
use Symfony\Bridge\Monolog\Logger;
1918

2019
class LoggerTest extends TestCase
2120
{
22-
/**
23-
* @group legacy
24-
*/
25-
public function testGetLogsWithDebugHandler()
26-
{
27-
$handler = new DebugHandler();
28-
$logger = new Logger(__METHOD__, array($handler));
29-
30-
$this->assertTrue($logger->error('error message'));
31-
$this->assertSame(1, count($logger->getLogs()));
32-
}
33-
3421
public function testGetLogsWithoutDebugProcessor()
3522
{
3623
$handler = new TestHandler();
@@ -40,43 +27,6 @@ public function testGetLogsWithoutDebugProcessor()
4027
$this->assertSame(array(), $logger->getLogs());
4128
}
4229

43-
/**
44-
* @group legacy
45-
*/
46-
public function testCountErrorsWithDebugHandler()
47-
{
48-
$handler = new DebugHandler();
49-
$logger = new Logger(__METHOD__, array($handler));
50-
51-
$this->assertTrue($logger->debug('test message'));
52-
$this->assertTrue($logger->info('test message'));
53-
$this->assertTrue($logger->notice('test message'));
54-
$this->assertTrue($logger->warning('test message'));
55-
56-
$this->assertTrue($logger->error('test message'));
57-
$this->assertTrue($logger->critical('test message'));
58-
$this->assertTrue($logger->alert('test message'));
59-
$this->assertTrue($logger->emergency('test message'));
60-
61-
$this->assertSame(4, $logger->countErrors());
62-
}
63-
64-
/**
65-
* @group legacy
66-
*/
67-
public function testGetLogsWithDebugHandler2()
68-
{
69-
$logger = new Logger('test');
70-
$logger->pushHandler(new DebugHandler());
71-
72-
$logger->addInfo('test');
73-
$this->assertCount(1, $logger->getLogs());
74-
list($record) = $logger->getLogs();
75-
76-
$this->assertEquals('test', $record['message']);
77-
$this->assertEquals(Logger::INFO, $record['priority']);
78-
}
79-
8030
public function testCountErrorsWithoutDebugProcessor()
8131
{
8232
$handler = new TestHandler();

0 commit comments

Comments
 (0)