Skip to content

Commit a5aca2a

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: import function env to avoid fatal error if copying docs Use DOCtor-RST 1.37.0 [Lock] Complete Lock example for less ambiguity
2 parents 4f2909e + a96fa9b commit a5aca2a

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
key: ${{ runner.os }}-doctor-rst-${{ steps.extract_base_branch.outputs.branch }}
7474

7575
- name: "Run DOCtor-RST"
76-
uses: docker://oskarstark/doctor-rst:1.35.1
76+
uses: docker://oskarstark/doctor-rst:1.37.0
7777
with:
7878
args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache
7979

components/lock.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,42 @@ Serializing Locks
7575
The :class:`Symfony\\Component\\Lock\\Key` contains the state of the
7676
:class:`Symfony\\Component\\Lock\\Lock` and can be serialized. This
7777
allows the user to begin a long job in a process by acquiring the lock, and
78-
continue the job in another process using the same lock::
78+
continue the job in another process using the same lock.
7979

80+
First, you may create a serializable class containing the resource and the
81+
key of the lock::
82+
83+
// src/Lock/RefreshTaxonomy.php
84+
namespace App\Lock;
85+
86+
use Symfony\Component\Lock\Key;
87+
88+
class RefreshTaxonomy
89+
{
90+
private object $article;
91+
private Key $key;
92+
93+
public function __construct(object $article, Key $key)
94+
{
95+
$this->article = $article;
96+
$this->key = $key;
97+
}
98+
99+
public function getArticle(): object
100+
{
101+
return $this->article;
102+
}
103+
104+
public function getKey(): Key
105+
{
106+
return $this->key;
107+
}
108+
}
109+
110+
Then, you can use this class to dispatch all that's needed for another process
111+
to handle the rest of the job::
112+
113+
use App\Lock\RefreshTaxonomy;
80114
use Symfony\Component\Lock\Key;
81115
use Symfony\Component\Lock\Lock;
82116

mailer.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ over SMTP by configuring the DSN in your ``.env`` file (the ``user``,
5454
.. code-block:: php
5555
5656
// config/packages/mailer.php
57+
use function Symfony\Component\DependencyInjection\Loader\Configurator\env;
5758
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
5859
5960
return static function (ContainerConfigurator $containerConfigurator): void {
@@ -1179,6 +1180,7 @@ This can be configured by replacing the ``dsn`` configuration entry with a
11791180
.. code-block:: php
11801181
11811182
// config/packages/mailer.php
1183+
use function Symfony\Component\DependencyInjection\Loader\Configurator\env;
11821184
use Symfony\Config\FrameworkConfig;
11831185
11841186
return static function (FrameworkConfig $framework) {

0 commit comments

Comments
 (0)