Commit 87929817 authored by Fabien Potencier's avatar Fabien Potencier

removed the fluid interface as it now works for a few methods only

This is also to avoid confusion with the fluid interface we now have for controllers.
parent b5e4aa96
......@@ -180,14 +180,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
* This method is chainable.
*
* @param mixed $callback Before filter callback
*
* @return $this
*/
public function before($callback)
{
$this['dispatcher']->addListener(Events::onSilexBefore, $callback);
return $this;
}
/**
......@@ -198,14 +194,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
* This method is chainable.
*
* @param mixed $callback After filter callback
*
* @return $this
*/
public function after($callback)
{
$this['dispatcher']->addListener(Events::onSilexAfter, $callback);
return $this;
}
/**
......@@ -224,8 +216,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
* This method is chainable.
*
* @param mixed $callback Error handler callback, takes an Exception argument
*
* @return $this
*/
public function error($callback)
{
......@@ -237,8 +227,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$event->setStringResponse($result);
}
});
return $this;
}
/**
......
......@@ -41,20 +41,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('Silex\Controller', $returnValue);
}
public function testFluidInterface()
{
$application = new Application();
$returnValue = $application->before(function() {});
$this->assertSame($application, $returnValue, '->before() should return $this');
$returnValue = $application->after(function() {});
$this->assertSame($application, $returnValue, '->after() should return $this');
$returnValue = $application->error(function() {});
$this->assertSame($application, $returnValue, '->error() should return $this');
}
public function testGetRequest()
{
$application = new Application();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment