Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 224138e

Browse filesBrowse files
committed
Merge branch '3.4' into 4.0
* 3.4: Remove useless $request Improve the docs about custom form theme config Use callable classes for custom Monolog processors Mentioned the audit_trail workflow option Update custom_password_authenticator.rst Remove example of register a service where its id match to its class
2 parents 680d415 + 56f0f19 commit 224138e
Copy full SHA for 224138e

File tree

Expand file treeCollapse file tree

6 files changed

+28
-17
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+28
-17
lines changed

‎form/form_themes.rst

Copy file name to clipboardExpand all lines: form/form_themes.rst
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ file:
179179
# config/packages/twig.yaml
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
// config/packages/twig.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

Copy file name to clipboardExpand all lines: logging/processors.rst
+9-9Lines 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;
@@ -62,7 +62,7 @@ information:
6262
6363
App\Logger\SessionRequestProcessor:
6464
tags:
65-
- { name: monolog.processor, method: processRecord }
65+
- { name: monolog.processor }
6666
6767
.. code-block:: xml
6868
@@ -84,7 +84,7 @@ information:
8484
</service>
8585
8686
<service id="App\Logger\SessionRequestProcessor">
87-
<tag name="monolog.processor" method="processRecord" />
87+
<tag name="monolog.processor" />
8888
</service>
8989
</services>
9090
</container>
@@ -173,7 +173,7 @@ the ``monolog.processor`` tag:
173173
services:
174174
App\Logger\SessionRequestProcessor:
175175
tags:
176-
- { name: monolog.processor, method: processRecord, handler: main }
176+
- { name: monolog.processor, handler: main }
177177
178178
.. code-block:: xml
179179
@@ -189,7 +189,7 @@ the ``monolog.processor`` tag:
189189
190190
<services>
191191
<service id="App\Logger\SessionRequestProcessor">
192-
<tag name="monolog.processor" method="processRecord" handler="main" />
192+
<tag name="monolog.processor" handler="main" />
193193
</service>
194194
</services>
195195
</container>
@@ -201,7 +201,7 @@ the ``monolog.processor`` tag:
201201
// ...
202202
$container
203203
->register(SessionRequestProcessor::class)
204-
->addTag('monolog.processor', array('method' => 'processRecord', 'handler' => 'main'));
204+
->addTag('monolog.processor', array('handler' => 'main'));
205205
206206
Registering Processors per Channel
207207
----------------------------------
@@ -217,7 +217,7 @@ the ``monolog.processor`` tag:
217217
services:
218218
App\Logger\SessionRequestProcessor:
219219
tags:
220-
- { name: monolog.processor, method: processRecord, channel: main }
220+
- { name: monolog.processor, channel: main }
221221
222222
.. code-block:: xml
223223
@@ -233,7 +233,7 @@ the ``monolog.processor`` tag:
233233
234234
<services>
235235
<service id="App\Logger\SessionRequestProcessor">
236-
<tag name="monolog.processor" method="processRecord" channel="main" />
236+
<tag name="monolog.processor" channel="main" />
237237
</service>
238238
</services>
239239
</container>
@@ -245,4 +245,4 @@ the ``monolog.processor`` tag:
245245
// ...
246246
$container
247247
->register(SessionRequestProcessor::class)
248-
->addTag('monolog.processor', array('method' => 'processRecord', 'channel' => 'main'));
248+
->addTag('monolog.processor', array('channel' => 'main'));

‎security/custom_password_authenticator.rst

Copy file name to clipboardExpand all lines: security/custom_password_authenticator.rst
+1-1Lines 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

Copy file name to clipboardExpand all lines: security/form_login_setup.rst
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,14 @@ configuration (``login``):
9191
// src/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 login(Request $request)
101+
public function login()
103102
{
104103
}
105104
}
@@ -144,7 +143,7 @@ Great! Next, add the logic to ``login()`` that displays the login form::
144143
// src/Controller/SecurityController.php
145144
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
146145

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

‎service_container/definitions.rst

Copy file name to clipboardExpand all lines: service_container/definitions.rst
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ There are some helpful methods for working with the service definitions::
3838
// shortcut for the previous method
3939
$container->register('app.number_generator', \App\NumberGenerator::class);
4040

41-
// or create a service whose id matches its class
42-
$container->register(\App\NumberGenerator::class);
43-
4441
Working with a Definition
4542
-------------------------
4643

‎workflow/usage.rst

Copy file name to clipboardExpand all lines: workflow/usage.rst
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ like this:
4040
workflows:
4141
blog_publishing:
4242
type: 'workflow' # or 'state_machine'
43+
audit_trail: 'enabled'
4344
marking_store:
4445
type: 'multiple_state' # or 'single_state'
4546
arguments:
@@ -75,7 +76,7 @@ like this:
7576
>
7677
7778
<framework:config>
78-
<framework:workflow name="blog_publishing" type="workflow">
79+
<framework:workflow name="blog_publishing" type="workflow" audit_trail="enabled">
7980
<framework:marking-store type="single_state">
8081
<framework:argument>currentPlace</framework:argument>
8182
</framework:marking-store>
@@ -119,6 +120,7 @@ like this:
119120
'workflows' => array(
120121
'blog_publishing' => array(
121122
'type' => 'workflow', // or 'state_machine'
123+
'audit_trail' => 'enabled',
122124
'marking_store' => array(
123125
'type' => 'multiple_state', // or 'single_state'
124126
'arguments' => array('currentPlace')
@@ -170,6 +172,11 @@ like this:
170172
value ``marking``) attributes of the ``marking_store`` option are optional.
171173
If omitted, their default values will be used.
172174

175+
.. tip::
176+
177+
Setting the ``audit_trail`` option to ``enabled`` makes the application
178+
generate detailed log messages for the workflow activity.
179+
173180
Using a Workflow
174181
----------------
175182

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.