Merge branch '2.8' into 3.4

* 2.8:
  Use the real image URL for the filesystem tests
  [Finder] Update PHPdoc append()
  [DI] Fix phpdoc
  Fix code examples in PHPDoc
  [HttpKernel] Fix inheritdocs
This commit is contained in:
Nicolas Grekas 2018-09-02 19:11:59 +02:00
commit aa13bfdde0
33 changed files with 216 additions and 252 deletions

View File

@ -27,13 +27,14 @@ use Symfony\Component\Security\Core\Exception\TokenNotFoundException;
* and to do the conversion of the datetime column. * and to do the conversion of the datetime column.
* *
* In order to use this class, you need the following table in your database: * In order to use this class, you need the following table in your database:
* CREATE TABLE `rememberme_token` ( *
* `series` char(88) UNIQUE PRIMARY KEY NOT NULL, * CREATE TABLE `rememberme_token` (
* `value` char(88) NOT NULL, * `series` char(88) UNIQUE PRIMARY KEY NOT NULL,
* `lastUsed` datetime NOT NULL, * `value` char(88) NOT NULL,
* `class` varchar(100) NOT NULL, * `lastUsed` datetime NOT NULL,
* `username` varchar(200) NOT NULL * `class` varchar(100) NOT NULL,
* ); * `username` varchar(200) NOT NULL
* );
*/ */
class DoctrineTokenProvider implements TokenProviderInterface class DoctrineTokenProvider implements TokenProviderInterface
{ {

View File

@ -19,11 +19,10 @@ use Twig\TokenParser\AbstractTokenParser;
* Token Parser for the 'dump' tag. * Token Parser for the 'dump' tag.
* *
* Dump variables with: * Dump variables with:
* <pre> *
* {% dump %} * {% dump %}
* {% dump foo %} * {% dump foo %}
* {% dump foo, bar %} * {% dump foo, bar %}
* </pre>
* *
* @author Julien Galenski <julien.galenski@gmail.com> * @author Julien Galenski <julien.galenski@gmail.com>
*/ */

View File

@ -39,17 +39,17 @@ trait MicroKernelTrait
* *
* You can register extensions: * You can register extensions:
* *
* $c->loadFromExtension('framework', array( * $c->loadFromExtension('framework', array(
* 'secret' => '%secret%' * 'secret' => '%secret%'
* )); * ));
* *
* Or services: * Or services:
* *
* $c->register('halloween', 'FooBundle\HalloweenProvider'); * $c->register('halloween', 'FooBundle\HalloweenProvider');
* *
* Or parameters: * Or parameters:
* *
* $c->setParameter('halloween', 'lot of fun'); * $c->setParameter('halloween', 'lot of fun');
* *
* @param ContainerBuilder $c * @param ContainerBuilder $c
* @param LoaderInterface $loader * @param LoaderInterface $loader

View File

@ -212,18 +212,14 @@ class FormHelper extends Helper
* Use this helper for CSRF protection without the overhead of creating a * Use this helper for CSRF protection without the overhead of creating a
* form. * form.
* *
* <code> * echo $view['form']->csrfToken('rm_user_'.$user->getId());
* echo $view['form']->csrfToken('rm_user_'.$user->getId());
* </code>
* *
* Check the token in your action using the same CSRF token id. * Check the token in your action using the same CSRF token id.
* *
* <code> * // $csrfProvider being an instance of Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface
* // $csrfProvider being an instance of Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface * if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) {
* if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) { * throw new \RuntimeException('CSRF attack detected.');
* throw new \RuntimeException('CSRF attack detected.'); * }
* }
* </code>
* *
* @param string $tokenId The CSRF token id of the protected action * @param string $tokenId The CSRF token id of the protected action
* *

View File

