diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 1920b9aa9..7d80b75df 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -16,14 +16,6 @@ - - - - - - - - @@ -367,15 +359,6 @@ - - operator]]> - operator]]> - operator]]> - operator]]> - - - - @@ -474,6 +457,9 @@ session]]> + + tokenList]]> + tokenList[$tokenId]]]> @@ -1657,9 +1643,6 @@ - - - @@ -1803,25 +1786,14 @@ - - - - baseValue]]> - step]]> + + - - - - - - baseValue]]> - step]]> - diff --git a/src/AbstractValidator.php b/src/AbstractValidator.php index 0012126ce..ffe33b845 100644 --- a/src/AbstractValidator.php +++ b/src/AbstractValidator.php @@ -153,7 +153,7 @@ public function getOptions() * Sets one or multiple options * * @param array|Traversable $options Options to set - * @return $this Provides fluid interface + * @return self Provides fluid interface * @throws Exception\InvalidArgumentException If $options is not an array or Traversable. */ public function setOptions($options = []) diff --git a/src/Barcode.php b/src/Barcode.php index 80e774187..1d300cbd3 100644 --- a/src/Barcode.php +++ b/src/Barcode.php @@ -17,6 +17,7 @@ use function substr; use function ucfirst; +/** @final */ class Barcode extends AbstractValidator { public const INVALID = 'barcodeInvalid'; diff --git a/src/Barcode/Codabar.php b/src/Barcode/Codabar.php index 5622e3789..3ed6ebc8a 100644 --- a/src/Barcode/Codabar.php +++ b/src/Barcode/Codabar.php @@ -5,6 +5,7 @@ use function strpbrk; use function substr; +/** @final */ class Codabar extends AbstractAdapter { /** diff --git a/src/Barcode/Code128.php b/src/Barcode/Code128.php index a1012d201..7be264e87 100644 --- a/src/Barcode/Code128.php +++ b/src/Barcode/Code128.php @@ -10,6 +10,7 @@ use function is_string; use function ord; +/** @final */ class Code128 extends AbstractAdapter { /** diff --git a/src/Barcode/Code25.php b/src/Barcode/Code25.php index 7134eb7cd..c31c78b93 100644 --- a/src/Barcode/Code25.php +++ b/src/Barcode/Code25.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Code25 extends AbstractAdapter { /** diff --git a/src/Barcode/Code25interleaved.php b/src/Barcode/Code25interleaved.php index cce21b20e..263ad92c3 100644 --- a/src/Barcode/Code25interleaved.php +++ b/src/Barcode/Code25interleaved.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Code25interleaved extends AbstractAdapter { /** diff --git a/src/Barcode/Code39.php b/src/Barcode/Code39.php index 4b101191c..2fe46da9e 100644 --- a/src/Barcode/Code39.php +++ b/src/Barcode/Code39.php @@ -5,6 +5,7 @@ use function str_split; use function substr; +/** @final */ class Code39 extends AbstractAdapter { /** @var array */ diff --git a/src/Barcode/Code39ext.php b/src/Barcode/Code39ext.php index d23123c0a..eff8ffca5 100644 --- a/src/Barcode/Code39ext.php +++ b/src/Barcode/Code39ext.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Code39ext extends AbstractAdapter { /** diff --git a/src/Barcode/Code93.php b/src/Barcode/Code93.php index 92905ec17..5411ece58 100644 --- a/src/Barcode/Code93.php +++ b/src/Barcode/Code93.php @@ -7,6 +7,7 @@ use function str_split; use function substr; +/** @final */ class Code93 extends AbstractAdapter { /** diff --git a/src/Barcode/Code93ext.php b/src/Barcode/Code93ext.php index 216d72285..e5ee68208 100644 --- a/src/Barcode/Code93ext.php +++ b/src/Barcode/Code93ext.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Code93ext extends AbstractAdapter { /** diff --git a/src/Barcode/Ean12.php b/src/Barcode/Ean12.php index 82be6c5a5..14073bc71 100644 --- a/src/Barcode/Ean12.php +++ b/src/Barcode/Ean12.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Ean12 extends AbstractAdapter { /** diff --git a/src/Barcode/Ean13.php b/src/Barcode/Ean13.php index 261a687fd..2b27a9665 100644 --- a/src/Barcode/Ean13.php +++ b/src/Barcode/Ean13.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Ean13 extends AbstractAdapter { /** diff --git a/src/Barcode/Ean14.php b/src/Barcode/Ean14.php index 9be798b08..6e5150622 100644 --- a/src/Barcode/Ean14.php +++ b/src/Barcode/Ean14.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Ean14 extends AbstractAdapter { /** diff --git a/src/Barcode/Ean18.php b/src/Barcode/Ean18.php index f2c32204e..643addae9 100644 --- a/src/Barcode/Ean18.php +++ b/src/Barcode/Ean18.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Ean18 extends AbstractAdapter { /** diff --git a/src/Barcode/Ean2.php b/src/Barcode/Ean2.php index a49ea9b9a..3769a56a1 100644 --- a/src/Barcode/Ean2.php +++ b/src/Barcode/Ean2.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Ean2 extends AbstractAdapter { /** diff --git a/src/Barcode/Ean5.php b/src/Barcode/Ean5.php index 0433c80a2..31bd1f024 100644 --- a/src/Barcode/Ean5.php +++ b/src/Barcode/Ean5.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Ean5 extends AbstractAdapter { /** diff --git a/src/Barcode/Ean8.php b/src/Barcode/Ean8.php index 7f1399a46..008bfa9ac 100644 --- a/src/Barcode/Ean8.php +++ b/src/Barcode/Ean8.php @@ -4,6 +4,7 @@ use function strlen; +/** @final */ class Ean8 extends AbstractAdapter { /** diff --git a/src/Barcode/Gtin12.php b/src/Barcode/Gtin12.php index f667d1f50..0920396e4 100644 --- a/src/Barcode/Gtin12.php +++ b/src/Barcode/Gtin12.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Gtin12 extends AbstractAdapter { /** diff --git a/src/Barcode/Gtin13.php b/src/Barcode/Gtin13.php index 4f02651ec..05d3cb750 100644 --- a/src/Barcode/Gtin13.php +++ b/src/Barcode/Gtin13.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Gtin13 extends AbstractAdapter { /** diff --git a/src/Barcode/Gtin14.php b/src/Barcode/Gtin14.php index 2ec6624ce..9d2a061e0 100644 --- a/src/Barcode/Gtin14.php +++ b/src/Barcode/Gtin14.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Gtin14 extends AbstractAdapter { /** diff --git a/src/Barcode/Identcode.php b/src/Barcode/Identcode.php index a0c4cf63a..32d05db8b 100644 --- a/src/Barcode/Identcode.php +++ b/src/Barcode/Identcode.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Identcode extends AbstractAdapter { /** diff --git a/src/Barcode/Intelligentmail.php b/src/Barcode/Intelligentmail.php index d34569f1b..de06684ab 100644 --- a/src/Barcode/Intelligentmail.php +++ b/src/Barcode/Intelligentmail.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Intelligentmail extends AbstractAdapter { /** diff --git a/src/Barcode/Issn.php b/src/Barcode/Issn.php index e99321244..ed8e3952e 100644 --- a/src/Barcode/Issn.php +++ b/src/Barcode/Issn.php @@ -7,6 +7,7 @@ use function strlen; use function substr; +/** @final */ class Issn extends AbstractAdapter { /** diff --git a/src/Barcode/Itf14.php b/src/Barcode/Itf14.php index c8683ff19..59dbb8b59 100644 --- a/src/Barcode/Itf14.php +++ b/src/Barcode/Itf14.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Itf14 extends AbstractAdapter { /** diff --git a/src/Barcode/Leitcode.php b/src/Barcode/Leitcode.php index c4a0dc107..759a2da84 100644 --- a/src/Barcode/Leitcode.php +++ b/src/Barcode/Leitcode.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Leitcode extends AbstractAdapter { /** diff --git a/src/Barcode/Planet.php b/src/Barcode/Planet.php index e966065b9..4323d9942 100644 --- a/src/Barcode/Planet.php +++ b/src/Barcode/Planet.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Planet extends AbstractAdapter { /** diff --git a/src/Barcode/Postnet.php b/src/Barcode/Postnet.php index f3261e138..8a78c8638 100644 --- a/src/Barcode/Postnet.php +++ b/src/Barcode/Postnet.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Postnet extends AbstractAdapter { /** diff --git a/src/Barcode/Royalmail.php b/src/Barcode/Royalmail.php index bcc01199d..57b71d82a 100644 --- a/src/Barcode/Royalmail.php +++ b/src/Barcode/Royalmail.php @@ -9,6 +9,7 @@ use function strlen; use function substr; +/** @final */ class Royalmail extends AbstractAdapter { /** @var array */ diff --git a/src/Barcode/Sscc.php b/src/Barcode/Sscc.php index 44f804233..6d9d204d9 100644 --- a/src/Barcode/Sscc.php +++ b/src/Barcode/Sscc.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Sscc extends AbstractAdapter { /** diff --git a/src/Barcode/Upca.php b/src/Barcode/Upca.php index d5d804177..c9d6b131f 100644 --- a/src/Barcode/Upca.php +++ b/src/Barcode/Upca.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Barcode; +/** @final */ class Upca extends AbstractAdapter { /** diff --git a/src/Barcode/Upce.php b/src/Barcode/Upce.php index 3532b42c6..07f223e86 100644 --- a/src/Barcode/Upce.php +++ b/src/Barcode/Upce.php @@ -4,6 +4,7 @@ use function strlen; +/** @final */ class Upce extends AbstractAdapter { /** diff --git a/src/Between.php b/src/Between.php index 40d474ebd..d1b3ce040 100644 --- a/src/Between.php +++ b/src/Between.php @@ -14,6 +14,7 @@ use const PHP_INT_MAX; +/** @final */ class Between extends AbstractValidator { public const NOT_BETWEEN = 'notBetween'; diff --git a/src/Bitwise.php b/src/Bitwise.php index d718a020f..8fe2f2dd1 100644 --- a/src/Bitwise.php +++ b/src/Bitwise.php @@ -9,6 +9,7 @@ use function is_array; use function iterator_to_array; +/** @final */ class Bitwise extends AbstractValidator { public const OP_AND = 'and'; @@ -43,7 +44,7 @@ class Bitwise extends AbstractValidator 'control' => 'control', ]; - /** @var null|int */ + /** @var null|string */ protected $operator; /** @var bool */ @@ -96,7 +97,7 @@ public function getControl() /** * Returns the operator parameter. * - * @return null|int + * @return null|string */ public function getOperator() { diff --git a/src/BusinessIdentifierCode.php b/src/BusinessIdentifierCode.php index 4f42578f5..b3d42fdae 100644 --- a/src/BusinessIdentifierCode.php +++ b/src/BusinessIdentifierCode.php @@ -7,6 +7,7 @@ use function preg_match; use function strtoupper; +/** @final */ class BusinessIdentifierCode extends AbstractValidator { public const INVALID = 'valueNotBic'; diff --git a/src/Callback.php b/src/Callback.php index 281857b4d..32027477f 100644 --- a/src/Callback.php +++ b/src/Callback.php @@ -21,6 +21,7 @@ * throwExceptions?: bool, * ... * } + * @final */ class Callback extends AbstractValidator { diff --git a/src/ConfigProvider.php b/src/ConfigProvider.php index ae6babd67..852e133c0 100644 --- a/src/ConfigProvider.php +++ b/src/ConfigProvider.php @@ -2,6 +2,7 @@ namespace Laminas\Validator; +/** @final */ class ConfigProvider { /** diff --git a/src/CreditCard.php b/src/CreditCard.php index a498a42a7..f92cb38a0 100644 --- a/src/CreditCard.php +++ b/src/CreditCard.php @@ -24,6 +24,7 @@ use function strlen; use function strtoupper; +/** @final */ class CreditCard extends AbstractValidator { /** diff --git a/src/Csrf.php b/src/Csrf.php index 973179103..45792e416 100644 --- a/src/Csrf.php +++ b/src/Csrf.php @@ -16,6 +16,7 @@ use function strtolower; use function strtr; +/** @final */ class Csrf extends AbstractValidator { /** diff --git a/src/DateStep.php b/src/DateStep.php index 666fa1967..863024299 100644 --- a/src/DateStep.php +++ b/src/DateStep.php @@ -31,6 +31,7 @@ use const PHP_INT_MAX; +/** @final */ class DateStep extends Date { /** diff --git a/src/Digits.php b/src/Digits.php index 5caddbded..97a9caa7b 100644 --- a/src/Digits.php +++ b/src/Digits.php @@ -8,6 +8,7 @@ use function is_int; use function is_string; +/** @final */ class Digits extends AbstractValidator { public const NOT_DIGITS = 'notDigits'; diff --git a/src/EmailAddress.php b/src/EmailAddress.php index 94be3df89..ac34ea11b 100644 --- a/src/EmailAddress.php +++ b/src/EmailAddress.php @@ -28,6 +28,7 @@ use const INTL_IDNA_VARIANT_UTS46; +/** @final */ class EmailAddress extends AbstractValidator { public const INVALID = 'emailAddressInvalid'; diff --git a/src/Exception/BadMethodCallException.php b/src/Exception/BadMethodCallException.php index 48ffcba69..5b2af4e5c 100644 --- a/src/Exception/BadMethodCallException.php +++ b/src/Exception/BadMethodCallException.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Exception; +/** @final */ class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface { } diff --git a/src/Exception/ExtensionNotLoadedException.php b/src/Exception/ExtensionNotLoadedException.php index b075c3197..c63b021ac 100644 --- a/src/Exception/ExtensionNotLoadedException.php +++ b/src/Exception/ExtensionNotLoadedException.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Exception; +/** @final */ class ExtensionNotLoadedException extends RuntimeException { } diff --git a/src/Exception/InvalidMagicMimeFileException.php b/src/Exception/InvalidMagicMimeFileException.php index a9b383206..78e5edbd8 100644 --- a/src/Exception/InvalidMagicMimeFileException.php +++ b/src/Exception/InvalidMagicMimeFileException.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Exception; +/** @final */ class InvalidMagicMimeFileException extends InvalidArgumentException { } diff --git a/src/Explode.php b/src/Explode.php index b92ddc063..96da1e493 100644 --- a/src/Explode.php +++ b/src/Explode.php @@ -13,6 +13,7 @@ /** * @psalm-import-type ValidatorSpecification from ValidatorInterface + * @final */ class Explode extends AbstractValidator implements ValidatorPluginManagerAwareInterface { diff --git a/src/File/Count.php b/src/File/Count.php index 080cc812c..9b22824a6 100644 --- a/src/File/Count.php +++ b/src/File/Count.php @@ -21,6 +21,8 @@ /** * Validator for counting all given files + * + * @final */ class Count extends AbstractValidator { diff --git a/src/File/Crc32.php b/src/File/Crc32.php index 94963bf1f..af00c5852 100644 --- a/src/File/Crc32.php +++ b/src/File/Crc32.php @@ -9,6 +9,8 @@ /** * Validator for the crc32 hash of given files + * + * @final */ class Crc32 extends Hash { diff --git a/src/File/ExcludeExtension.php b/src/File/ExcludeExtension.php index 47741fc26..684af7685 100644 --- a/src/File/ExcludeExtension.php +++ b/src/File/ExcludeExtension.php @@ -10,6 +10,8 @@ /** * Validator for the excluding file extensions + * + * @final */ class ExcludeExtension extends Extension { diff --git a/src/File/ExcludeMimeType.php b/src/File/ExcludeMimeType.php index 3b437393e..682b559db 100644 --- a/src/File/ExcludeMimeType.php +++ b/src/File/ExcludeMimeType.php @@ -17,6 +17,8 @@ /** * Validator for the mime type of a file + * + * @final */ class ExcludeMimeType extends MimeType { diff --git a/src/File/FilesSize.php b/src/File/FilesSize.php index fb53ea003..029aa40a6 100644 --- a/src/File/FilesSize.php +++ b/src/File/FilesSize.php @@ -20,6 +20,8 @@ /** * Validator for the size of all files which will be validated in sum + * + * @final */ class FilesSize extends Size { diff --git a/src/File/ImageSize.php b/src/File/ImageSize.php index 91f478bb7..d56236540 100644 --- a/src/File/ImageSize.php +++ b/src/File/ImageSize.php @@ -16,6 +16,8 @@ /** * Validator for the image size of an image file + * + * @final */ class ImageSize extends AbstractValidator { diff --git a/src/File/IsCompressed.php b/src/File/IsCompressed.php index 786e4712f..1a807a6e5 100644 --- a/src/File/IsCompressed.php +++ b/src/File/IsCompressed.php @@ -7,6 +7,8 @@ /** * Validator which checks if the file already exists in the directory + * + * @final */ class IsCompressed extends MimeType { diff --git a/src/File/IsImage.php b/src/File/IsImage.php index 2936eaffb..e8b2079d3 100644 --- a/src/File/IsImage.php +++ b/src/File/IsImage.php @@ -7,6 +7,8 @@ /** * Validator which checks if the file is an image + * + * @final */ class IsImage extends MimeType { diff --git a/src/File/Md5.php b/src/File/Md5.php index 4d48edf4e..1d43f7bf6 100644 --- a/src/File/Md5.php +++ b/src/File/Md5.php @@ -9,6 +9,8 @@ /** * Validator for the md5 hash of given files + * + * @final */ class Md5 extends Hash { diff --git a/src/File/MimeType.php b/src/File/MimeType.php index a3a57da60..0e378c0a8 100644 --- a/src/File/MimeType.php +++ b/src/File/MimeType.php @@ -196,7 +196,7 @@ public function getMagicFile() * @throws Exception\RuntimeException When finfo can not read the magicfile. * @throws Exception\InvalidArgumentException * @throws Exception\InvalidMagicMimeFileException - * @return $this Provides fluid interface + * @return self Provides fluid interface */ public function setMagicFile($file) { @@ -266,7 +266,7 @@ public function getHeaderCheck() * Note that this is unsafe and therefor the default value is false * * @param bool $headerCheck - * @return $this Provides fluid interface + * @return self Provides fluid interface */ public function enableHeaderCheck($headerCheck = true) { @@ -296,7 +296,7 @@ public function getMimeType($asArray = false) * Sets the mimetypes * * @param string|list $mimetype The mimetypes to validate - * @return $this Provides a fluent interface + * @return self Provides a fluent interface */ public function setMimeType($mimetype) { @@ -310,7 +310,7 @@ public function setMimeType($mimetype) * * @param string|list $mimetype The mimetypes to add for validation * @throws Exception\InvalidArgumentException - * @return $this Provides a fluent interface + * @return self Provides a fluent interface */ public function addMimeType($mimetype) { diff --git a/src/File/NotExists.php b/src/File/NotExists.php index 0ed8f2f18..6e19d964a 100644 --- a/src/File/NotExists.php +++ b/src/File/NotExists.php @@ -8,6 +8,8 @@ /** * Validator which checks if the destination file does not exist + * + * @final */ class NotExists extends Exists { diff --git a/src/File/Sha1.php b/src/File/Sha1.php index da90c45b7..5dc64f3b6 100644 --- a/src/File/Sha1.php +++ b/src/File/Sha1.php @@ -9,6 +9,8 @@ /** * Validator for the sha1 hash of given files + * + * @final */ class Sha1 extends Hash { diff --git a/src/File/Upload.php b/src/File/Upload.php index 10a0f2f3e..10943fc73 100644 --- a/src/File/Upload.php +++ b/src/File/Upload.php @@ -17,6 +17,8 @@ /** * Validator for the maximum size of a file up to a max of 2GB + * + * @final */ class Upload extends AbstractValidator { diff --git a/src/File/UploadFile.php b/src/File/UploadFile.php index 9d73f54af..bc8adac0a 100644 --- a/src/File/UploadFile.php +++ b/src/File/UploadFile.php @@ -23,6 +23,8 @@ /** * Validator for the maximum size of a file up to a max of 2GB + * + * @final */ class UploadFile extends AbstractValidator { diff --git a/src/File/WordCount.php b/src/File/WordCount.php index 107fb6fdd..d252cc0cf 100644 --- a/src/File/WordCount.php +++ b/src/File/WordCount.php @@ -18,6 +18,8 @@ /** * Validator for counting all words in a file + * + * @final */ class WordCount extends AbstractValidator { diff --git a/src/GreaterThan.php b/src/GreaterThan.php index bc26c81e1..07230a956 100644 --- a/src/GreaterThan.php +++ b/src/GreaterThan.php @@ -10,6 +10,7 @@ use function func_get_args; use function is_array; +/** @final */ class GreaterThan extends AbstractValidator { public const NOT_GREATER = 'notGreaterThan'; diff --git a/src/Hex.php b/src/Hex.php index d4951c067..4f6a18c33 100644 --- a/src/Hex.php +++ b/src/Hex.php @@ -6,6 +6,7 @@ use function is_int; use function is_string; +/** @final */ class Hex extends AbstractValidator { public const INVALID = 'hexInvalid'; diff --git a/src/Hostname.php b/src/Hostname.php index 647147f73..94fcd056f 100644 --- a/src/Hostname.php +++ b/src/Hostname.php @@ -46,6 +46,7 @@ * useTldCheck?: bool, * ipValidator?: null|ValidatorInterface, * } + * @final */ class Hostname extends AbstractValidator { diff --git a/src/Iban.php b/src/Iban.php index 65f23054f..6285cdc8e 100644 --- a/src/Iban.php +++ b/src/Iban.php @@ -17,6 +17,8 @@ /** * Validates IBAN Numbers (International Bank Account Numbers) + * + * @final */ class Iban extends AbstractValidator { diff --git a/src/Identical.php b/src/Identical.php index ef766941d..900303ea0 100644 --- a/src/Identical.php +++ b/src/Identical.php @@ -15,6 +15,7 @@ use function sprintf; use function var_export; +/** @final */ class Identical extends AbstractValidator { /** diff --git a/src/InArray.php b/src/InArray.php index e1289c4cc..3a37deffd 100644 --- a/src/InArray.php +++ b/src/InArray.php @@ -11,6 +11,7 @@ use function is_int; use function is_string; +/** @final */ class InArray extends AbstractValidator { public const NOT_IN_ARRAY = 'notInArray'; diff --git a/src/Ip.php b/src/Ip.php index 8188e5ccd..d1d1b696b 100644 --- a/src/Ip.php +++ b/src/Ip.php @@ -17,6 +17,7 @@ use function substr; use function substr_count; +/** @final */ class Ip extends AbstractValidator { public const INVALID = 'ipInvalid'; diff --git a/src/IsCountable.php b/src/IsCountable.php index e31307dd8..1602588e1 100644 --- a/src/IsCountable.php +++ b/src/IsCountable.php @@ -36,6 +36,7 @@ * }&array * @property Options&array $options Required to stop Psalm getting confused about the declaration * on AbstractValidator + * @final */ class IsCountable extends AbstractValidator { diff --git a/src/IsInstanceOf.php b/src/IsInstanceOf.php index e6009afb3..a71c76009 100644 --- a/src/IsInstanceOf.php +++ b/src/IsInstanceOf.php @@ -10,6 +10,7 @@ use function is_array; use function iterator_to_array; +/** @final */ class IsInstanceOf extends AbstractValidator { public const NOT_INSTANCE_OF = 'notInstanceOf'; diff --git a/src/Isbn.php b/src/Isbn.php index f63b9ee0c..7eab05e0d 100644 --- a/src/Isbn.php +++ b/src/Isbn.php @@ -11,6 +11,7 @@ use function strlen; use function substr; +/** @final */ class Isbn extends AbstractValidator { public const AUTO = 'auto'; diff --git a/src/Isbn/Isbn10.php b/src/Isbn/Isbn10.php index 4bcc6570d..24b9337e7 100755 --- a/src/Isbn/Isbn10.php +++ b/src/Isbn/Isbn10.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Isbn; +/** @final */ class Isbn10 { /** diff --git a/src/Isbn/Isbn13.php b/src/Isbn/Isbn13.php index c5aaf494e..526749cae 100755 --- a/src/Isbn/Isbn13.php +++ b/src/Isbn/Isbn13.php @@ -2,6 +2,7 @@ namespace Laminas\Validator\Isbn; +/** @final */ class Isbn13 { /** diff --git a/src/LessThan.php b/src/LessThan.php index 1a646c239..8b34cdb1a 100644 --- a/src/LessThan.php +++ b/src/LessThan.php @@ -10,6 +10,7 @@ use function func_get_args; use function is_array; +/** @final */ class LessThan extends AbstractValidator { public const NOT_LESS = 'notLessThan'; diff --git a/src/NotEmpty.php b/src/NotEmpty.php index b342974f7..b922c1e91 100644 --- a/src/NotEmpty.php +++ b/src/NotEmpty.php @@ -20,6 +20,7 @@ use function method_exists; use function preg_match; +/** @final */ class NotEmpty extends AbstractValidator { public const BOOLEAN = 0b000000000001; diff --git a/src/Regex.php b/src/Regex.php index 082606a58..ad7d1faf0 100644 --- a/src/Regex.php +++ b/src/Regex.php @@ -13,6 +13,7 @@ use function is_string; use function preg_match; +/** @final */ class Regex extends AbstractValidator { public const INVALID = 'regexInvalid'; diff --git a/src/Sitemap/Changefreq.php b/src/Sitemap/Changefreq.php index af1cac18e..83ff06422 100644 --- a/src/Sitemap/Changefreq.php +++ b/src/Sitemap/Changefreq.php @@ -11,6 +11,8 @@ * Validates whether a given value is valid as a sitemap value * * @link http://www.sitemaps.org/protocol.php Sitemaps XML format + * + * @final */ class Changefreq extends AbstractValidator { diff --git a/src/Sitemap/Lastmod.php b/src/Sitemap/Lastmod.php index 2f6884e4c..a13f1ca10 100644 --- a/src/Sitemap/Lastmod.php +++ b/src/Sitemap/Lastmod.php @@ -12,6 +12,8 @@ * Validates whether a given value is valid as a sitemap value * * @link http://www.sitemaps.org/protocol.php Sitemaps XML format + * + * @final */ class Lastmod extends AbstractValidator { diff --git a/src/Sitemap/Loc.php b/src/Sitemap/Loc.php index 447a92d4d..b82f3d2e4 100644 --- a/src/Sitemap/Loc.php +++ b/src/Sitemap/Loc.php @@ -12,6 +12,8 @@ * * @link http://www.sitemaps.org/protocol.php Sitemaps XML format * @see Laminas\Uri\Uri + * + * @final */ class Loc extends AbstractValidator { diff --git a/src/Sitemap/Priority.php b/src/Sitemap/Priority.php index 7bf6c02b8..f61a1a442 100644 --- a/src/Sitemap/Priority.php +++ b/src/Sitemap/Priority.php @@ -10,6 +10,8 @@ * Validates whether a given value is valid as a sitemap value * * @link http://www.sitemaps.org/protocol.php Sitemaps XML format + * + * @final */ class Priority extends AbstractValidator { diff --git a/src/StaticValidator.php b/src/StaticValidator.php index 3eef674ab..c626b006a 100644 --- a/src/StaticValidator.php +++ b/src/StaticValidator.php @@ -7,6 +7,7 @@ use function array_values; use function method_exists; +/** @final */ class StaticValidator { /** @var ValidatorPluginManager|null */ diff --git a/src/Step.php b/src/Step.php index d35673583..b1f676624 100644 --- a/src/Step.php +++ b/src/Step.php @@ -15,6 +15,7 @@ use function strpos; use function substr; +/** @final */ class Step extends AbstractValidator { public const INVALID = 'typeInvalid'; @@ -26,10 +27,10 @@ class Step extends AbstractValidator self::NOT_STEP => 'The input is not a valid step', ]; - /** @var mixed */ + /** @var numeric */ protected $baseValue = 0; - /** @var mixed */ + /** @var numeric */ protected $step = 1; /** @@ -64,6 +65,7 @@ public function __construct($options = []) /** * Sets the base value from which the step should be computed * + * @param numeric $baseValue * @return $this */ public function setBaseValue(mixed $baseValue) @@ -75,7 +77,7 @@ public function setBaseValue(mixed $baseValue) /** * Returns the base value from which the step should be computed * - * @return string + * @return numeric */ public function getBaseValue() { @@ -85,6 +87,7 @@ public function getBaseValue() /** * Sets the step value * + * @param numeric $step * @return $this */ public function setStep(mixed $step) @@ -96,7 +99,7 @@ public function setStep(mixed $step) /** * Returns the step value * - * @return string + * @return numeric */ public function getStep() { @@ -133,8 +136,8 @@ public function isValid($value) /** * replaces the internal fmod function which give wrong results on many cases * - * @param int|float $x - * @param int|float $y + * @param numeric $x + * @param numeric $y * @return float */ protected function fmod($x, $y) @@ -152,8 +155,8 @@ protected function fmod($x, $y) /** * replaces the internal substraction operation which give wrong results on some cases * - * @param float $x - * @param float $y + * @param numeric $x + * @param numeric $y * @return float */ private function sub($x, $y) @@ -163,7 +166,7 @@ private function sub($x, $y) } /** - * @param float $float + * @param numeric $float */ private function getPrecision($float): int { diff --git a/src/StringLength.php b/src/StringLength.php index 64edff34b..3ab474c0b 100644 --- a/src/StringLength.php +++ b/src/StringLength.php @@ -13,6 +13,7 @@ use function is_string; use function max; +/** @final */ class StringLength extends AbstractValidator { public const INVALID = 'stringLengthInvalid'; diff --git a/src/Timezone.php b/src/Timezone.php index 5842adcc1..126c45fdc 100644 --- a/src/Timezone.php +++ b/src/Timezone.php @@ -13,6 +13,7 @@ use function is_string; use function sprintf; +/** @final */ class Timezone extends AbstractValidator { public const INVALID = 'invalidTimezone'; diff --git a/src/Uri.php b/src/Uri.php index 88f56d4a9..6520f2ccb 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -17,6 +17,7 @@ use function iterator_to_array; use function sprintf; +/** @final */ class Uri extends AbstractValidator { public const INVALID = 'uriInvalid'; diff --git a/src/ValidatorPluginManager.php b/src/ValidatorPluginManager.php index 6d0408626..e7526d37f 100644 --- a/src/ValidatorPluginManager.php +++ b/src/ValidatorPluginManager.php @@ -17,6 +17,7 @@ /** * @psalm-import-type ServiceManagerConfiguration from ServiceManager * @extends AbstractPluginManager + * @final */ class ValidatorPluginManager extends AbstractPluginManager { diff --git a/src/ValidatorPluginManagerFactory.php b/src/ValidatorPluginManagerFactory.php index 45441baa8..b91552477 100644 --- a/src/ValidatorPluginManagerFactory.php +++ b/src/ValidatorPluginManagerFactory.php @@ -14,6 +14,8 @@ * @link ServiceManager * * @psalm-import-type ServiceManagerConfiguration from ServiceManager + * + * @final */ class ValidatorPluginManagerFactory implements FactoryInterface {