Skip to content

Commit d23e5ee

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: Minor code refactor Update Form Page Update Configuring Symfony page Added namespace for example Added a detail for getCrawler return. [Cache] Fixed some method names Fix EvolvableLink attribute
2 parents e58bc3a + 7096d54 commit d23e5ee

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

components/cache/cache_pools.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ and deleting cache items using only two methods and a callback::
6565

6666
Out of the box, using this interface provides stampede protection via locking
6767
and early expiration. Early expiration can be controlled via the third "beta"
68-
argument of the :method:`Symfony\\Contracts\\Cache\\CacheInterface::get()` method.
68+
argument of the :method:`Symfony\\Contracts\\Cache\\CacheInterface::get` method.
6969
See the :doc:`/components/cache` article for more information.
7070

7171
Early expiration can be detected inside the callback by calling the
72-
:method:`Symfony\\Contracts\\Cache\\ItemInterface::isHit()` method: if this
72+
:method:`Symfony\\Contracts\\Cache\\ItemInterface::isHit` method: if this
7373
returns ``true``, it means we are currently recomputing a value ahead of its
7474
expiration date.
7575

configuration.rst

+2
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@ parameters at once by type-hinting any of its constructor arguments with the
796796
:class:`Symfony\\Component\\DependencyInjection\\ParameterBag\\ContainerBagInterface`::
797797

798798
// src/Service/MessageGenerator.php
799+
namespace App\Service;
800+
799801
// ...
800802

801803
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;

forms.rst

+12
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ use the ``createForm()`` helper (otherwise, use the ``create()`` method of the
199199
``form.factory`` service)::
200200

201201
// src/Controller/TaskController.php
202+
namespace App\Controller;
203+
202204
use App\Form\Type\TaskType;
203205
// ...
204206

@@ -229,6 +231,8 @@ So, while not always necessary, it's generally a good idea to explicitly specify
229231
the ``data_class`` option by adding the following to your form type class::
230232

231233
// src/Form/Type/TaskType.php
234+
namespace App\Form\Type;
235+
232236
use App\Entity\Task;
233237
use Symfony\Component\OptionsResolver\OptionsResolver;
234238
// ...
@@ -519,6 +523,8 @@ object.
519523
.. code-block:: php
520524
521525
// src/Entity/Task.php
526+
namespace App\Entity;
527+
522528
use Symfony\Component\Validator\Constraints\NotBlank;
523529
use Symfony\Component\Validator\Constraints\Type;
524530
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -555,6 +561,8 @@ the form in the controller you can pass custom options to it as the third option
555561
argument of ``createForm()``::
556562

557563
// src/Controller/TaskController.php
564+
namespace App\Controller;
565+
558566
use App\Form\Type\TaskType;
559567
// ...
560568

@@ -579,6 +587,8 @@ If you try to use the form now, you'll see an error message: *The option
579587
options they accept using the ``configureOptions()`` method::
580588

581589
// src/Form/Type/TaskType.php
590+
namespace App\Form\Type;
591+
582592
use Symfony\Component\OptionsResolver\OptionsResolver;
583593
// ...
584594

@@ -758,6 +768,8 @@ If you want to modify this, use the :method:`Symfony\\Component\\Form\\FormFacto
758768
method::
759769

760770
// src/Controller/TaskController.php
771+
namespace App\Controller;
772+
761773
use App\Form\TaskType;
762774
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
763775

templates.rst

+3
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ Consider the following routing configuration:
188188
.. code-block:: php-annotations
189189
190190
// src/Controller/BlogController.php
191+
namespace App\Controller;
191192
192193
// ...
193194
use Symfony\Component\Routing\Annotation\Route;
@@ -421,6 +422,8 @@ you only need to add an argument in the service constructor and type-hint it wit
421422
the :class:`Twig\\Environment` class::
422423

423424
// src/Service/SomeService.php
425+
namespace App\Service;
426+
424427
use Twig\Environment;
425428

426429
class SomeService

testing.rst

+1
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ You can also get the objects related to the latest request::
535535
// the BrowserKit response instance
536536
$response = $client->getInternalResponse();
537537

538+
// the Crawler instance
538539
$crawler = $client->getCrawler();
539540

540541
Accessing the Container

web_link.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ You can also add links to the HTTP response directly from controllers and servic
170170

171171
// alternative if you don't want to use the addLink() shortcut
172172
$linkProvider = $request->attributes->get('_links', new GenericLinkProvider());
173-
$request->attributes->set('_links', $linkProvider->withLink(new Link('preload', '/app.css', ['as' : 'style'])));
173+
$request->attributes->set('_links', $linkProvider->withLink(
174+
(new Link('preload', '/app.css'))->withAttribute('as', 'style')
175+
));
174176

175177
return $this->render('...');
176178
}

0 commit comments

Comments
 (0)