Commit a8c3fb7c authored by Fabien Potencier's avatar Fabien Potencier

Merge branch '1.3'

* 1.3:
  tweaked docs
  added warning about route security trait
  PHPDocs Application -> HttpKernelInterface
  Very little typo fix.
parents 35f73c1f aed232e0
...@@ -645,4 +645,23 @@ Traits ...@@ -645,4 +645,23 @@ Traits
// do something but only for admins // do something but only for admins
})->secure('ROLE_ADMIN'); })->secure('ROLE_ADMIN');
.. caution::
The ``Silex\Route\SecurityTrait`` must be used with a user defined
``Route`` class, not the application.
.. code-block:: php
use Silex\Route;
class MyRoute extends Route
{
use Route\SecurityTrait;
}
.. code-block:: php
$app['route_class'] = 'MyRoute';
.. _cookbook: http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html .. _cookbook: http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html
...@@ -513,7 +513,7 @@ setting a more specific type hint for the Closure argument:: ...@@ -513,7 +513,7 @@ setting a more specific type hint for the Closure argument::
return new Response('Error', 404 /* ignored */, array('X-Status-Code' => 200)); return new Response('Error', 404 /* ignored */, array('X-Status-Code' => 200));
If you want to use a separate error handler for logging, make sure you register If you want to use a separate error handler for logging, make sure you register
it with a higher priority then response error handlers, because once a response it with a higher priority than response error handlers, because once a response
is returned, the following handlers are ignored. is returned, the following handlers are ignored.
.. note:: .. note::
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace Silex; namespace Silex;
use Symfony\Component\HttpKernel\Client; use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpKernel\HttpKernel; use Symfony\Component\HttpKernel\HttpKernelInterface;
/** /**
* WebTestCase is the base class for functional tests. * WebTestCase is the base class for functional tests.
...@@ -22,9 +22,9 @@ use Symfony\Component\HttpKernel\HttpKernel; ...@@ -22,9 +22,9 @@ use Symfony\Component\HttpKernel\HttpKernel;
abstract class WebTestCase extends \PHPUnit_Framework_TestCase abstract class WebTestCase extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Application instance. * HttpKernelInterface instance.
* *
* @var Application * @var HttpKernelInterface
*/ */
protected $app; protected $app;
...@@ -42,14 +42,14 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase ...@@ -42,14 +42,14 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
/** /**
* Creates the application. * Creates the application.
* *
* @return HttpKernel * @return HttpKernelInterface
*/ */
abstract public function createApplication(); abstract public function createApplication();
/** /**
* Creates a Client. * Creates a Client.
* *
* @param array $server An array of server parameters * @param array $server Server parameters
* *
* @return Client A Client instance * @return Client A Client instance
*/ */
......
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