Skip to content

Commit 5fe15c2

Browse files
committed
feature #306 Drop support for Symfony <3 (lyrixx)
This PR was merged into the 3.x-dev branch. Discussion ---------- Drop support for Symfony <3 Commits ------- bca34c1 Drop support for Symfony <3
2 parents ac9b6f3 + bca34c1 commit 5fe15c2

File tree

6 files changed

+10
-26
lines changed

6 files changed

+10
-26
lines changed

.travis.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ matrix:
1919
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
2020
# Test against Symfony LTS versions
2121
- php: 5.6
22-
env: SYMFONY_VERSION="2.7.*"
23-
- php: 5.6
24-
env: SYMFONY_VERSION="2.8.*"
25-
- php: 5.6
26-
env: SYMFONY_VERSION="3.4.*" DEPENDENCIES=dev
22+
env: SYMFONY_VERSION="3.4.*"
2723
- php: 7.0
2824
- php: 7.1
2925
# There is a bug in PHPUnit 5.7

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Fixed regression when `app` channel is defined explicitly
99
* Fixed handlers marked as nested not being ignored properly from the stack
1010
* Added support for Redis configuration
11+
* Drop support for Symfony <3
1112

1213
## 3.3.1 (2018-11-04)
1314

DependencyInjection/Compiler/DebugHandlerPass.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ class DebugHandlerPass implements CompilerPassInterface
3131

3232
public function __construct(LoggerChannelPass $channelPass)
3333
{
34-
// Trigger the deprecation only when using a Symfony version supporting the new feature (i.e. 3.2+)
35-
if (class_exists('Symfony\Bridge\Monolog\Processor\DebugProcessor') && class_exists('Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddDebugLogProcessorPass')) {
36-
@trigger_error('The '.__CLASS__.' class is deprecated since version 2.12 and will be removed in 4.0. Use AddDebugLogProcessorPass in FrameworkBundle instead.', E_USER_DEPRECATED);
37-
}
34+
@trigger_error('The '.__CLASS__.' class is deprecated since version 2.12 and will be removed in 4.0. Use AddDebugLogProcessorPass in FrameworkBundle instead.', E_USER_DEPRECATED);
3835

3936
$this->channelPass = $channelPass;
4037
}

DependencyInjection/Compiler/LoggerChannelPass.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,7 @@ protected function processChannels($configuration)
126126
protected function createLogger($channel, $loggerId, ContainerBuilder $container)
127127
{
128128
if (!in_array($channel, $this->channels)) {
129-
if (class_exists('Symfony\Component\DependencyInjection\ChildDefinition')) {
130-
$logger = new ChildDefinition('monolog.logger_prototype');
131-
} else {
132-
$logger = new DefinitionDecorator('monolog.logger_prototype');
133-
}
134-
129+
$logger = new ChildDefinition('monolog.logger_prototype');
135130
$logger->replaceArgument(0, $channel);
136131
$container->setDefinition($loggerId, $logger);
137132
$this->channels[] = $channel;

DependencyInjection/MonologExtension.php

-5
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ public function load(array $configs, ContainerBuilder $container)
5858

5959
$container->setParameter('monolog.use_microseconds', $config['use_microseconds']);
6060

61-
// always autowire the main logger, require Symfony >= 2.8, < 3.3
62-
if (!method_exists('Symfony\Component\DependencyInjection\ContainerBuilder', 'fileExists') && method_exists('Symfony\Component\DependencyInjection\Definition', 'addAutowiringType')) {
63-
$container->getDefinition('monolog.logger')->addAutowiringType('Psr\Log\LoggerInterface');
64-
}
65-
6661
$handlers = array();
6762

6863
foreach ($config['handlers'] as $name => $handler) {

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
],
1818
"require": {
1919
"php": ">=5.6",
20-
"symfony/monolog-bridge": "~2.7|~3.3|~4.0",
21-
"symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10",
22-
"symfony/config": "~2.7|~3.3|~4.0",
23-
"symfony/http-kernel": "~2.7|~3.3|~4.0",
20+
"symfony/monolog-bridge": "~3.4|~4.0",
21+
"symfony/dependency-injection": "~3.4.10|^4.0.10",
22+
"symfony/config": "~3.4|~4.0",
23+
"symfony/http-kernel": "~3.4|~4.0",
2424
"monolog/monolog": "~1.22"
2525
},
2626
"require-dev": {
27-
"symfony/yaml": "~2.7|~3.3|~4.0",
28-
"symfony/console": "~2.7|~3.3|~4.0",
27+
"symfony/yaml": "~3.4|~4.0",
28+
"symfony/console": "~3.4|~4.0",
2929
"symfony/phpunit-bridge": "^3.4.19|^4.0"
3030
},
3131
"autoload": {

0 commit comments

Comments
 (0)