Skip to content

Commit 273581b

Browse files
committed
minor #19776 fixed argument order for UniqueEntity (Robin Weller)
This PR was merged into the 5.4 branch. Discussion ---------- fixed argument order for UniqueEntity | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | none <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT Updated parameter order to match order in the constructor to prevent showing a IDE warning. <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- c7c5959 fixed argument order for UniqueEntity
2 parents 85268b4 + c7c5959 commit 273581b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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
}

0 commit comments

Comments
 (0)