Skip to content

Commit 0f15ad0

Browse files
Fixing some line length issues
1 parent 342c66e commit 0f15ad0

File tree

4 files changed

+42
-11
lines changed

4 files changed

+42
-11
lines changed

cookbook/bundles/extension.rst

+19-5
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ configuration::
293293
{
294294
// ... prepare your $config variable
295295

296-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
296+
$loader = new XmlFileLoader(
297+
$container,
298+
new FileLocator(__DIR__.'/../Resources/config')
299+
);
297300
$loader->load('services.xml');
298301
}
299302

@@ -305,7 +308,10 @@ option is passed and set to true::
305308
{
306309
// ... prepare your $config variable
307310

308-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
311+
$loader = new XmlFileLoader(
312+
$container,
313+
new FileLocator(__DIR__.'/../Resources/config')
314+
);
309315

310316
if (isset($config['enabled']) && $config['enabled']) {
311317
$loader->load('services.xml');
@@ -351,14 +357,22 @@ Add the following to the ``load()`` method to do this::
351357
{
352358
// ... prepare your $config variable
353359

354-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
360+
$loader = new XmlFileLoader(
361+
$container,
362+
new FileLocator(__DIR__.'/../Resources/config')
363+
);
355364
$loader->load('services.xml');
356365

357366
if (!isset($config['my_type'])) {
358-
throw new \InvalidArgumentException('The "my_type" option must be set');
367+
throw new \InvalidArgumentException(
368+
'The "my_type" option must be set'
369+
);
359370
}
360371

361-
$container->setParameter('acme_hello.my_service_type', $config['my_type']);
372+
$container->setParameter(
373+
'acme_hello.my_service_type',
374+
$config['my_type']
375+
);
362376
}
363377

364378
Now, the user can effectively configure the service by specifying the ``my_type``

cookbook/email/testing.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ to get information about the messages send on the previous request::
5656
$this->assertEquals('Hello Email', $message->getSubject());
5757
$this->assertEquals('send@example.com', key($message->getFrom()));
5858
$this->assertEquals('recipient@example.com', key($message->getTo()));
59-
$this->assertEquals('You should see me from the profiler!', $message->getBody());
59+
$this->assertEquals(
60+
'You should see me from the profiler!',
61+
$message->getBody()
62+
);
6063
}
6164
}
6265

63-
.. _Swiftmailer: http://swiftmailer.org/
66+
.. _Swiftmailer: http://swiftmailer.org/

cookbook/security/entity_provider.rst

+13-3
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,11 @@ The code below shows the implementation of the
377377
// if there is no record matching the criteria.
378378
$user = $q->getSingleResult();
379379
} catch (NoResultException $e) {
380-
throw new UsernameNotFoundException(sprintf('Unable to find an active admin AcmeUserBundle:User object identified by "%s".', $username), null, 0, $e);
380+
$message = sprintf(
381+
'Unable to find an active admin AcmeUserBundle:User object identified by "%s".',
382+
$username
383+
);
384+
throw new UsernameNotFoundException($message, null, 0, $e);
381385
}
382386
383387
return $user;
@@ -387,15 +391,21 @@ The code below shows the implementation of the
387391
{
388392
$class = get_class($user);
389393
if (!$this->supportsClass($class)) {
390-
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $class));
394+
throw new UnsupportedUserException(
395+
sprintf(
396+
'Instances of "%s" are not supported.',
397+
$class
398+
)
399+
);
391400
}
392401
393402
return $this->find($user->getId());
394403
}
395404
396405
public function supportsClass($class)
397406
{
398-
return $this->getEntityName() === $class || is_subclass_of($class, $this->getEntityName());
407+
return $this->getEntityName() === $class
408+
|| is_subclass_of($class, $this->getEntityName());
399409
}
400410
}
401411

cookbook/service_container/event_listener.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ event is just one of the core kernel events::
2727
{
2828
// You get the exception object from the received event
2929
$exception = $event->getException();
30-
$message = 'My Error says: ' . $exception->getMessage() . ' with code: ' . $exception->getCode();
30+
$message = sprintf(
31+
'My Error says: %s with code: %s',
32+
$exception->getMessage(),
33+
$exception->getCode()
34+
);
3135

3236
// Customize your response object to display the exception details
3337
$response = new Response();

0 commit comments

Comments
 (0)