diff --git a/.travis.yml b/.travis.yml index 00141522..73f11408 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,11 +19,7 @@ matrix: env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak # Test against Symfony LTS versions - php: 5.6 - env: SYMFONY_VERSION="2.7.*" - - php: 5.6 - env: SYMFONY_VERSION="2.8.*" - - php: 5.6 - env: SYMFONY_VERSION="3.4.*" DEPENDENCIES=dev + env: SYMFONY_VERSION="3.4.*" - php: 7.0 - php: 7.1 # There is a bug in PHPUnit 5.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ed1f3d2..5202a7ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Fixed regression when `app` channel is defined explicitly * Fixed handlers marked as nested not being ignored properly from the stack * Added support for Redis configuration +* Drop support for Symfony <3 ## 3.3.1 (2018-11-04) diff --git a/DependencyInjection/Compiler/DebugHandlerPass.php b/DependencyInjection/Compiler/DebugHandlerPass.php index c950e150..06493173 100644 --- a/DependencyInjection/Compiler/DebugHandlerPass.php +++ b/DependencyInjection/Compiler/DebugHandlerPass.php @@ -31,10 +31,7 @@ class DebugHandlerPass implements CompilerPassInterface public function __construct(LoggerChannelPass $channelPass) { - // Trigger the deprecation only when using a Symfony version supporting the new feature (i.e. 3.2+) - if (class_exists('Symfony\Bridge\Monolog\Processor\DebugProcessor') && class_exists('Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddDebugLogProcessorPass')) { - @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); - } + @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); $this->channelPass = $channelPass; } diff --git a/DependencyInjection/Compiler/LoggerChannelPass.php b/DependencyInjection/Compiler/LoggerChannelPass.php index 6fccc79b..51a21d5e 100644 --- a/DependencyInjection/Compiler/LoggerChannelPass.php +++ b/DependencyInjection/Compiler/LoggerChannelPass.php @@ -126,12 +126,7 @@ protected function processChannels($configuration) protected function createLogger($channel, $loggerId, ContainerBuilder $container) { if (!in_array($channel, $this->channels)) { - if (class_exists('Symfony\Component\DependencyInjection\ChildDefinition')) { - $logger = new ChildDefinition('monolog.logger_prototype'); - } else { - $logger = new DefinitionDecorator('monolog.logger_prototype'); - } - + $logger = new ChildDefinition('monolog.logger_prototype'); $logger->replaceArgument(0, $channel); $container->setDefinition($loggerId, $logger); $this->channels[] = $channel; diff --git a/DependencyInjection/MonologExtension.php b/DependencyInjection/MonologExtension.php index ab8ca555..285e9b81 100644 --- a/DependencyInjection/MonologExtension.php +++ b/DependencyInjection/MonologExtension.php @@ -58,11 +58,6 @@ public function load(array $configs, ContainerBuilder $container) $container->setParameter('monolog.use_microseconds', $config['use_microseconds']); - // always autowire the main logger, require Symfony >= 2.8, < 3.3 - if (!method_exists('Symfony\Component\DependencyInjection\ContainerBuilder', 'fileExists') && method_exists('Symfony\Component\DependencyInjection\Definition', 'addAutowiringType')) { - $container->getDefinition('monolog.logger')->addAutowiringType('Psr\Log\LoggerInterface'); - } - $handlers = array(); foreach ($config['handlers'] as $name => $handler) { diff --git a/composer.json b/composer.json index 8b091ca8..f89cfa0c 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,15 @@ ], "require": { "php": ">=5.6", - "symfony/monolog-bridge": "~2.7|~3.3|~4.0", - "symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10", - "symfony/config": "~2.7|~3.3|~4.0", - "symfony/http-kernel": "~2.7|~3.3|~4.0", + "symfony/monolog-bridge": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4.10|^4.0.10", + "symfony/config": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", "monolog/monolog": "~1.22" }, "require-dev": { - "symfony/yaml": "~2.7|~3.3|~4.0", - "symfony/console": "~2.7|~3.3|~4.0", + "symfony/yaml": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", "symfony/phpunit-bridge": "^3.4.19|^4.0" }, "autoload": {