@ -342,27 +342,31 @@ class PrototypedArrayNode extends ArrayNode
* one is same as this->keyAttribute and the other is 'value', then the prototype will be different. * one is same as this->keyAttribute and the other is 'value', then the prototype will be different.
* *
* For example, assume $this->keyAttribute is 'name' and the value array is as follows: * For example, assume $this->keyAttribute is 'name' and the value array is as follows:
* array( *
* array( * array(
* 'name' => 'name001', * array(
* 'value' => 'value001' * 'name' => 'name001',
* 'value' => 'value001'
* )
* ) * )
* )
* *
* Now, the key is 0 and the child node is: * Now, the key is 0 and the child node is:
* array( *
* 'name' => 'name001', * array(
* 'value' => 'value001' * 'name' => 'name001',
* ) * 'value' => 'value001'
* )
* *
* When normalizing the value array, the 'name' element will removed from the child node * When normalizing the value array, the 'name' element will removed from the child node
* and its value becomes the new key of the child node: * and its value becomes the new key of the child node:
* array( *
* 'name001' => array('value' => 'value001') * array(
* ) * 'name001' => array('value' => 'value001')
* )
* *
* Now only 'value' element is left in the child node which can be further simplified into a string: * Now only 'value' element is left in the child node which can be further simplified into a string:
* array('name001' => 'value001') *
* array('name001' => 'value001')
* *
* Now, the key becomes 'name001' and the child node becomes 'value001' and * Now, the key becomes 'name001' and the child node becomes 'value001' and
* the prototype of child node 'name001' should be a ScalarNode instead of an ArrayNode instance. * the prototype of child node 'name001' should be a ScalarNode instead of an ArrayNode instance.

View File

