Skip to content

Commit 82723f1

Browse files
masaharu-suizujaviereguiluz
authored andcommitted
[Console] Update monolog_console.rst
1 parent 85268b4 commit 82723f1

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

logging/monolog_console.rst

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The example above could then be rewritten as::
4646

4747
public function __construct(LoggerInterface $logger)
4848
{
49+
parent::__construct();
4950
$this->logger = $logger;
5051
}
5152

reference/constraints/UniqueEntity.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ Consider this example:
211211
* @ORM\Entity
212212
* @UniqueEntity(
213213
* fields={"host", "port"},
214-
* errorPath="port",
215-
* message="This port is already in use on that host."
214+
* message="This port is already in use on that host.",
215+
* errorPath="port"
216216
* )
217217
*/
218218
class Service
@@ -240,8 +240,8 @@ Consider this example:
240240
#[ORM\Entity]
241241
#[UniqueEntity(
242242
fields: ['host', 'port'],
243-
errorPath: 'port',
244243
message: 'This port is already in use on that host.',
244+
errorPath: 'port',
245245
)]
246246
class Service
247247
{
@@ -259,8 +259,8 @@ Consider this example:
259259
constraints:
260260
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
261261
fields: [host, port]
262-
errorPath: port
263262
message: 'This port is already in use on that host.'
263+
errorPath: port
264264
265265
.. code-block:: xml
266266
@@ -276,8 +276,8 @@ Consider this example:
276276
<value>host</value>
277277
<value>port</value>
278278
</option>
279-
<option name="errorPath">port</option>
280279
<option name="message">This port is already in use on that host.</option>
280+
<option name="errorPath">port</option>
281281
</constraint>
282282
</class>
283283
@@ -300,8 +300,8 @@ Consider this example:
300300
{
301301
$metadata->addConstraint(new UniqueEntity([
302302
'fields' => ['host', 'port'],
303-
'errorPath' => 'port',
304303
'message' => 'This port is already in use on that host.',
304+
'errorPath' => 'port',
305305
]));
306306
}
307307
}

reference/twig_reference.rst

+12-3
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,18 @@ humanize
391391
``text``
392392
**type**: ``string``
393393

394-
Makes a technical name human readable (i.e. replaces underscores by spaces
395-
or transforms camelCase text like ``helloWorld`` to ``hello world``
396-
and then capitalizes the string).
394+
Transforms the given string into a human readable string (by replacing underscores
395+
with spaces, capitalizing the string, etc.) It's useful e.g. when displaying
396+
the names of PHP properties/variables to end users:
397+
398+
.. code-block:: twig
399+
400+
{{ 'dateOfBirth'|humanize }} {# renders: Date of birth #}
401+
{{ 'DateOfBirth'|humanize }} {# renders: Date of birth #}
402+
{{ 'date-of-birth'|humanize }} {# renders: Date-of-birth #}
403+
{{ 'date_of_birth'|humanize }} {# renders: Date of birth #}
404+
{{ 'date of birth'|humanize }} {# renders: Date of birth #}
405+
{{ 'Date Of Birth'|humanize }} {# renders: Date of birth #}
397406
398407
.. _reference-twig-filter-trans:
399408

0 commit comments

Comments
 (0)