diff --git a/cookbook/bundles/extension.rst b/cookbook/bundles/extension.rst index 30d92803bb9..caf994427b9 100644 --- a/cookbook/bundles/extension.rst +++ b/cookbook/bundles/extension.rst @@ -293,7 +293,10 @@ configuration:: { // ... prepare your $config variable - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new XmlFileLoader( + $container, + new FileLocator(__DIR__.'/../Resources/config') + ); $loader->load('services.xml'); } @@ -305,7 +308,10 @@ option is passed and set to true:: { // ... prepare your $config variable - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new XmlFileLoader( + $container, + new FileLocator(__DIR__.'/../Resources/config') + ); if (isset($config['enabled']) && $config['enabled']) { $loader->load('services.xml'); @@ -351,14 +357,22 @@ Add the following to the ``load()`` method to do this:: { // ... prepare your $config variable - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new XmlFileLoader( + $container, + new FileLocator(__DIR__.'/../Resources/config') + ); $loader->load('services.xml'); if (!isset($config['my_type'])) { - throw new \InvalidArgumentException('The "my_type" option must be set'); + throw new \InvalidArgumentException( + 'The "my_type" option must be set' + ); } - $container->setParameter('acme_hello.my_service_type', $config['my_type']); + $container->setParameter( + 'acme_hello.my_service_type', + $config['my_type'] + ); } Now, the user can effectively configure the service by specifying the ``my_type`` diff --git a/cookbook/email/testing.rst b/cookbook/email/testing.rst index 19a21d9b970..9b18d6c6a1e 100644 --- a/cookbook/email/testing.rst +++ b/cookbook/email/testing.rst @@ -56,8 +56,11 @@ to get information about the messages send on the previous request:: $this->assertEquals('Hello Email', $message->getSubject()); $this->assertEquals('send@example.com', key($message->getFrom())); $this->assertEquals('recipient@example.com', key($message->getTo())); - $this->assertEquals('You should see me from the profiler!', $message->getBody()); + $this->assertEquals( + 'You should see me from the profiler!', + $message->getBody() + ); } } -.. _Swiftmailer: http://swiftmailer.org/ \ No newline at end of file +.. _Swiftmailer: http://swiftmailer.org/ diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index 7567cc47e3d..92bc7710de8 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -377,7 +377,11 @@ The code below shows the implementation of the // if there is no record matching the criteria. $user = $q->getSingleResult(); } catch (NoResultException $e) { - throw new UsernameNotFoundException(sprintf('Unable to find an active admin AcmeUserBundle:User object identified by "%s".', $username), null, 0, $e); + $message = sprintf( + 'Unable to find an active admin AcmeUserBundle:User object identified by "%s".', + $username + ); + throw new UsernameNotFoundException($message, null, 0, $e); } return $user; @@ -387,7 +391,12 @@ The code below shows the implementation of the { $class = get_class($user); if (!$this->supportsClass($class)) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $class)); + throw new UnsupportedUserException( + sprintf( + 'Instances of "%s" are not supported.', + $class + ) + ); } return $this->find($user->getId()); @@ -395,7 +404,8 @@ The code below shows the implementation of the public function supportsClass($class) { - return $this->getEntityName() === $class || is_subclass_of($class, $this->getEntityName()); + return $this->getEntityName() === $class + || is_subclass_of($class, $this->getEntityName()); } } diff --git a/cookbook/service_container/event_listener.rst b/cookbook/service_container/event_listener.rst index bda88ad6169..7e0b5410f79 100644 --- a/cookbook/service_container/event_listener.rst +++ b/cookbook/service_container/event_listener.rst @@ -27,7 +27,11 @@ event is just one of the core kernel events:: { // You get the exception object from the received event $exception = $event->getException(); - $message = 'My Error says: ' . $exception->getMessage() . ' with code: ' . $exception->getCode(); + $message = sprintf( + 'My Error says: %s with code: %s', + $exception->getMessage(), + $exception->getCode() + ); // Customize your response object to display the exception details $response = new Response();