@ -263,15 +263,14 @@ class Table
* Renders table to output. * Renders table to output.
* *
* Example: * Example:
* <code> *
* +---------------+-----------------------+------------------+ * +---------------+-----------------------+------------------+
* | ISBN | Title | Author | * | ISBN | Title | Author |
* +---------------+-----------------------+------------------+ * +---------------+-----------------------+------------------+
* | 99921-58-10-7 | Divine Comedy | Dante Alighieri | * | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
* +---------------+-----------------------+------------------+ * +---------------+-----------------------+------------------+
* </code>
*/ */
public function render() public function render()
{ {
@ -305,7 +304,9 @@ class Table
/** /**
* Renders horizontal header separator. * Renders horizontal header separator.
* *
* Example: <code>+-----+-----------+-------+</code> * Example:
*
* +-----+-----------+-------+
*/ */
private function renderRowSeparator() private function renderRowSeparator()
{ {
@ -336,7 +337,9 @@ class Table
/** /**
* Renders table row. * Renders table row.
* *
* Example: <code>| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |</code> * Example:
*
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
* *
* @param array $row * @param array $row
* @param string $cellFormat * @param string $cellFormat

View File

@ -20,8 +20,8 @@ use Symfony\Component\Console\Exception\LogicException;
* Usage: * Usage:
* *
* $definition = new InputDefinition(array( * $definition = new InputDefinition(array(
* new InputArgument('name', InputArgument::REQUIRED), * new InputArgument('name', InputArgument::REQUIRED),
* new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
* )); * ));
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>

View File

@ -20,11 +20,11 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
* *
* Usage: * Usage:
* *
* $output = new StreamOutput(fopen('php://stdout', 'w')); * $output = new StreamOutput(fopen('php://stdout', 'w'));
* *
* As `StreamOutput` can use any stream, you can also use a file: * As `StreamOutput` can use any stream, you can also use a file:
* *
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */

View File

@ -18,5 +18,8 @@ namespace Symfony\Component\DependencyInjection;
*/ */
interface ContainerAwareInterface interface ContainerAwareInterface
{ {
/**
* Sets the container.
*/
public function setContainer(ContainerInterface $container = null); public function setContainer(ContainerInterface $container = null);
} }

View File

@ -647,10 +647,10 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* the parameters passed to the container constructor to have precedence * the parameters passed to the container constructor to have precedence
* over the loaded ones. * over the loaded ones.
* *
* $container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); * $container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar')));
* $loader = new LoaderXXX($container); * $loader = new LoaderXXX($container);
* $loader->load('resource_name'); * $loader->load('resource_name');
* $container->register('foo', 'stdClass'); * $container->register('foo', 'stdClass');
* *
* In the above example, even if the loaded resource defines a foo * In the above example, even if the loaded resource defines a foo
* parameter, the value will still be 'bar' as defined in the ContainerBuilder * parameter, the value will still be 'bar' as defined in the ContainerBuilder
@ -1288,14 +1288,14 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* *
* Example: * Example:
* *
* $container->register('foo')->addTag('my.tag', array('hello' => 'world')); * $container->register('foo')->addTag('my.tag', array('hello' => 'world'));
* *
* $serviceIds = $container->findTaggedServiceIds('my.tag'); * $serviceIds = $container->findTaggedServiceIds('my.tag');
* foreach ($serviceIds as $serviceId => $tags) { * foreach ($serviceIds as $serviceId => $tags) {
* foreach ($tags as $tag) { * foreach ($tags as $tag) {
* echo $tag['hello']; * echo $tag['hello'];
* }
* } * }
* }
* *
* @param string $name * @param string $name
* @param bool $throwOnAbstract * @param bool $throwOnAbstract

View File

@ -109,7 +109,7 @@ class Definition
/** /**
* Gets the factory. * Gets the factory.
* *
* @return string|array The PHP function or an array containing a class/Reference and a method to call * @return string|array|null The PHP function or an array containing a class/Reference and a method to call
*/ */
public function getFactory() public function getFactory()
{ {

View File

@ -626,7 +626,7 @@ class Crawler implements \Countable, \IteratorAggregate
* *
* Example: * Example:
* *
* $crawler->filter('h1 a')->extract(array('_text', 'href')); * $crawler->filter('h1 a')->extract(array('_text', 'href'));
* *
* @param array $attributes An array of attributes * @param array $attributes An array of attributes
* *
@ -889,7 +889,7 @@ class Crawler implements \Countable, \IteratorAggregate
* Escaped characters are: quotes (") and apostrophe ('). * Escaped characters are: quotes (") and apostrophe (').
* *
* Examples: * Examples:
* <code> *
* echo Crawler::xpathLiteral('foo " bar'); * echo Crawler::xpathLiteral('foo " bar');
* //prints 'foo " bar' * //prints 'foo " bar'
* *
@ -898,7 +898,7 @@ class Crawler implements \Countable, \IteratorAggregate
* *
* echo Crawler::xpathLiteral('a\'b"c'); * echo Crawler::xpathLiteral('a\'b"c');
* //prints concat('a', "'", 'b"c') * //prints concat('a', "'", 'b"c')
* </code> *
* *
* @param string $s String to be escaped * @param string $s String to be escaped
* *

View File

@ -186,9 +186,7 @@ class FormFieldRegistry
/** /**
* Splits a field name into segments as a web browser would do. * Splits a field name into segments as a web browser would do.
* *
* <code>
* getSegments('base[foo][3][]') = array('base', 'foo, '3', ''); * getSegments('base[foo][3][]') = array('base', 'foo, '3', '');
* </code>
* *
* @param string $name The name of the field * @param string $name The name of the field
* *

View File

@ -161,7 +161,7 @@ class FilesystemTest extends FilesystemTestCase
*/ */
public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy() public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy()
{ {
$sourceFilePath = 'http://symfony.com/images/common/logo/logo_symfony_header.png'; $sourceFilePath = 'https://symfony.com/images/common/logo/logo_symfony_header.png';
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file'; $targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
file_put_contents($targetFilePath, 'TARGET FILE'); file_put_contents($targetFilePath, 'TARGET FILE');

View File

@ -31,7 +31,7 @@ use Symfony\Component\Finder\Iterator\SortableIterator;
* *
* All methods return the current Finder object to allow easy chaining: * All methods return the current Finder object to allow easy chaining:
* *
* $finder = Finder::create()->files()->name('*.php')->in(__DIR__); * $finder = Finder::create()->files()->name('*.php')->in(__DIR__);
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
@ -105,8 +105,8 @@ class Finder implements \IteratorAggregate, \Countable
* *
* Usage: * Usage:
* *
* $finder->depth('> 1') // the Finder will start matching at level 1. * $finder->depth('> 1') // the Finder will start matching at level 1.
* $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
* *
* @param string|int $level The depth level expression * @param string|int $level The depth level expression
* *
@ -127,10 +127,10 @@ class Finder implements \IteratorAggregate, \Countable
* *
* The date must be something that strtotime() is able to parse: * The date must be something that strtotime() is able to parse:
* *
* $finder->date('since yesterday'); * $finder->date('since yesterday');
* $finder->date('until 2 days ago'); * $finder->date('until 2 days ago');
* $finder->date('> now - 2 hours'); * $finder->date('> now - 2 hours');
* $finder->date('>= 2005-10-15'); * $finder->date('>= 2005-10-15');
* *
* @param string $date A date range string * @param string $date A date range string
* *
@ -152,9 +152,9 @@ class Finder implements \IteratorAggregate, \Countable
* *
* You can use patterns (delimited with / sign), globs or simple strings. * You can use patterns (delimited with / sign), globs or simple strings.
* *
* $finder->name('*.php') * $finder->name('*.php')
* $finder->name('/\.php$/') // same as above * $finder->name('/\.php$/') // same as above
* $finder->name('test.php') * $finder->name('test.php')
* *
* @param string $pattern A pattern (a regexp, a glob, or a string) * @param string $pattern A pattern (a regexp, a glob, or a string)
* *
@ -190,8 +190,8 @@ class Finder implements \IteratorAggregate, \Countable
* *
* Strings or PCRE patterns can be used: * Strings or PCRE patterns can be used:
* *
* $finder->contains('Lorem ipsum') * $finder->contains('Lorem ipsum')
* $finder->contains('/Lorem ipsum/i') * $finder->contains('/Lorem ipsum/i')
* *
* @param string $pattern A pattern (string or regexp) * @param string $pattern A pattern (string or regexp)
* *
@ -211,8 +211,8 @@ class Finder implements \IteratorAggregate, \Countable
* *
* Strings or PCRE patterns can be used: * Strings or PCRE patterns can be used:
* *
* $finder->notContains('Lorem ipsum') * $finder->notContains('Lorem ipsum')
* $finder->notContains('/Lorem ipsum/i') * $finder->notContains('/Lorem ipsum/i')
* *
* @param string $pattern A pattern (string or regexp) * @param string $pattern A pattern (string or regexp)
* *
@ -232,8 +232,8 @@ class Finder implements \IteratorAggregate, \Countable
* *
* You can use patterns (delimited with / sign) or simple strings. * You can use patterns (delimited with / sign) or simple strings.
* *
* $finder->path('some/special/dir') * $finder->path('some/special/dir')
* $finder->path('/some\/special\/dir/') // same as above * $finder->path('/some\/special\/dir/') // same as above
* *
* Use only / as dirname separator. * Use only / as dirname separator.
* *
@ -255,8 +255,8 @@ class Finder implements \IteratorAggregate, \Countable
* *
* You can use patterns (delimited with / sign) or simple strings. * You can use patterns (delimited with / sign) or simple strings.
* *
* $finder->notPath('some/special/dir') * $finder->notPath('some/special/dir')
* $finder->notPath('/some\/special\/dir/') // same as above * $finder->notPath('/some\/special\/dir/') // same as above
* *
* Use only / as dirname separator. * Use only / as dirname separator.
* *
@ -276,9 +276,9 @@ class Finder implements \IteratorAggregate, \Countable
/** /**
* Adds tests for file sizes. * Adds tests for file sizes.
* *
* $finder->size('> 10K'); * $finder->size('> 10K');
* $finder->size('<= 1Ki'); * $finder->size('<= 1Ki');
* $finder->size(4); * $finder->size(4);
* *
* @param string|int $size A size range string or an integer * @param string|int $size A size range string or an integer
* *
@ -589,7 +589,7 @@ class Finder implements \IteratorAggregate, \Countable
* *
* The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
* *
* @param mixed $iterator * @param iterable $iterator
* *
* @return $this * @return $this
* *
@ -639,7 +639,7 @@ class Finder implements \IteratorAggregate, \Countable
} }
/** /**
* @param $dir * @param string $dir
* *
* @return \Iterator * @return \Iterator
*/ */

View File

@ -14,14 +14,14 @@ namespace Symfony\Component\Finder;
/** /**
* Glob matches globbing patterns against text. * Glob matches globbing patterns against text.
* *
* if match_glob("foo.*", "foo.bar") echo "matched\n"; * if match_glob("foo.*", "foo.bar") echo "matched\n";
* *
* // prints foo.bar and foo.baz * // prints foo.bar and foo.baz
* $regex = glob_to_regex("foo.*"); * $regex = glob_to_regex("foo.*");
* for (array('foo.bar', 'foo.baz', 'foo', 'bar') as $t) * for (array('foo.bar', 'foo.baz', 'foo', 'bar') as $t)
* { * {
* if (/$regex/) echo "matched: $car\n"; * if (/$regex/) echo "matched: $car\n";
* } * }
* *
* Glob implements glob(3) style matching that can be used to match * Glob implements glob(3) style matching that can be used to match
* against text, rather than fetching names from a filesystem. * against text, rather than fetching names from a filesystem.

View File

@ -24,18 +24,14 @@ use Symfony\Component\PropertyAccess\PropertyPath;
* *
* Pass the decorated factory to the constructor: * Pass the decorated factory to the constructor:
* *
* ```php * $decorator = new PropertyAccessDecorator($factory);
* $decorator = new PropertyAccessDecorator($factory);
* ```
* *
* You can now pass property paths for generating choice values, labels, view * You can now pass property paths for generating choice values, labels, view
* indices, HTML attributes and for determining the preferred choices and the * indices, HTML attributes and for determining the preferred choices and the
* choice groups: * choice groups:
* *
* ```php * // extract values from the $value property
* // extract values from the $value property * $list = $createListFromChoices($objects, 'value');
* $list = $createListFromChoices($objects, 'value');
* ```
* *
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
*/ */

View File

@ -198,9 +198,7 @@ class ViolationPath implements \IteratorAggregate, PropertyPathInterface
* *
* Consider the following violation path: * Consider the following violation path:
* *
* <code> * children[address].children[office].data.street
* children[address].children[office].data.street
* </code>
* *
* In this example, "address" and "office" map to forms, while * In this example, "address" and "office" map to forms, while
* "street does not. * "street does not.

View File

@ -55,11 +55,9 @@ interface FormRendererEngineInterface
* and continues with the child of that root, the child of that child etc. * and continues with the child of that root, the child of that child etc.
* The following is an example for a block hierarchy: * The following is an example for a block hierarchy:
* *
* <code> * form_widget
* form_widget * text_widget
* text_widget * url_widget
* url_widget
* </code>
* *
* In this example, "url_widget" is the most specific block, while the other * In this example, "url_widget" is the most specific block, while the other
* blocks are its ancestors in the hierarchy. * blocks are its ancestors in the hierarchy.
@ -93,11 +91,9 @@ interface FormRendererEngineInterface
* and continues with the child of that root, the child of that child etc. * and continues with the child of that root, the child of that child etc.
* The following is an example for a block hierarchy: * The following is an example for a block hierarchy:
* *
* <code> * form_widget
* form_widget * text_widget
* text_widget * url_widget
* url_widget
* </code>
* *
* The second parameter $hierarchyLevel determines the level of the hierarchy * The second parameter $hierarchyLevel determines the level of the hierarchy
* that should be rendered. * that should be rendered.

View File

@ -71,18 +71,14 @@ interface FormRendererInterface
* Use this helper for CSRF protection without the overhead of creating a * Use this helper for CSRF protection without the overhead of creating a
* form. * form.
* *
* <code> * <input type="hidden" name="token" value="<?php $renderer->renderCsrfToken('rm_user_'.$user->getId()) ?>">
* <input type="hidden" name="token" value="<?php $renderer->renderCsrfToken('rm_user_'.$user->getId()) ?>">
* </code>
* *
* Check the token in your action using the same token ID. * Check the token in your action using the same token ID.
* *
* <code> * // $csrfProvider being an instance of Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface
* // $csrfProvider being an instance of Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface * if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) {
* if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) { * throw new \RuntimeException('CSRF attack detected.');
* throw new \RuntimeException('CSRF attack detected.'); * }
* }
* </code>
* *
* @param string $tokenId The ID of the CSRF token * @param string $tokenId The ID of the CSRF token
* *

View File

@ -18,28 +18,24 @@ use Symfony\Component\Form\Extension\Core\CoreExtension;
* *
* Use this class to conveniently create new form factories: * Use this class to conveniently create new form factories:
* *
* <code> * use Symfony\Component\Form\Forms;
* use Symfony\Component\Form\Forms;
* *
* $formFactory = Forms::createFormFactory(); * $formFactory = Forms::createFormFactory();
* *
* $form = $formFactory->createBuilder() * $form = $formFactory->createBuilder()
* ->add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType') * ->add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
* ->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType') * ->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
* ->add('age', 'Symfony\Component\Form\Extension\Core\Type\IntegerType') * ->add('age', 'Symfony\Component\Form\Extension\Core\Type\IntegerType')
* ->add('gender', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array( * ->add('gender', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array(
* 'choices' => array('Male' => 'm', 'Female' => 'f'), * 'choices' => array('Male' => 'm', 'Female' => 'f'),
* )) * ))
* ->getForm(); * ->getForm();
* </code>
* *
* You can also add custom extensions to the form factory: * You can also add custom extensions to the form factory:
* *
* <code> * $formFactory = Forms::createFormFactoryBuilder()
* $formFactory = Forms::createFormFactoryBuilder() * ->addExtension(new AcmeExtension())
* ->addExtension(new AcmeExtension()) * ->getFormFactory();
* ->getFormFactory();
* </code>
* *
* If you create custom form types or type extensions, it is * If you create custom form types or type extensions, it is
* generally recommended to create your own extensions that lazily * generally recommended to create your own extensions that lazily
@ -47,54 +43,46 @@ use Symfony\Component\Form\Extension\Core\CoreExtension;
* does not matter that much, you can also pass them directly to the * does not matter that much, you can also pass them directly to the
* form factory: * form factory:
* *
* <code> * $formFactory = Forms::createFormFactoryBuilder()
* $formFactory = Forms::createFormFactoryBuilder() * ->addType(new PersonType())
* ->addType(new PersonType()) * ->addType(new PhoneNumberType())
* ->addType(new PhoneNumberType()) * ->addTypeExtension(new FormTypeHelpTextExtension())
* ->addTypeExtension(new FormTypeHelpTextExtension()) * ->getFormFactory();
* ->getFormFactory();
* </code>
* *
* Support for the Validator component is provided by ValidatorExtension. * Support for the Validator component is provided by ValidatorExtension.
* This extension needs a validator object to function properly: * This extension needs a validator object to function properly:
* *
* <code> * use Symfony\Component\Validator\Validation;
* use Symfony\Component\Validator\Validation; * use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
* use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
* *
* $validator = Validation::createValidator(); * $validator = Validation::createValidator();
* $formFactory = Forms::createFormFactoryBuilder() * $formFactory = Forms::createFormFactoryBuilder()
* ->addExtension(new ValidatorExtension($validator)) * ->addExtension(new ValidatorExtension($validator))
* ->getFormFactory(); * ->getFormFactory();
* </code>
* *
* Support for the Templating component is provided by TemplatingExtension. * Support for the Templating component is provided by TemplatingExtension.
* This extension needs a PhpEngine object for rendering forms. As second * This extension needs a PhpEngine object for rendering forms. As second
* argument you should pass the names of the default themes. Here is an * argument you should pass the names of the default themes. Here is an
* example for using the default layout with "<div>" tags: * example for using the default layout with "<div>" tags:
* *
* <code> * use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
* use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
* *
* $formFactory = Forms::createFormFactoryBuilder() * $formFactory = Forms::createFormFactoryBuilder()
* ->addExtension(new TemplatingExtension($engine, null, array( * ->addExtension(new TemplatingExtension($engine, null, array(
* 'FrameworkBundle:Form', * 'FrameworkBundle:Form',
* ))) * )))
* ->getFormFactory(); * ->getFormFactory();
* </code>
* *
* The next example shows how to include the "<table>" layout: * The next example shows how to include the "<table>" layout:
* *
* <code> * use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
* use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
* *
* $formFactory = Forms::createFormFactoryBuilder() * $formFactory = Forms::createFormFactoryBuilder()
* ->addExtension(new TemplatingExtension($engine, null, array( * ->addExtension(new TemplatingExtension($engine, null, array(
* 'FrameworkBundle:Form', * 'FrameworkBundle:Form',
* 'FrameworkBundle:FormTable', * 'FrameworkBundle:FormTable',
* ))) * )))
* ->getFormFactory(); * ->getFormFactory();
* </code>
* *
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
*/ */

View File

@ -34,23 +34,21 @@ abstract class Bundle implements BundleInterface
private $namespace; private $namespace;
/** /**
* Boots the Bundle. * {@inheritdoc}
*/ */
public function boot() public function boot()
{ {
} }
/** /**
* Shutdowns the Bundle. * {@inheritdoc}
*/ */
public function shutdown() public function shutdown()
{ {
} }
/** /**
* Builds the bundle. * {@inheritdoc}
*
* It is only ever called once when the cache is empty.
* *
* This method can be overridden to register compilation passes, * This method can be overridden to register compilation passes,
* other extensions, ... * other extensions, ...
@ -99,9 +97,7 @@ abstract class Bundle implements BundleInterface
} }
/** /**
* Gets the Bundle namespace. * {@inheritdoc}
*
* @return string The Bundle namespace
*/ */
public function getNamespace() public function getNamespace()
{ {
@ -113,9 +109,7 @@ abstract class Bundle implements BundleInterface
} }
/** /**
* Gets the Bundle directory path. * {@inheritdoc}
*
* @return string The Bundle absolute path
*/ */
public function getPath() public function getPath()
{ {
@ -128,18 +122,14 @@ abstract class Bundle implements BundleInterface
} }
/** /**
* Returns the bundle parent name. * {@inheritdoc}
*
* @return string|null The Bundle parent name it overrides or null if no parent
*/ */
public function getParent() public function getParent()
{ {
} }
/** /**
* Returns the bundle name (the class short name). * {@inheritdoc}
*
* @return string The Bundle name
*/ */
final public function getName() final public function getName()
{ {

View File

@ -98,7 +98,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
} }
/** /**
* Boots the current kernel. * {@inheritdoc}
*/ */
public function boot() public function boot()
{ {

View File

@ -353,11 +353,9 @@ class OptionsResolver implements Options
* *
* The normalizer should be a closure with the following signature: * The normalizer should be a closure with the following signature:
* *
* ```php * function (Options $options, $value) {
* function (Options $options, $value) { * // ...
* // ... * }
* }
* ```
* *
* The closure is invoked when {@link resolve()} is called. The closure * The closure is invoked when {@link resolve()} is called. The closure
* has access to the resolved values of other options through the passed * has access to the resolved values of other options through the passed

View File

@ -16,9 +16,9 @@ use Symfony\Component\Process\Exception\RuntimeException;
/** /**
* PhpProcess runs a PHP script in an independent process. * PhpProcess runs a PHP script in an independent process.
* *
* $p = new PhpProcess('<?php echo "foo"; ?>'); * $p = new PhpProcess('<?php echo "foo"; ?>');
* $p->run(); * $p->run();
* print $p->getOutput()."\n"; * print $p->getOutput()."\n";
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */

View File

@ -46,7 +46,7 @@ class RouteCollectionBuilder
/** /**
* Import an external routing resource and returns the RouteCollectionBuilder. * Import an external routing resource and returns the RouteCollectionBuilder.
* *
* $routes->import('blog.yml', '/blog'); * $routes->import('blog.yml', '/blog');
* *
* @param mixed $resource * @param mixed $resource
* @param string|null $prefix * @param string|null $prefix

View File

@ -36,12 +36,10 @@ interface UserInterface
/** /**
* Returns the roles granted to the user. * Returns the roles granted to the user.
* *
* <code> * public function getRoles()
* public function getRoles() * {
* { * return array('ROLE_USER');
* return array('ROLE_USER'); * }
* }
* </code>
* *
* Alternatively, the roles might be stored on a ``roles`` property, * Alternatively, the roles might be stored on a ``roles`` property,
* and populated in any number of different ways when the user object * and populated in any number of different ways when the user object

View File

@ -42,18 +42,18 @@ interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface
* *
* For example, for a form login, you might: * For example, for a form login, you might:
* *
* if ($request->request->has('_username')) { * if ($request->request->has('_username')) {
* return array( * return array(
* 'username' => $request->request->get('_username'), * 'username' => $request->request->get('_username'),
* 'password' => $request->request->get('_password'), * 'password' => $request->request->get('_password'),
* ); * );
* } else { * } else {
* return; * return;
* } * }
* *
* Or for an API token that's on a header, you might use: * Or for an API token that's on a header, you might use:
* *
* return array('api_key' => $request->headers->get('X-API-TOKEN')); * return array('api_key' => $request->headers->get('X-API-TOKEN'));
* *
* @param Request $request * @param Request $request
* *

View File

@ -31,10 +31,14 @@ interface AuthenticationEntryPointInterface
* response that "helps" the user start into the authentication process. * response that "helps" the user start into the authentication process.
* *
* Examples: * Examples:
* A) For a form login, you might redirect to the login page *
* return new RedirectResponse('/login'); * - For a form login, you might redirect to the login page
* B) For an API token authentication system, you return a 401 response *
* return new Response('Auth header required', 401); * return new RedirectResponse('/login');
*
* - For an API token authentication system, you return a 401 response
*
* return new Response('Auth header required', 401);
* *
* @param Request $request The request that resulted in an AuthenticationException * @param Request $request The request that resulted in an AuthenticationException
* @param AuthenticationException $authException The exception that started the authentication process * @param AuthenticationException $authException The exception that started the authentication process

View File

@ -29,9 +29,9 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
* objects are turned into arrays by normalizers. * objects are turned into arrays by normalizers.
* arrays are turned into various output formats by encoders. * arrays are turned into various output formats by encoders.
* *
* $serializer->serialize($obj, 'xml') * $serializer->serialize($obj, 'xml')
* $serializer->decode($data, 'xml') * $serializer->decode($data, 'xml')
* $serializer->denormalize($data, 'Class', 'xml') * $serializer->denormalize($data, 'Class', 'xml')
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @author Johannes M. Schmitt <schmittjoh@gmail.com> * @author Johannes M. Schmitt <schmittjoh@gmail.com>

View File

@ -39,21 +39,20 @@ abstract class AbstractOperation implements OperationInterface
* This array stores 'all', 'new' and 'obsolete' messages for all valid domains. * This array stores 'all', 'new' and 'obsolete' messages for all valid domains.
* *
* The data structure of this array is as follows: * The data structure of this array is as follows:
* ```php *
* array( * array(
* 'domain 1' => array( * 'domain 1' => array(
* 'all' => array(...), * 'all' => array(...),
* 'new' => array(...), * 'new' => array(...),
* 'obsolete' => array(...) * 'obsolete' => array(...)
* ), * ),
* 'domain 2' => array( * 'domain 2' => array(
* 'all' => array(...), * 'all' => array(...),
* 'new' => array(...), * 'new' => array(...),
* 'obsolete' => array(...) * 'obsolete' => array(...)
* ), * ),
* ... * ...
* ) * )
* ```
* *
* @var array The array that stores 'all', 'new' and 'obsolete' messages * @var array The array that stores 'all', 'new' and 'obsolete' messages
*/ */

View File

@ -19,11 +19,9 @@ namespace Symfony\Component\Validator;
* element in the validation graph and the root element that was originally * element in the validation graph and the root element that was originally
* passed to the validator. For example, take the following graph: * passed to the validator. For example, take the following graph:
* *
* <pre> * (Person)---(firstName: string)
* (Person)---(firstName: string) * \
* \ * (address: Address)---(street: string)
* (address: Address)---(street: string)
* </pre>
* *
* If the <tt>Person</tt> object is validated and validation fails for the * If the <tt>Person</tt> object is validated and validation fails for the
* "firstName" property, the generated violation has the <tt>Person</tt> * "firstName" property, the generated violation has the <tt>Person</tt>

View File

@ -42,11 +42,10 @@ class Yaml
/** /**
* Parses a YAML file into a PHP value. * Parses a YAML file into a PHP value.
* *
* Usage: * Usage:
* <code> *
* $array = Yaml::parseFile('config.yml'); * $array = Yaml::parseFile('config.yml');
* print_r($array); * print_r($array);
* </code>
* *
* @param string $filename The path to the YAML file to be parsed * @param string $filename The path to the YAML file to be parsed
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior