Skip to content

Commit 391567a

Browse files
Fix Symfony 6.1 deprecation notice on $errorNames array
See symfony/symfony#45371 BC Layer kept.
1 parent 4633f85 commit 391567a

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/Constraints/Mig.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ class Mig extends Constraint
2424
public $migMessage = 'Cette valeur n\'est pas au format MIG.';
2525

2626
/** @var array<string, string> */
27-
protected static $errorNames = [
27+
protected const ERROR_NAMES = [
2828
self::LENGTH_ERROR => 'LENGTH_ERROR',
2929
self::MIG_INVALID => 'MIG_INVALID',
3030
];
31+
32+
/**
33+
* @var array<string, string>
34+
* @deprecated since Symfony 6.1, use const ERROR_NAMES instead
35+
*/
36+
protected static $errorNames = self::ERROR_NAMES;
3137
}

src/Constraints/Nir.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ class Nir extends Constraint
3333
public $nirKeyMessage = 'La clé ne correspond pas au NIR fourni.';
3434

3535
/** @var array<string, string> */
36-
protected static $errorNames = [
36+
protected const ERROR_NAMES = [
3737
self::LENGTH_ERROR => 'LENGTH_ERROR',
3838
self::NIR_INVALID => 'NIR_INVALID',
3939
self::NIR_KEY_INVALID => 'NIR_KEY_INVALID',
4040
];
4141

42+
/**
43+
* @var array<string, string>
44+
* @deprecated since Symfony 6.1, use const ERROR_NAMES instead
45+
*/
46+
protected static $errorNames = self::ERROR_NAMES;
47+
4248
/** @var NirKeyInterface */
4349
public $nirKey;
4450

src/Constraints/Nnp.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ class Nnp extends Constraint
2424
public $nnpMessage = 'Cette valeur n\'est pas au format NNP.';
2525

2626
/** @var array<string, string> */
27-
protected static $errorNames = [
27+
protected const ERROR_NAMES = [
2828
self::LENGTH_ERROR => 'LENGTH_ERROR',
2929
self::NNP_INVALID => 'NNP_INVALID',
3030
];
31+
32+
/**
33+
* @var array<string, string>
34+
* @deprecated since Symfony 6.1, use const ERROR_NAMES instead
35+
*/
36+
protected static $errorNames = self::ERROR_NAMES;
3137
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy