Skip to content

Commit

Permalink
feature #306 Drop support for Symfony <3 (lyrixx)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x-dev branch.

Discussion
----------

Drop support for Symfony <3

Commits
-------

bca34c1 Drop support for Symfony <3
  • Loading branch information
lyrixx committed Jun 11, 2019
2 parents ac9b6f3 + bca34c1 commit 5fe15c2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 26 deletions.
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

0 comments on commit 5fe15c2

Please sign in to comment.