Skip to content

Commit

Permalink
minor #3656 Minimize horizontal scrolling, add missing characters, re…
Browse files Browse the repository at this point in the history
…move trailing whitespace. (ifdattic)

This PR was merged into the 2.3 branch.

Discussion
----------

Minimize horizontal scrolling, add missing characters, remove trailing whitespace.

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

7006c02 Minimize horizontal scrolling, add missing characters.
  • Loading branch information
weaverryan committed Mar 19, 2014
2 parents 7c0c5d1 + 7006c02 commit 1b4f6a6
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
7 changes: 5 additions & 2 deletions components/options_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ the ``OptionsResolver`` class::

protected function configureOptions(OptionsResolverInterface $resolver)
{
// ... configure the resolver, you will learn this in the sections below
// ... configure the resolver, you will learn this
// in the sections below
}
}

Expand Down Expand Up @@ -256,7 +257,9 @@ again. When using a closure as the new value it is passed 2 arguments:
$resolver->setDefaults(array(
'encryption' => 'tls', // simple overwrite
'host' => function (Options $options, $previousValue) {
return 'localhost' == $previousValue ? '127.0.0.1' : $previousValue;
return 'localhost' == $previousValue
? '127.0.0.1'
: $previousValue;
},
));
}
Expand Down
10 changes: 7 additions & 3 deletions components/property_access/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ enable this feature by using :class:`Symfony\\Component\\PropertyAccess\\Propert
{
$property = lcfirst(substr($name, 3));
if ('get' === substr($name, 0, 3)) {
return isset($this->children[$property]) ? $this->children[$property] : null;
return isset($this->children[$property])
? $this->children[$property]
: null;
} elseif ('set' === substr($name, 0, 3)) {
$value = 1 == count($args) ? $args[0] : null;
$this->children[$property] = $value;
Expand Down Expand Up @@ -289,7 +291,9 @@ see `Enable other Features`_.
{
$property = lcfirst(substr($name, 3));
if ('get' === substr($name, 0, 3)) {
return isset($this->children[$property]) ? $this->children[$property] : null;
return isset($this->children[$property])
? $this->children[$property]
: null;
} elseif ('set' === substr($name, 0, 3)) {
$value = 1 == count($args) ? $args[0] : null;
$this->children[$property] = $value;
Expand All @@ -307,7 +311,7 @@ see `Enable other Features`_.
$accessor->setValue($person, 'wouter', array(...));
echo $person->getWouter() // array(...)
echo $person->getWouter(); // array(...)
Mixing Objects and Arrays
-------------------------
Expand Down
12 changes: 9 additions & 3 deletions components/security/firewall.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ certain action or resource of the application::

use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

// instance of Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface
$authenticationManager = ...;

// instance of Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface
$accessDecisionManager = ...;

$securityContext = new SecurityContext($authenticationManager, $accessDecisionManager);
$securityContext = new SecurityContext(
$authenticationManager,
$accessDecisionManager
);

// ... authenticate the user

Expand Down Expand Up @@ -71,7 +74,10 @@ with the event dispatcher that is used by the :class:`Symfony\\Component\\HttpKe

$firewall = new Firewall($map, $dispatcher);

$dispatcher->addListener(KernelEvents::REQUEST, array($firewall, 'onKernelRequest');
$dispatcher->addListener(
KernelEvents::REQUEST,
array($firewall, 'onKernelRequest')
);

The firewall is registered to listen to the ``kernel.request`` event that
will be dispatched by the HttpKernel at the beginning of each request
Expand Down
14 changes: 7 additions & 7 deletions components/stopwatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ call::
In addition to periods, you can get other useful information from the event object.
For example::

$event->getCategory(); // Returns the category the event was started in
$event->getOrigin(); // Returns the event start time in milliseconds
$event->ensureStopped(); // Stops all periods not already stopped
$event->getStartTime(); // Returns the start time of the very first period
$event->getEndTime(); // Returns the end time of the very last period
$event->getDuration(); // Returns the event duration, including all periods
$event->getMemory(); // Returns the max memory usage of all periods
$event->getCategory(); // Returns the category the event was started in
$event->getOrigin(); // Returns the event start time in milliseconds
$event->ensureStopped(); // Stops all periods not already stopped
$event->getStartTime(); // Returns the start time of the very first period
$event->getEndTime(); // Returns the end time of the very last period
$event->getDuration(); // Returns the event duration, including all periods
$event->getMemory(); // Returns the max memory usage of all periods

Sections
--------
Expand Down
4 changes: 3 additions & 1 deletion components/templating/helpers/slotshelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ display the content of the slot on that place:
<!doctype html>
<html>
<head>
<title><?php $view['slots']->output('title', 'Default title') ?></title>
<title>
<?php $view['slots']->output('title', 'Default title') ?>
</title>
</head>
<body>
<?php $view['slots']->output('_content') ?>
Expand Down
7 changes: 6 additions & 1 deletion components/translation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ loaded like this::

$translator->addResource('xliff', 'messages.fr.xliff', 'fr_FR');
$translator->addResource('xliff', 'admin.fr.xliff', 'fr_FR', 'admin');
$translator->addResource('xliff', 'navigation.fr.xliff', 'fr_FR', 'navigation');
$translator->addResource(
'xliff',
'navigation.fr.xliff',
'fr_FR',
'navigation'
);

When translating strings that are not in the default domain (``messages``),
you must specify the domain as the third argument of ``trans()``::
Expand Down

0 comments on commit 1b4f6a6

Please sign in to comment.