Skip to content

Commit f72237d

Browse files
committed
Merge branch '2.8' into 3.3
* 2.8: (21 commits) Update resources.rst Update events.rst Improved a help note about authentication providers [#8280] add missing trailing comma [#8282] fix regex delimiters Add missing comment validateValue() is deprecated in 3.0 prefer getObject as getEntity is deprecated Update serializer.rst [#8308] fix commands order Update NotIdenticalTo.rst Correct psr/log package name Update debugging.rst Update group_service_resolver.rst Update remember_me.rst Update expression_language.rst [VarDumper] s/dump.dump_destination/debug.dump_destination/ fix schema_filter example fix form collection label not correct Improved the explanation about the doctrine caching services ...
2 parents c08f2a2 + 3a41ea8 commit f72237d

File tree

17 files changed

+68
-31
lines changed

17 files changed

+68
-31
lines changed

components/console/logger.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The Console component comes with a standalone logger complying with the
99
be sent to the :class:`Symfony\\Component\\Console\\Output\\OutputInterface`
1010
instance passed as a parameter to the constructor.
1111

12-
The logger does not have any external dependency except ``php-fig/log``.
12+
The logger does not have any external dependency except ``psr/log``.
1313
This is useful for console applications and commands needing a lightweight
1414
PSR-3 compliant logger::
1515

components/serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ class extending :class:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNorm
405405
including :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`
406406
and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`::
407407

408-
use Symfony\Component\Serializer\Encoder\JsonEncoder
408+
use Symfony\Component\Serializer\Encoder\JsonEncoder;
409409
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
410410
use Symfony\Component\Serializer\Serializer;
411411

components/validator/resources.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ Using a Custom MetadataFactory
173173
------------------------------
174174

175175
All the loaders and the cache are passed to an instance of
176-
:class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadataFactory`. This
177-
class is responsible for creating a ``ClassMetadata`` instance from all the
176+
:class:`Symfony\\Component\\Validator\\Mapping\\Factory\\LazyLoadingMetadataFactory`.
177+
This class is responsible for creating a ``ClassMetadata`` instance from all the
178178
configured resources.
179179

180180
You can also use a custom metadata factory implementation by creating a class
181181
which implements
182-
:class:`Symfony\\Component\\Validator\\MetadataFactoryInterface`. You can set
183-
this custom implementation using
182+
:class:`Symfony\\Component\\Validator\\Mapping\\Factory\\MetadataFactoryInterface`.
183+
You can set this custom implementation using
184184
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::setMetadataFactory`::
185185

186186
use Acme\Validation\CustomMetadataFactory;

components/var_dumper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Choosing between both is mostly a matter of personal taste, still:
101101
be suited to your use case (e.g. you shouldn't use it in an HTML
102102
attribute or a ``<script>`` tag).
103103

104-
This behavior can be changed by configuring the ``dump.dump_destination``
104+
This behavior can be changed by configuring the ``debug.dump_destination``
105105
option. Read more about this and other options in
106106
:doc:`the DebugBundle configuration reference </reference/configuration/debug>`.
107107

debug/debugging.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ that can help you visualize and find the information.
7575
``debug:config``
7676
Shows all configured bundles, their class and their alias.
7777

78+
``debug:event-dispatcher``
79+
Displays information about all the registered listeners in the event dispatcher.
80+
7881
``debug:router``
7982
Displays information about all configured routes in the application as a
8083
table with the name, method, scheme, host and path for each route.

doctrine/event_listeners_subscribers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ interface and have an event method for each event it subscribes to::
165165

166166
public function index(LifecycleEventArgs $args)
167167
{
168-
$entity = $args->getEntity();
168+
$entity = $args->getObject();
169169

170170
// perhaps you only want to act on some "Product" entity
171171
if ($entity instanceof Product) {

form/events.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ View data ``null``
8484

8585
.. sidebar:: ``FormEvents::PRE_SET_DATA`` in the Form component
8686

87-
The ``collection`` form type relies on the
88-
``Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener``
87+
The ``Symfony\Component\Form\Extension\Core\Type\CollectionType`` form type relies
88+
on the ``Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener``
8989
subscriber, listening to the ``FormEvents::PRE_SET_DATA`` event in order
9090
to reorder the form's fields depending on the data from the pre-populated
9191
object, by removing and adding all form rows.

form/form_collections.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ Notice that you embed a collection of ``TagType`` forms using the
130130
$builder->add('description');
131131

132132
$builder->add('tags', CollectionType::class, array(
133-
'entry_type' => TagType::class
133+
'entry_type' => TagType::class,
134+
'entry_options' => array('label' => false),
134135
));
135136
}
136137

@@ -285,8 +286,9 @@ add the ``allow_add`` option to your collection field::
285286
$builder->add('description');
286287

287288
$builder->add('tags', CollectionType::class, array(
288-
'entry_type' => TagType::class,
289-
'allow_add' => true,
289+
'entry_type' => TagType::class,
290+
'entry_options' => array('label' => false),
291+
'allow_add' => true,
290292
));
291293
}
292294

@@ -392,9 +394,15 @@ one example:
392394
// get the new index
393395
var index = $collectionHolder.data('index');
394396
397+
var newForm = prototype;
398+
// You need this only if you didn't set 'label' => false in your tags field in TaskType
399+
// Replace '__name__label__' in the prototype's HTML to
400+
// instead be a number based on how many items we have
401+
// newForm = newForm.replace(/__name__label__/g, index);
402+
395403
// Replace '__name__' in the prototype's HTML to
396404
// instead be a number based on how many items we have
397-
var newForm = prototype.replace(/__name__/g, index);
405+
newForm = newForm.replace(/__name__/g, index);
398406
399407
// increase the index with one for the next item
400408
$collectionHolder.data('index', index + 1);

forms.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ the choice is ultimately up to you.
639639
good idea to explicitly specify the ``data_class`` option by adding the
640640
following to your form type class::
641641

642+
// src/AppBundle/Form/TaskType.php
642643
use AppBundle\Entity\Task;
643644
use Symfony\Component\OptionsResolver\OptionsResolver;
644645

reference/configuration/doctrine.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Full Default Configuration
2424
commented: true
2525
# If defined, all the tables whose names match this regular expression are ignored
2626
# by the schema tool (in this example, any table name starting with `wp_`)
27-
#schema_filter: "/^wp_/"
27+
#schema_filter: '/^(?!wp_)/'
2828
2929
connections:
3030
# A collection of different named connections (e.g. default, conn2, etc)
@@ -299,9 +299,10 @@ certain classes, but those are for very advanced use-cases only.
299299
Caching Drivers
300300
~~~~~~~~~~~~~~~
301301

302-
For the caching drivers you can specify the values ``array``, ``apc``, ``apcu``,
303-
``memcache``, ``memcached``, ``redis``, ``wincache``, ``zenddata``, ``xcache``
304-
or ``service``.
302+
The built-in types of caching drivers are: ``array``, ``apc``, ``apcu``,
303+
``memcache``, ``memcached``, ``redis``, ``wincache``, ``zenddata`` and ``xcache``.
304+
There is a special type called ``service`` which lets you define the ID of your
305+
own caching service.
305306

306307
The following example shows an overview of the caching configurations:
307308

@@ -310,15 +311,17 @@ The following example shows an overview of the caching configurations:
310311
doctrine:
311312
orm:
312313
auto_mapping: true
314+
# each caching driver type defines its own config options
313315
metadata_cache_driver: apc
314-
query_cache_driver:
315-
type: service
316-
id: my_doctrine_common_cache_service
317316
result_cache_driver:
318317
type: memcache
319318
host: localhost
320319
port: 11211
321320
instance_class: Memcache
321+
# the 'service' type requires to define the 'id' option too
322+
query_cache_driver:
323+
type: service
324+
id: my_doctrine_common_cache_service
322325
323326
Mapping Configuration
324327
~~~~~~~~~~~~~~~~~~~~~

reference/constraints/NotIdenticalTo.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ message
118118

119119
**type**: ``string`` **default**: ``This value should not be identical to {{ compared_value_type }} {{ compared_value }}.``
120120

121-
This is the message that will be shown if the value is not equal.
121+
This is the message that will be shown if the value is identical.
122122

123123
.. include:: /reference/constraints/_payload-option.rst.inc

routing/scheme.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ the URI scheme via schemes:
1010

1111
.. configuration-block::
1212

13+
.. code-block:: php-annotations
14+
15+
// src/AppBundle/Controller/MainController.php
16+
namespace AppBundle\Controller;
17+
18+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
19+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
20+
21+
class MainController extends Controller
22+
{
23+
/**
24+
* @Route("/secure", name="secure", schemes={"https"})
25+
*/
26+
public function secureAction()
27+
{
28+
// ...
29+
}
30+
}
31+
1332
.. code-block:: yaml
1433
1534
# app/config/routing.yml

security/api_key_authentication.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,11 @@ method, if any.
119119

120120
.. caution::
121121

122-
In case you return ``null`` from your ``createToken()`` method, be sure to enable
123-
``anonymous`` in you firewall. This way you'll be able to get an ``AnonymousToken``.
122+
In case you return ``null`` from your ``createToken()`` method, Symfony
123+
passes this request to the next authentication provider. If you haven't
124+
configured any other provider, enable the ``anonymous`` option in your
125+
firewall. This way Symfony executes the anonymous authentication provider
126+
and you'll get an ``AnonymousToken``.
124127

125128
2. supportsToken
126129
~~~~~~~~~~~~~~~~

security/remember_me.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ In the following example, the action is only allowed if the user has the
241241
.. code-block:: php
242242
243243
// ...
244-
use Symfony\Component\Security\Core\Exception\AccessDeniedException
244+
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
245245
246246
// ...
247247
public function editAction()

service_container/expression_language.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ to another service: ``AppBundle\Mailer``. One way to do this is with an expressi
2121

2222
.. code-block:: yaml
2323
24-
# app/config/config.yml
24+
# app/config/services.yml
2525
services:
2626
# ...
2727
@@ -32,7 +32,7 @@ to another service: ``AppBundle\Mailer``. One way to do this is with an expressi
3232
3333
.. code-block:: xml
3434
35-
<!-- app/config/config.xml -->
35+
<!-- app/config/services.xml -->
3636
<?xml version="1.0" encoding="UTF-8" ?>
3737
<container xmlns="http://symfony.com/schema/dic/services"
3838
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -52,12 +52,12 @@ to another service: ``AppBundle\Mailer``. One way to do this is with an expressi
5252
5353
.. code-block:: php
5454
55-
// app/config/config.php
55+
// app/config/services.php
5656
use AppBundle\Mail\MailerConfiguration;
5757
use AppBundle\Mailer;
5858
use Symfony\Component\ExpressionLanguage\Expression;
5959
60-
$container->autowire(AppBundle\Mail\MailerConfiguration::class);
60+
$container->autowire(MailerConfiguration::class);
6161
6262
$container->autowire(Mailer::class)
6363
->addArgument(new Expression('service("AppBundle\Mail\MailerConfiguration").getMailerMethod()'));

validation/group_service_resolver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Then in your form, inject the resolver and set it as the ``validation_groups``.
4747
namespace AppBundle\Form;
4848
4949
use AppBundle\Validator\ValidationGroupResolver;
50-
use Symfony\Component\Form\AbstractType
50+
use Symfony\Component\Form\AbstractType;
5151
use Symfony\Component\OptionsResolver\OptionsResolver;
5252
5353
class MyClassType extends AbstractType

validation/raw_values.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Validation of arrays is possible using the ``Collection`` constraint::
6464
'password' => new Assert\Length(array('min' => 60)),
6565
));
6666

67-
$violations = $validator->validateValue($input, $constraint);
67+
$violations = $validator->validate($input, $constraint);
6868

6969
The ``validate()`` method returns a :class:`Symfony\\Component\\Validator\\ConstraintViolationList`
7070
object, which acts just like an array of errors. Each error in the collection

0 commit comments

Comments
 (0)