Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Symfony <3 #306

Merged
merged 1 commit into from Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions .travis.yml
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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)

Expand Down
5 changes: 1 addition & 4 deletions DependencyInjection/Compiler/DebugHandlerPass.php
Expand Up @@ -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;
}
Expand Down
7 changes: 1 addition & 6 deletions DependencyInjection/Compiler/LoggerChannelPass.php
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions DependencyInjection/MonologExtension.php
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Expand Up @@ -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": {
Expand Down