Skip to content

Commit fc087b8

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: [Security] update Voter return type [DependecyInjection] Added Uses & hints "Creating Pages" not responsive [Cache] Add return hint [Cache] Add use Response & return hint Minor [4.4] fix code sample to log out [Lock] Specify default ttl
2 parents 0a8a47a + 32949b5 commit fc087b8

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

components/lock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ job; if it's too long and the process crashes before calling the ``release()``
152152
method, the resource will stay locked until the timeout::
153153

154154
// ...
155-
// create an expiring lock that lasts 30 seconds
155+
// create an expiring lock that lasts 30 seconds (default is 300.0)
156156
$lock = $factory->createLock('charts-generation', 30);
157157

158158
if (!$lock->acquire()) {

deployment.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ setup:
213213
* Pushing assets to a CDN
214214
* On a shared hosting platform using the Apache web server, you may need to
215215
install the :ref:`symfony/apache-pack package <web-server-apache-mod-php>`
216-
* ...
216+
* etc.
217217

218218
Application Lifecycle: Continuous Integration, QA, etc.
219219
-------------------------------------------------------

http_cache/esi.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ independently of the rest of the page::
106106
// ...
107107
class DefaultController extends AbstractController
108108
{
109-
public function about()
109+
public function about(): Response
110110
{
111111
$response = $this->render('static/about.html.twig');
112112
$response->setPublic();
@@ -172,7 +172,7 @@ of the main page::
172172
// ...
173173
class NewsController extends AbstractController
174174
{
175-
public function latest($maxPerPage)
175+
public function latest(int $maxPerPage): Response
176176
{
177177
// sets to public and adds some expiration
178178
$response->setSharedMaxAge(60);

http_cache/validation.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ content::
5656

5757
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
5858
use Symfony\Component\HttpFoundation\Request;
59+
use Symfony\Component\HttpFoundation\Response;
5960

6061
class DefaultController extends AbstractController
6162
{
62-
public function homepage(Request $request)
63+
public function homepage(Request $request): Response
6364
{
6465
$response = $this->render('static/homepage.html.twig');
6566
$response->setEtag(md5($response->getContent()));
@@ -138,7 +139,7 @@ header value::
138139

139140
class ArticleController extends AbstractController
140141
{
141-
public function show(Article $article, Request $request)
142+
public function show(Article $article, Request $request): Response
142143
{
143144
$author = $article->getAuthor();
144145

@@ -196,7 +197,7 @@ the better. The ``Response::isNotModified()`` method does exactly that::
196197

197198
class ArticleController extends AbstractController
198199
{
199-
public function show($articleSlug, Request $request)
200+
public function show(string $articleSlug, Request $request): Response
200201
{
201202
// Get the minimum information to compute
202203
// the ETag or the Last-Modified value

page_creation.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,13 @@ To get a list of *all* of the routes in your system, use the ``debug:router`` co
184184
185185
You should see your ``app_lucky_number`` route in the list:
186186

187-
================== ======== ======== ====== ===============
188-
Name Method Scheme Host Path
189-
================== ======== ======== ====== ===============
190-
app_lucky_number ANY ANY ANY /lucky/number
191-
================== ======== ======== ====== ===============
187+
.. code-block:: terminal
188+
189+
---------------- ------- ------- ----- --------------
190+
Name Method Scheme Host Path
191+
---------------- ------- ------- ----- --------------
192+
app_lucky_number ANY ANY ANY /lucky/number
193+
---------------- ------- ------- ----- --------------
192194
193195
You will also see debugging routes besides ``app_lucky_number`` -- more on
194196
the debugging routes in the next section.

security/form_login.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ The form login authenticator creates a login form where users authenticate
88
using an identifier (e.g. email address or username) and a password. In
99
:ref:`security-form-login` the usage of this authenticator is explained.
1010

11-
This article describes how to customize the responses (success or failure)
12-
of this authenticator.
13-
1411
Redirecting after Success
1512
-------------------------
1613

security/voters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ which makes creating a voter even easier::
4747

4848
abstract class Voter implements VoterInterface
4949
{
50-
abstract protected function supports(string $attribute, $subject);
51-
abstract protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token);
50+
abstract protected function supports(string $attribute, $subject) bool;
51+
abstract protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool;
5252
}
5353

5454
.. _how-to-use-the-voter-in-a-controller:

service_container.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ you can type-hint the new ``SiteUpdateManager`` class and use it::
374374

375375
class SiteController extends AbstractController
376376
{
377-
public function new(SiteUpdateManager $siteUpdateManager)
377+
public function new(SiteUpdateManager $siteUpdateManager): Response
378378
{
379379
// ...
380380

0 commit comments

Comments
 (0)