Skip to content

Fixing some line length issues #2262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions cookbook/bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
Expand Down Expand Up @@ -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``
Expand Down
7 changes: 5 additions & 2 deletions cookbook/email/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/
.. _Swiftmailer: http://swiftmailer.org/
16 changes: 13 additions & 3 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -387,15 +391,21 @@ 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());
}

public function supportsClass($class)
{
return $this->getEntityName() === $class || is_subclass_of($class, $this->getEntityName());
return $this->getEntityName() === $class
|| is_subclass_of($class, $this->getEntityName());
}
}

Expand Down
6 changes: 5 additions & 1 deletion cookbook/service_container/event_listener.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down