Removed methods which implemented interfaces by throwing \LogicException('You must override...').

This commit is contained in:
Artur Kotyrba 2010-10-16 21:07:33 +02:00 committed by Fabien Potencier
parent 80868f1712
commit 308e85a5a7
5 changed files with 7 additions and 76 deletions

View File

@ -31,18 +31,4 @@ abstract class Dumper implements DumperInterface
{
$this->container = $container;
}
/**
* Dumps the service container.
*
* @param array $options An array of options
*
* @return string The representation of the service container
*
* @throws \LogicException When this abstract class is not implemented
*/
public function dump(array $options = array())
{
throw new \LogicException('You must extend this abstract class and implement the dump() method.');
}
}

View File

@ -18,5 +18,12 @@ namespace Symfony\Component\DependencyInjection\Dumper;
*/
interface DumperInterface
{
/**
* Dumps the service container.
*
* @param array $options An array of options
*
* @return string The representation of the service container
*/
function dump(array $options = array());
}

View File

@ -32,18 +32,4 @@ abstract class GeneratorDumper implements GeneratorDumperInterface
{
$this->routes = $routes;
}
/**
* Dumps the routing.
*
* @param array $options An array of options
*
* @return string The representation of the routing
*
* @throws \LogicException When this abstract class is not implemented
*/
public function dump(array $options = array())
{
throw new \LogicException('You must extend this abstract class and implement the dump() method.');
}
}

View File

@ -32,18 +32,4 @@ abstract class MatcherDumper implements MatcherDumperInterface
{
$this->routes = $routes;
}
/**
* Dumps the routing.
*
* @param array $options An array of options
*
* @return string The representation of the routing
*
* @throws \LogicException When this abstract class is not implemented
*/
public function dump(array $options = array())
{
throw new \LogicException('You must extend this abstract class and implement the dump() method.');
}
}

View File

@ -1,34 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\DependencyInjection\Dumper;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\Dumper;
class DumperTest extends \PHPUnit_Framework_TestCase
{
public function testDump()
{
$builder = new ContainerBuilder();
$dumper = new ProjectDumper($builder);
try {
$dumper->dump();
$this->fail('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
} catch (\Exception $e) {
$this->assertInstanceOf('\LogicException', $e, '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
$this->assertEquals('You must extend this abstract class and implement the dump() method.', $e->getMessage(), '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
}
}
}
class ProjectDumper extends Dumper
{
}