Skip to content

Commit 56f0f19

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: Remove useless $request Improve the docs about custom form theme config Use callable classes for custom Monolog processors Update custom_password_authenticator.rst
2 parents 83c1d22 + 278659e commit 56f0f19

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

form/form_themes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ file:
179179
# app/config/config.yml
180180
twig:
181181
form_themes:
182+
- '...'
182183
- 'form/fields.html.twig'
183184
# ...
184185
@@ -194,6 +195,7 @@ file:
194195
http://symfony.com/schema/dic/twig http://symfony.com/schema/dic/twig/twig-1.0.xsd">
195196
196197
<twig:config>
198+
<twig:theme>...</twig:theme>
197199
<twig:theme>form/fields.html.twig</twig:theme>
198200
<!-- ... -->
199201
</twig:config>
@@ -204,11 +206,17 @@ file:
204206
// app/config/config.php
205207
$container->loadFromExtension('twig', array(
206208
'form_themes' => array(
209+
'...',
207210
'form/fields.html.twig',
208211
),
209212
// ...
210213
));
211214
215+
.. note::
216+
217+
Add your custom theme at the end of the ``form_themes`` list because each
218+
theme overrides all the previous themes.
219+
212220
Any blocks inside the ``fields.html.twig`` template are now used globally
213221
to define form output.
214222

logging/processors.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using a processor::
3030
$this->session = $session;
3131
}
3232

33-
public function processRecord(array $record)
33+
public function __invoke(array $record)
3434
{
3535
if (!$this->session->isStarted()) {
3636
return $record;
@@ -63,7 +63,7 @@ information:
6363
AppBundle\Logger\SessionRequestProcessor:
6464
autowire: true
6565
tags:
66-
- { name: monolog.processor, method: processRecord }
66+
- { name: monolog.processor }
6767
6868
.. code-block:: xml
6969
@@ -85,7 +85,7 @@ information:
8585
</service>
8686
8787
<service id="AppBundle\Logger\SessionRequestProcessor" autowire="true">
88-
<tag name="monolog.processor" method="processRecord" />
88+
<tag name="monolog.processor" />
8989
</service>
9090
</services>
9191
</container>
@@ -175,7 +175,7 @@ the ``monolog.processor`` tag:
175175
AppBundle\Logger\SessionRequestProcessor:
176176
autowire: true
177177
tags:
178-
- { name: monolog.processor, method: processRecord, handler: main }
178+
- { name: monolog.processor, handler: main }
179179
180180
.. code-block:: xml
181181
@@ -191,7 +191,7 @@ the ``monolog.processor`` tag:
191191
192192
<services>
193193
<service id="AppBundle\Logger\SessionRequestProcessor" autowire="true">
194-
<tag name="monolog.processor" method="processRecord" handler="main" />
194+
<tag name="monolog.processor" handler="main" />
195195
</service>
196196
</services>
197197
</container>
@@ -203,7 +203,7 @@ the ``monolog.processor`` tag:
203203
// ...
204204
$container
205205
->autowire(SessionRequestProcessor::class)
206-
->addTag('monolog.processor', array('method' => 'processRecord', 'handler' => 'main'));
206+
->addTag('monolog.processor', array('handler' => 'main'));
207207
208208
Registering Processors per Channel
209209
----------------------------------
@@ -220,7 +220,7 @@ the ``monolog.processor`` tag:
220220
AppBundle\Logger\SessionRequestProcessor:
221221
autowire: true
222222
tags:
223-
- { name: monolog.processor, method: processRecord, channel: main }
223+
- { name: monolog.processor, channel: main }
224224
225225
.. code-block:: xml
226226
@@ -236,7 +236,7 @@ the ``monolog.processor`` tag:
236236
237237
<services>
238238
<service id="AppBundle\Logger\SessionRequestProcessor" autowire="true">
239-
<tag name="monolog.processor" method="processRecord" channel="main" />
239+
<tag name="monolog.processor" channel="main" />
240240
</service>
241241
</services>
242242
</container>
@@ -248,4 +248,4 @@ the ``monolog.processor`` tag:
248248
// ...
249249
$container
250250
->autowire(SessionRequestProcessor::class)
251-
->addTag('monolog.processor', array('method' => 'processRecord', 'channel' => 'main'));
251+
->addTag('monolog.processor', array('channel' => 'main'));

security/custom_password_authenticator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ the user::
6363
if ('' === ($givenPassword = $token->getCredentials())) {
6464
throw new BadCredentialsException('The given password cannot be empty.');
6565
}
66-
if (!$this->encoderFactory->getEncoder($user)->isPasswordValid($user->getPassword(), $givenPassword, $user->getSalt())) {
66+
if (!$this->encoder->isPasswordValid($user->getPassword(), $givenPassword, $user->getSalt())) {
6767
throw new BadCredentialsException('The given password is invalid.');
6868
}
6969
}

security/form_login_setup.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,14 @@ configuration (``login``):
9191
// src/AppBundle/Controller/SecurityController.php
9292
9393
// ...
94-
use Symfony\Component\HttpFoundation\Request;
9594
use Symfony\Component\Routing\Annotation\Route;
9695
9796
class SecurityController extends Controller
9897
{
9998
/**
10099
* @Route("/login", name="login")
101100
*/
102-
public function loginAction(Request $request)
101+
public function login()
103102
{
104103
}
105104
}
@@ -143,7 +142,7 @@ Great! Next, add the logic to ``loginAction()`` that displays the login form::
143142
// src/AppBundle/Controller/SecurityController.php
144143
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
145144

146-
public function loginAction(Request $request, AuthenticationUtils $authenticationUtils)
145+
public function login(AuthenticationUtils $authenticationUtils)
147146
{
148147
// get the login error if there is one
149148
$error = $authenticationUtils->getLastAuthenticationError();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy