Skip to content

Commit 1afb043

Browse files
committed
Fix code examples in PHPDoc
1 parent 411e0c5 commit 1afb043

38 files changed

+247
-314
lines changed

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
* and to do the conversion of the datetime column.
2828
*
2929
* In order to use this class, you need the following table in your database:
30-
* CREATE TABLE `rememberme_token` (
31-
* `series` char(88) UNIQUE PRIMARY KEY NOT NULL,
32-
* `value` char(88) NOT NULL,
33-
* `lastUsed` datetime NOT NULL,
34-
* `class` varchar(100) NOT NULL,
35-
* `username` varchar(200) NOT NULL
36-
* );
30+
*
31+
* CREATE TABLE `rememberme_token` (
32+
* `series` char(88) UNIQUE PRIMARY KEY NOT NULL,
33+
* `value` char(88) NOT NULL,
34+
* `lastUsed` datetime NOT NULL,
35+
* `class` varchar(100) NOT NULL,
36+
* `username` varchar(200) NOT NULL
37+
* );
3738
*/
3839
class DoctrineTokenProvider implements TokenProviderInterface
3940
{

src/Symfony/Bridge/Twig/TokenParser/DumpTokenParser.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
* Token Parser for the 'dump' tag.
2020
*
2121
* Dump variables with:
22-
* <pre>
23-
* {% dump %}
24-
* {% dump foo %}
25-
* {% dump foo, bar %}
26-
* </pre>
22+
*
23+
* {% dump %}
24+
* {% dump foo %}
25+
* {% dump foo, bar %}
2726
*
2827
* @author Julien Galenski <julien.galenski@gmail.com>
2928
*/

src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ abstract protected function configureRoutes(RouteCollectionBuilder $routes);
3838
*
3939
* You can register extensions:
4040
*
41-
* $c->loadFromExtension('framework', array(
42-
* 'secret' => '%secret%'
43-
* ));
41+
* $c->loadFromExtension('framework', array(
42+
* 'secret' => '%secret%'
43+
* ));
4444
*
4545
* Or services:
4646
*
47-
* $c->register('halloween', 'FooBundle\HalloweenProvider');
47+
* $c->register('halloween', 'FooBundle\HalloweenProvider');
4848
*
4949
* Or parameters:
5050
*
51-
* $c->setParameter('halloween', 'lot of fun');
51+
* $c->setParameter('halloween', 'lot of fun');
5252
*
5353
* @param ContainerBuilder $c
5454
* @param LoaderInterface $loader

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,14 @@ public function block(FormView $view, $blockName, array $variables = array())
232232
* Use this helper for CSRF protection without the overhead of creating a
233233
* form.
234234
*
235-
* <code>
236-
* echo $view['form']->csrfToken('rm_user_'.$user->getId());
237-
* </code>
235+
* echo $view['form']->csrfToken('rm_user_'.$user->getId());
238236
*
239237
* Check the token in your action using the same intention.
240238
*
241-
* <code>
242-
* $csrfProvider = $this->get('security.csrf.token_generator');
243-
* if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) {
244-
* throw new \RuntimeException('CSRF attack detected.');
245-
* }
246-
* </code>
239+
* $csrfProvider = $this->get('security.csrf.token_generator');
240+
* if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) {
241+
* throw new \RuntimeException('CSRF attack detected.');
242+
* }
247243
*
248244
* @param string $intention The intention of the protected action
249245
*

