Commit bfe26294 authored by Fabien Potencier's avatar Fabien Potencier

removed whitespaces in docs

parent 52b5ab1b
...@@ -44,7 +44,7 @@ on some conventions, such as checking for an array of handlers registered with ...@@ -44,7 +44,7 @@ on some conventions, such as checking for an array of handlers registered with
the container with the channel name, defaulting to the bundled handler. the container with the channel name, defaulting to the bundled handler.
.. code-block:: php .. code-block:: php
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Logger; use Monolog\Logger;
......
...@@ -41,22 +41,22 @@ The ``SerializerServiceProvider`` provider provides a ``serializer`` service: ...@@ -41,22 +41,22 @@ The ``SerializerServiceProvider`` provider provides a ``serializer`` service:
use Silex\Application; use Silex\Application;
use Silex\Provider\SerializerServiceProvider; use Silex\Provider\SerializerServiceProvider;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
$app = new Application(); $app = new Application();
$app->register(new SerializerServiceProvider()); $app->register(new SerializerServiceProvider());
// only accept content types supported by the serializer via the assert method. // only accept content types supported by the serializer via the assert method.
$app->get("/pages/{id}.{_format}", function ($id) use ($app) { $app->get("/pages/{id}.{_format}", function ($id) use ($app) {
// assume a page_repository service exists that returns Page objects. The // assume a page_repository service exists that returns Page objects. The
// object returned has getters and setters exposing the state. // object returned has getters and setters exposing the state.
$page = $app['page_repository']->find($id); $page = $app['page_repository']->find($id);
$format = $app['request']->getRequestFormat(); $format = $app['request']->getRequestFormat();
if (!$page instanceof Page) { if (!$page instanceof Page) {
$app->abort("No page found for id: $id"); $app->abort("No page found for id: $id");
} }
return new Response($app['serializer']->serialize($page, $format), 200, array( return new Response($app['serializer']->serialize($page, $format), 200, array(
"Content-Type" => $app['request']->getMimeType($format) "Content-Type" => $app['request']->getMimeType($format)
)); ));
......
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