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 ...@@ -180,14 +180,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
* This method is chainable. * This method is chainable.
* *
* @param mixed $callback Before filter callback * @param mixed $callback Before filter callback
*
* @return $this
*/ */
public function before($callback) public function before($callback)
{ {
$this['dispatcher']->addListener(Events::onSilexBefore, $callback); $this['dispatcher']->addListener(Events::onSilexBefore, $callback);
return $this;
} }
/** /**
...@@ -198,14 +194,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -198,14 +194,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
* This method is chainable. * This method is chainable.
* *
* @param mixed $callback After filter callback * @param mixed $callback After filter callback
*
* @return $this
*/ */
public function after($callback) public function after($callback)
{ {
$this['dispatcher']->addListener(Events::onSilexAfter, $callback); $this['dispatcher']->addListener(Events::onSilexAfter, $callback);
return $this;
} }
/** /**
...@@ -224,8 +216,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -224,8 +216,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
* This method is chainable. * This method is chainable.
* *
* @param mixed $callback Error handler callback, takes an Exception argument * @param mixed $callback Error handler callback, takes an Exception argument
*
* @return $this
*/ */
public function error($callback) public function error($callback)
{ {
...@@ -237,8 +227,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -237,8 +227,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$event->setStringResponse($result); $event->setStringResponse($result);
} }
}); });
return $this;
} }
/** /**
......
...@@ -41,20 +41,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase ...@@ -41,20 +41,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('Silex\Controller', $returnValue); $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() public function testGetRequest()
{ {
$application = new Application(); $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