src/Symfony/Component/Config/Definition/PrototypedArrayNode.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,27 +342,31 @@ protected function mergeValues($leftSide, $rightSide)
342342
* one is same as this->keyAttribute and the other is 'value', then the prototype will be different.
343343
*
344344
* For example, assume $this->keyAttribute is 'name' and the value array is as follows:
345-
* array(
345+
*
346346
* array(
347-
* 'name' => 'name001',
348-
* 'value' => 'value001'
347+
* array(
348+
* 'name' => 'name001',
349+
* 'value' => 'value001'
350+
* )
349351
* )
350-
* )
351352
*
352353
* Now, the key is 0 and the child node is:
353-
* array(
354-
* 'name' => 'name001',
355-
* 'value' => 'value001'
356-
* )
354+
*
355+
* array(
356+
* 'name' => 'name001',
357+
* 'value' => 'value001'
358+
* )
357359
*
358360
* When normalizing the value array, the 'name' element will removed from the child node
359361
* and its value becomes the new key of the child node:
360-
* array(
361-
* 'name001' => array('value' => 'value001')
362-
* )
362+
*
363+
* array(
364+
* 'name001' => array('value' => 'value001')
365+
* )
363366
*
364367
* Now only 'value' element is left in the child node which can be further simplified into a string:
365-
* array('name001' => 'value001')
368+
*
369+
* array('name001' => 'value001')
366370
*
367371
* Now, the key becomes 'name001' and the child node becomes 'value001' and
368372
* the prototype of child node 'name001' should be a ScalarNode instead of an ArrayNode instance.

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,14 @@ public function setRow($column, array $row)
224224
* Renders table to output.
225225
*
226226
* Example:
227-
* <code>
228-
* +---------------+-----------------------+------------------+
229-
* | ISBN | Title | Author |
230-
* +---------------+-----------------------+------------------+
231-
* | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
232-
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
233-
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
234-
* +---------------+-----------------------+------------------+
235-
* </code>
227+
*
228+
* +---------------+-----------------------+------------------+
229+
* | ISBN | Title | Author |
230+
* +---------------+-----------------------+------------------+
231+
* | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
232+
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
233+
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
234+
* +---------------+-----------------------+------------------+
236235
*/
237236
public function render()
238237
{
@@ -266,7 +265,9 @@ public function render()
266265
/**
267266
* Renders horizontal header separator.
268267
*
269-
* Example: <code>+-----+-----------+-------+</code>
268+
* Example:
269+
*
270+
* +-----+-----------+-------+
270271
*/
271272
private function renderRowSeparator()
272273
{
@@ -297,7 +298,9 @@ private function renderColumnSeparator()
297298
/**
298299
* Renders table row.
299300
*
300-
* Example: <code>| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |</code>
301+
* Example:
302+
*
303+
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
301304
*
302305
* @param array $row
303306
* @param string $cellFormat

src/Symfony/Component/Console/Input/InputDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* Usage:
2424
*
2525
* $definition = new InputDefinition(array(
26-
* new InputArgument('name', InputArgument::REQUIRED),
27-
* new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
26+
* new InputArgument('name', InputArgument::REQUIRED),
27+
* new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
2828
* ));
2929
*
3030
* @author Fabien Potencier <fabien@symfony.com>

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
*
2121
* Usage:
2222
*
23-
* $output = new StreamOutput(fopen('php://stdout', 'w'));
23+
* $output = new StreamOutput(fopen('php://stdout', 'w'));
2424
*
2525
* As `StreamOutput` can use any stream, you can also use a file:
2626
*
27-
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
27+
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
2828
*
2929
* @author Fabien Potencier <fabien@symfony.com>
3030
*/

src/Symfony/Component/CssSelector/CssSelector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CssSelector is the main entry point of the component and can convert CSS
1818
* selectors to XPath expressions.
1919
*
20-
* $xpath = CssSelector::toXpath('h1.foo');
20+
* $xpath = CssSelector::toXpath('h1.foo');
2121
*
2222
* This component is a port of the Python cssselect library,
2323
* which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@
3333
* A service can also be defined by creating a method named
3434
* getXXXService(), where XXX is the camelized version of the id:
3535
*
36-
* <ul>
37-
* <li>request -> getRequestService()</li>
38-
* <li>mysql_session_storage -> getMysqlSessionStorageService()</li>
39-
* <li>symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()</li>
40-
* </ul>
36+
* * request -> getRequestService()
37+
* * mysql_session_storage -> getMysqlSessionStorageService()
38+
* * symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()
4139
*
4240
* The container can have three possible behaviors when a service does not exist:
4341
*

0 commit comments

Comments
 (0)