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 8555c21

Browse filesBrowse files
committed
Add type declarations
1 parent 9cac766 commit 8555c21
Copy full SHA for 8555c21

File tree

1 file changed

+4
-9
lines changed
Filter options
  • src/Symfony/Component/Validator/Constraints

1 file changed

+4
-9
lines changed

‎src/Symfony/Component/Validator/Constraints/Unique.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Unique.php
+4-9Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Unique extends Constraint
2525
{
2626
public const IS_NOT_UNIQUE = '7911c98d-b845-4da0-94b7-a8dac36bc55a';
2727

28-
public $fields = [];
28+
public array|string $fields = [];
2929

3030
protected static $errorNames = [
3131
self::IS_NOT_UNIQUE => 'IS_NOT_UNIQUE',
@@ -34,13 +34,8 @@ class Unique extends Constraint
3434
public $message = 'This collection should contain only unique elements.';
3535
public $normalizer;
3636

37-
/**
38-
* {@inheritdoc}
39-
*
40-
* @param array|string $fields the combination of fields that must contain unique values or a set of options
41-
*/
4237
public function __construct(
43-
$fields = null,
38+
array|string $fields = null,
4439
array $options = [],
4540
string $message = null,
4641
callable $normalizer = null,
@@ -63,12 +58,12 @@ public function __construct(
6358
}
6459
}
6560

66-
public function getOptions()
61+
public function getOptions(): array
6762
{
6863
return ['fields'];
6964
}
7065

71-
public function getDefaultOption()
66+
public function getDefaultOption(): string
7267
{
7368
return 'fields';
7469
}

0 commit comments

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