Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Remove back compatability with nella/monolog-tracy < 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtak-CZ committed May 14, 2016
1 parent 11829d5 commit 3569361
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 43 deletions.
9 changes: 1 addition & 8 deletions src/DependencyInjection/MonologTracyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Nella\MonologTracyBundle\DependencyInjection;

use Nella\MonologTracy\Tracy\BlueScreenFactory;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down Expand Up @@ -168,13 +167,7 @@ private function setupBlueScreenFactory(ContainerBuilder $container, array $conf

$this->processInfoItems($definition, $infoItems);
$this->processPanels($definition, $config[Configuration::PANELS]);
if (method_exists(BlueScreenFactory::class, 'registerCollapsePath')) {
$this->processCollapsePaths($definition, $config[Configuration::COLLAPSE_PATHS]);
} elseif (count($config[Configuration::COLLAPSE_PATHS]) > 0) {
throw new \Nella\MonologTracyBundle\DependencyInjection\UnsupportedException(
'Sorry "collapse_paths" are supported only for nella/monolog-tracy 1.2+'
);
}
$this->processCollapsePaths($definition, $config[Configuration::COLLAPSE_PATHS]);

$container->setDefinition($serviceId, $definition);
}
Expand Down
22 changes: 0 additions & 22 deletions src/DependencyInjection/UnsupportedException.php

This file was deleted.

16 changes: 3 additions & 13 deletions tests/DependencyInjection/MonologTracyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Monolog\Logger;
use Nella\MonologTracy\BlueScreenHandler;
use Nella\MonologTracy\Tracy\BlueScreenFactory;
use Symfony\Bundle\MonologBundle\DependencyInjection\MonologExtension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
Expand Down Expand Up @@ -255,18 +254,9 @@ public function testPanelsInvalid2()

public function testCollapsePaths()
{
try {
$this->load([], [
'sectionCollapsePaths.yml',
]);
} catch (\Nella\MonologTracyBundle\DependencyInjection\UnsupportedException $e) {
if (!method_exists(BlueScreenFactory::class, 'registerCollapsePath')) {
$this->assertSame('Sorry "collapse_paths" are supported only for nella/monolog-tracy 1.2+', $e->getMessage());
return;
} else {
throw $e;
}
}
$this->load([], [
'sectionCollapsePaths.yml',
]);

$this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
MonologTracyExtension::BLUESCREEN_FACTORY_SERVICE_ID,
Expand Down

0 comments on commit 3569361

Please sign in to comment.