Skip to content

Commit d5ac664

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

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

components/console/helpers/questionhelper.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if you want to know a bundle name, you can add this to your command::
8888
8989
// ... do something with the bundleName
9090
91-
return Commande::SUCCESS;
91+
return Command::SUCCESS;
9292
}
9393

9494
The user will be asked "Please enter the name of the bundle". They can type
@@ -124,7 +124,7 @@ from a predefined list::
124124

125125
// ... do something with the color
126126
127-
return Commande::SUCCESS;
127+
return Command::SUCCESS;
128128
}
129129

130130
The option which should be selected by default is provided with the third
@@ -162,7 +162,7 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
162162
$colors = $helper->ask($input, $output, $question);
163163
$output->writeln('You have just selected: ' . implode(', ', $colors));
164164
165-
return Commande::SUCCESS;
165+
return Command::SUCCESS;
166166
}
167167

168168
Now, when the user enters ``1,2``, the result will be:
@@ -193,7 +193,7 @@ will be autocompleted as the user types::
193193
194194
// ... do something with the bundleName
195195
196-
return Commande::SUCCESS;
196+
return Command::SUCCESS;
197197
}
198198

199199
In more complex use cases, it may be necessary to generate suggestions on the
@@ -232,7 +232,7 @@ provide a callback function to dynamically generate suggestions::
232232
233233
// ... do something with the filePath
234234
235-
return Commande::SUCCESS;
235+
return Command::SUCCESS;
236236
}
237237

238238
Do not Trim the Answer
@@ -256,7 +256,7 @@ You can also specify if you want to not trim the answer by setting it directly w
256256
257257
// ... do something with the name
258258
259-
return Commande::SUCCESS;
259+
return Command::SUCCESS;
260260
}
261261

262262
Accept Multiline Answers
@@ -282,7 +282,7 @@ the response to a question should allow multiline answers by passing ``true`` to
282282
283283
// ... do something with the answer
284284
285-
return Commande::SUCCESS;
285+
return Command::SUCCESS;
286286
}
287287

288288
Multiline questions stop reading user input after receiving an end-of-transmission
@@ -310,7 +310,7 @@ convenient for passwords::
310310
311311
// ... do something with the password
312312
313-
return Commande::SUCCESS;
313+
return Command::SUCCESS;
314314
}
315315

316316
.. caution::
@@ -342,7 +342,7 @@ convenient for passwords::
342342

343343
// ...
344344
345-
return Commande::SUCCESS;
345+
return Command::SUCCESS;
346346
}
347347

348348
Normalizing the Answer
@@ -373,7 +373,7 @@ method::
373373
374374
// ... do something with the bundleName
375375
376-
return Commande::SUCCESS;
376+
return Command::SUCCESS;
377377
}
378378

379379
.. caution::
@@ -417,7 +417,7 @@ method::
417417
418418
// ... do something with the bundleName
419419
420-
return Commande::SUCCESS;
420+
return Command::SUCCESS;
421421
}
422422

423423
The ``$validator`` is a callback which handles the validation. It should
@@ -479,7 +479,7 @@ You can also use a validator with a hidden question::
479479
480480
// ... do something with the password
481481
482-
return Commande::SUCCESS;
482+
return Command::SUCCESS;
483483
}
484484

485485
Testing a Command that Expects Input

components/lock.rst

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

146146
// ...
147-
// create an expiring lock that lasts 30 seconds
147+
// create an expiring lock that lasts 30 seconds (default is 300.0)
148148
$lock = $factory->createLock('charts-generation', 30);
149149

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

deployment.rst

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

232232
Application Lifecycle: Continuous Integration, QA, etc.
233233
-------------------------------------------------------

http_cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ The *easiest* way to cache a response is by caching it for a specific amount of
215215
use Symfony\Component\HttpFoundation\Response;
216216
// ...
217217

218-
public function index()
218+
public function index(): Response
219219
{
220220
// somehow create a Response object, like by rendering a template
221221
$response = $this->render('blog/index.html.twig', []);

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
@@ -166,11 +166,13 @@ To get a list of *all* of the routes in your system, use the ``debug:router`` co
166166
167167
You should see your ``app_lucky_number`` route in the list:
168168

169-
================== ======== ======== ====== ===============
170-
Name Method Scheme Host Path
171-
================== ======== ======== ====== ===============
172-
app_lucky_number ANY ANY ANY /lucky/number
173-
================== ======== ======== ====== ===============
169+
.. code-block:: terminal
170+
171+
---------------- ------- ------- ----- --------------
172+
Name Method Scheme Host Path
173+
---------------- ------- ------- ----- --------------
174+
app_lucky_number ANY ANY ANY /lucky/number
175+
---------------- ------- ------- ----- --------------
174176
175177
You will also see debugging routes besides ``app_lucky_number`` -- more on
176178
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, mixed $subject);
51-
abstract protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token);
50+
abstract protected function supports(string $attribute, mixed $subject): bool;
51+
abstract protected function voteOnAttribute(string $attribute, mixed $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
@@ -368,7 +368,7 @@ you can type-hint the new ``SiteUpdateManager`` class and use it::
368368

369369
class SiteController extends AbstractController
370370
{
371-
public function new(SiteUpdateManager $siteUpdateManager)
371+
public function new(SiteUpdateManager $siteUpdateManager): Response
372372
{
373373
// ...
374374

0 commit comments

Comments
 (0)