From 5ef5e7d7849b4eee1f5f878c5774e114487231ce Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Thu, 14 Apr 2016 14:15:46 +0200 Subject: [PATCH] API closing Make constraints and validators `final`. --- UPGRADE-2.0.md | 4 ++++ src/Constraints/Bban.php | 2 +- src/Constraints/Cif.php | 2 +- src/Constraints/CreditCard.php | 2 +- src/Constraints/Ean13.php | 2 +- src/Constraints/Iban.php | 2 +- src/Constraints/Insee.php | 2 +- src/Constraints/Ip.php | 2 +- src/Constraints/IpValidator.php | 2 +- src/Constraints/Isbn.php | 2 +- src/Constraints/IsbnValidator.php | 2 +- src/Constraints/Nif.php | 2 +- src/Constraints/Siren.php | 2 +- src/Constraints/Siret.php | 2 +- src/Constraints/Ssn.php | 2 +- src/Constraints/SsnValidator.php | 2 +- src/Constraints/StructuredCommunication.php | 2 +- src/Constraints/SwiftBic.php | 2 +- src/Constraints/Uknin.php | 2 +- src/Constraints/Vat.php | 2 +- src/Constraints/ZipCode.php | 2 +- src/Constraints/ZipCodeValidator.php | 2 +- 22 files changed, 25 insertions(+), 21 deletions(-) diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md index c6d9e68..0c019c5 100644 --- a/UPGRADE-2.0.md +++ b/UPGRADE-2.0.md @@ -4,6 +4,10 @@ This version need now Symfony 2.7 LTS as a minimum requirement. +## API closing + +Constraint and validator classes are now `final` because there is no reason to override them. + ## Deprecations All deprecated code introduced on 1.x are removed on 2.0. diff --git a/src/Constraints/Bban.php b/src/Constraints/Bban.php index 6897923..b5c4023 100644 --- a/src/Constraints/Bban.php +++ b/src/Constraints/Bban.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Bban extends IsoCodesGeneric +final class Bban extends IsoCodesGeneric { public $message = 'This value is not a valid BBAN.'; } diff --git a/src/Constraints/Cif.php b/src/Constraints/Cif.php index 86664bb..c811be9 100644 --- a/src/Constraints/Cif.php +++ b/src/Constraints/Cif.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Cif extends IsoCodesGeneric +final class Cif extends IsoCodesGeneric { public $message = 'This value is not a valid CIF.'; } diff --git a/src/Constraints/CreditCard.php b/src/Constraints/CreditCard.php index 8ee04df..d3c327a 100644 --- a/src/Constraints/CreditCard.php +++ b/src/Constraints/CreditCard.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class CreditCard extends IsoCodesGeneric +final class CreditCard extends IsoCodesGeneric { public $message = 'This value is not a valid credit card scheme.'; } diff --git a/src/Constraints/Ean13.php b/src/Constraints/Ean13.php index 71b0ffd..9277a58 100644 --- a/src/Constraints/Ean13.php +++ b/src/Constraints/Ean13.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Ean13 extends IsoCodesGeneric +final class Ean13 extends IsoCodesGeneric { public $message = 'This EAN 13 code is not valid.'; } diff --git a/src/Constraints/Iban.php b/src/Constraints/Iban.php index 92309fd..dc14fa2 100644 --- a/src/Constraints/Iban.php +++ b/src/Constraints/Iban.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Iban extends IsoCodesGeneric +final class Iban extends IsoCodesGeneric { public $message = 'This value is not a valid IBAN.'; } diff --git a/src/Constraints/Insee.php b/src/Constraints/Insee.php index 7ac1d6a..69f8068 100644 --- a/src/Constraints/Insee.php +++ b/src/Constraints/Insee.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Insee extends IsoCodesGeneric +final class Insee extends IsoCodesGeneric { public $message = 'This INSEE number is not valid.'; } diff --git a/src/Constraints/Ip.php b/src/Constraints/Ip.php index 2707369..ef6053e 100644 --- a/src/Constraints/Ip.php +++ b/src/Constraints/Ip.php @@ -10,7 +10,7 @@ * * @author Sullivan Senechal */ -class Ip extends Constraint +final class Ip extends Constraint { public $message = 'This value is not a valid IP address.'; } diff --git a/src/Constraints/IpValidator.php b/src/Constraints/IpValidator.php index aa81b98..baff1fd 100644 --- a/src/Constraints/IpValidator.php +++ b/src/Constraints/IpValidator.php @@ -9,7 +9,7 @@ /** * @author Sullivan Senechal */ -class IpValidator extends AbstractIsoCodesConstraintValidator +final class IpValidator extends AbstractIsoCodesConstraintValidator { /** * {@inheritdoc} diff --git a/src/Constraints/Isbn.php b/src/Constraints/Isbn.php index c882dbb..3f14f5c 100644 --- a/src/Constraints/Isbn.php +++ b/src/Constraints/Isbn.php @@ -11,7 +11,7 @@ * * @author Sullivan Senechal */ -class Isbn extends Constraint +final class Isbn extends Constraint { public $message = 'This value is not a valid ISBN.'; public $type = null; diff --git a/src/Constraints/IsbnValidator.php b/src/Constraints/IsbnValidator.php index 24e3732..e851432 100644 --- a/src/Constraints/IsbnValidator.php +++ b/src/Constraints/IsbnValidator.php @@ -9,7 +9,7 @@ /** * @author Sullivan Senechal */ -class IsbnValidator extends AbstractIsoCodesConstraintValidator +final class IsbnValidator extends AbstractIsoCodesConstraintValidator { /** * {@inheritdoc} diff --git a/src/Constraints/Nif.php b/src/Constraints/Nif.php index 50365f2..3630a57 100644 --- a/src/Constraints/Nif.php +++ b/src/Constraints/Nif.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Nif extends IsoCodesGeneric +final class Nif extends IsoCodesGeneric { public $message = 'This value is not a valid NIF.'; } diff --git a/src/Constraints/Siren.php b/src/Constraints/Siren.php index 0bcc656..9535f97 100644 --- a/src/Constraints/Siren.php +++ b/src/Constraints/Siren.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Siren extends IsoCodesGeneric +final class Siren extends IsoCodesGeneric { public $message = 'This value is not a valid SIREN.'; } diff --git a/src/Constraints/Siret.php b/src/Constraints/Siret.php index 3a0b9e6..8d44417 100644 --- a/src/Constraints/Siret.php +++ b/src/Constraints/Siret.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Siret extends IsoCodesGeneric +final class Siret extends IsoCodesGeneric { public $message = 'This value is not a valid SIRET.'; } diff --git a/src/Constraints/Ssn.php b/src/Constraints/Ssn.php index 0ca470e..022daca 100644 --- a/src/Constraints/Ssn.php +++ b/src/Constraints/Ssn.php @@ -10,7 +10,7 @@ * * @author Sullivan Senechal */ -class Ssn extends Constraint +final class Ssn extends Constraint { public $message = 'This value is not a valid SSN.'; } diff --git a/src/Constraints/SsnValidator.php b/src/Constraints/SsnValidator.php index 8c4d1ee..d3bfbaa 100644 --- a/src/Constraints/SsnValidator.php +++ b/src/Constraints/SsnValidator.php @@ -9,7 +9,7 @@ /** * @author Sullivan Senechal */ -class SsnValidator extends AbstractIsoCodesConstraintValidator +final class SsnValidator extends AbstractIsoCodesConstraintValidator { /** * {@inheritdoc} diff --git a/src/Constraints/StructuredCommunication.php b/src/Constraints/StructuredCommunication.php index 9ad2fd9..a611368 100644 --- a/src/Constraints/StructuredCommunication.php +++ b/src/Constraints/StructuredCommunication.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class StructuredCommunication extends IsoCodesGeneric +final class StructuredCommunication extends IsoCodesGeneric { public $message = 'This value is not a valid structured communication code.'; } diff --git a/src/Constraints/SwiftBic.php b/src/Constraints/SwiftBic.php index 4dcc732..936eca0 100644 --- a/src/Constraints/SwiftBic.php +++ b/src/Constraints/SwiftBic.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class SwiftBic extends IsoCodesGeneric +final class SwiftBic extends IsoCodesGeneric { public $message = 'This value is not a valid SWIFT.'; } diff --git a/src/Constraints/Uknin.php b/src/Constraints/Uknin.php index 4828a91..6788763 100644 --- a/src/Constraints/Uknin.php +++ b/src/Constraints/Uknin.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Uknin extends IsoCodesGeneric +final class Uknin extends IsoCodesGeneric { public $message = 'This value is not a valid NINO.'; } diff --git a/src/Constraints/Vat.php b/src/Constraints/Vat.php index 19107be..ac2f2c8 100644 --- a/src/Constraints/Vat.php +++ b/src/Constraints/Vat.php @@ -8,7 +8,7 @@ * * @author Sullivan Senechal */ -class Vat extends IsoCodesGeneric +final class Vat extends IsoCodesGeneric { public $message = 'This value is not a valid VAT.'; } diff --git a/src/Constraints/ZipCode.php b/src/Constraints/ZipCode.php index 933fbec..0a91b43 100644 --- a/src/Constraints/ZipCode.php +++ b/src/Constraints/ZipCode.php @@ -12,7 +12,7 @@ * * @author Sullivan Senechal */ -class ZipCode extends Constraint +final class ZipCode extends Constraint { const ALL = 'all'; diff --git a/src/Constraints/ZipCodeValidator.php b/src/Constraints/ZipCodeValidator.php index 2832de4..e81089b 100644 --- a/src/Constraints/ZipCodeValidator.php +++ b/src/Constraints/ZipCodeValidator.php @@ -9,7 +9,7 @@ /** * @author Sullivan Senechal */ -class ZipCodeValidator extends AbstractIsoCodesConstraintValidator +final class ZipCodeValidator extends AbstractIsoCodesConstraintValidator { /** * @param mixed $value