Skip to content

Commit 89f4e50

Browse files
committed
Merge remote-tracking branch 'upstream/7.0' into 7.0
* upstream/7.0: Added missing backtick character remove versionadded directives for Symfony 6 - Add attribute configuration block for reusable locator Reorder imports in code examples [Form] Fix an RST reference
2 parents 39ce759 + 41612f7 commit 89f4e50

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

form/events.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ A) The ``FormEvents::PRE_SET_DATA`` Event
6262
The ``FormEvents::PRE_SET_DATA`` event is dispatched at the beginning of the
6363
``Form::setData()`` method. It is used to modify the data given during
6464
pre-population with
65-
:method:`PreSetData::setData() <Symfony\\Component\\Form\\Event\\PreSetDataEvent>`.
6665
The method :method:`Form::setData() <Symfony\\Component\\Form\\Form::setData>`
6766
is locked since the event is dispatched from it and will throw an exception
6867
if called from a listener.
@@ -274,10 +273,10 @@ method of the ``FormFactory``::
274273

275274
// ...
276275

276+
use Symfony\Component\Form\Event\PreSubmitEvent;
277277
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
278278
use Symfony\Component\Form\Extension\Core\Type\EmailType;
279279
use Symfony\Component\Form\Extension\Core\Type\TextType;
280-
use Symfony\Component\Form\Event\PreSubmitEvent;
281280
use Symfony\Component\Form\FormEvents;
282281

283282
$form = $formFactory->createBuilder()
@@ -311,9 +310,9 @@ callback for better readability::
311310
// src/Form/SubscriptionType.php
312311
namespace App\Form;
313312

313+
use Symfony\Component\Form\Event\PreSetDataEvent;
314314
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
315315
use Symfony\Component\Form\Extension\Core\Type\TextType;
316-
use Symfony\Component\Form\Event\PreSetDataEvent;
317316
use Symfony\Component\Form\FormEvents;
318317

319318
// ...
@@ -352,9 +351,9 @@ Consider the following example of a form event subscriber::
352351
namespace App\Form\EventListener;
353352

354353
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
355-
use Symfony\Component\Form\Extension\Core\Type\EmailType;
356354
use Symfony\Component\Form\Event\PreSetDataEvent;
357355
use Symfony\Component\Form\Event\PreSubmitEvent;
356+
use Symfony\Component\Form\Extension\Core\Type\EmailType;
358357
use Symfony\Component\Form\FormEvents;
359358

360359
class AddEmailFieldListener implements EventSubscriberInterface

frontend/asset_mapper.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,6 @@ from inside ``app.js``:
379379
Handling CSS
380380
------------
381381

382-
.. versionadded:: 6.4
383-
384-
The ability to import CSS files was introduced in Symfony 6.4.
385-
386382
CSS can be added to your page by importing it from a JavaScript file. The default
387383
``assets/app.js`` already imports ``assets/styles/app.css``:
388384

@@ -639,10 +635,6 @@ validate the performance of your site!
639635
Performance: Understanding Preloading
640636
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
641637

642-
.. versionadded:: 6.4
643-
644-
Automatic preloading of JavaScript files was introduced in Symfony 6.4.
645-
646638
One issue that LightHouse may report is:
647639

648640
Avoid Chaining Critical Requests

logging/processors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ using a processor::
3131
) {
3232
}
3333

34-
// this method is called for each log record; optimize it to not hurt performance
34+
// method is called for each log record; optimize it to not hurt performance
3535
public function __invoke(LogRecord $record): LogRecord
3636
{
3737
try {

service_container/service_subscribers_locators.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,23 @@ Now you can inject the service locator in any other services:
554554

555555
.. configuration-block::
556556

557+
.. code-block:: php-attributes
558+
559+
// src/CommandBus.php
560+
namespace App;
561+
562+
use Psr\Container\ContainerInterface;
563+
use Symfony\Component\DependencyInjection\Attribute\Autowire;
564+
565+
class CommandBus
566+
{
567+
public function __construct(
568+
#[Autowire(service: 'app.command_handler_locator')]
569+
private ContainerInterface $locator,
570+
) {
571+
}
572+
}
573+
557574
.. code-block:: yaml
558575
559576
# config/services.yaml

service_container/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ method::
214214
}
215215

216216
You can also make attributes usable on methods. To do so, update the previous
217-
example and add ``Attribute::TARGET_METHOD`::
217+
example and add ``Attribute::TARGET_METHOD``::
218218

219219
// src/Attribute/SensitiveElement.php
220220
namespace App\Attribute;

0 commit comments

Comments
 (0)