diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml
index 619aaaedc..ce114192b 100644
--- a/.github/workflows/ci-code.yml
+++ b/.github/workflows/ci-code.yml
@@ -27,6 +27,7 @@ jobs:
- run: composer phpunit
- run: composer pest
+ - run: composer inference
code-coverage:
name: Code Coverage
diff --git a/composer.json b/composer.json
index c07cb11b5..bdc29e257 100644
--- a/composer.json
+++ b/composer.json
@@ -5,6 +5,8 @@
"type": "library",
"homepage": "http://respect.github.io/",
"license": "MIT",
+ "minimum-stability": "dev",
+ "prefer-stable": true,
"authors": [
{
"name": "Respect/Validation Contributors",
@@ -23,7 +25,7 @@
"php": ">=8.5",
"psr/container": "^2.0",
"respect/config": "^3.0",
- "respect/fluent": "^2.0",
+ "respect/fluent": "3.0.x-dev",
"respect/parameter": "^3.0",
"respect/string-formatter": "^1.7",
"respect/stringifier": "^3.0",
@@ -45,7 +47,7 @@
"psr/http-message": "^1.0 || ^2.0",
"ramsey/uuid": "^4",
"respect/coding-standard": "^5.0",
- "respect/fluentgen": "^2.0",
+ "respect/fluentgen": "2.1.x-dev",
"sebastian/diff": "^7.0",
"sokil/php-isocodes": "^4.2.1",
"sokil/php-isocodes-db-only": "^4.0",
@@ -87,6 +89,7 @@
"phpcs": "vendor/bin/phpcs",
"phpstan": "vendor/bin/phpstan analyze",
"phpunit": "vendor/bin/phpunit --testsuite=unit",
+ "inference": "vendor/bin/phpunit --testsuite=inference",
"smoke-complete": "bin/console smoke-tests:check-complete",
"spdx-lint": "bin/console lint:spdx",
"qa": [
@@ -95,6 +98,7 @@
"@phpstan",
"@phpunit",
"@pest",
+ "@inference",
"@docs",
"@smoke-complete"
]
diff --git a/composer.lock b/composer.lock
index dd0c2d383..7743fae6c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "683a4f0e3e7054eddcef31faf9cc9b1c",
+ "content-hash": "eb09c441327241556e460c98c2728154",
"packages": [
{
"name": "psr/container",
@@ -122,16 +122,16 @@
},
{
"name": "respect/fluent",
- "version": "2.0.1",
+ "version": "dev-ide-narrowing",
"source": {
"type": "git",
"url": "https://github.com/Respect/Fluent.git",
- "reference": "f32c76e37a82a9e63d6fe700a27201534f72da60"
+ "reference": "8469e6e8d30d28f36c0b79a381703ea9b26b0ecd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Respect/Fluent/zipball/f32c76e37a82a9e63d6fe700a27201534f72da60",
- "reference": "f32c76e37a82a9e63d6fe700a27201534f72da60",
+ "url": "https://api.github.com/repos/Respect/Fluent/zipball/8469e6e8d30d28f36c0b79a381703ea9b26b0ecd",
+ "reference": "8469e6e8d30d28f36c0b79a381703ea9b26b0ecd",
"shasum": ""
},
"require": {
@@ -142,10 +142,15 @@
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
- "phpunit/phpunit": "^12.5",
+ "phpunit/phpunit": "^12.5 || ^13.0",
"respect/coding-standard": "^5.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-ide-narrowing": "3.0.x-dev"
+ }
+ },
"autoload": {
"psr-4": {
"Respect\\Fluent\\": "src/"
@@ -169,9 +174,9 @@
],
"support": {
"issues": "https://github.com/Respect/Fluent/issues",
- "source": "https://github.com/Respect/Fluent/tree/2.0.1"
+ "source": "https://github.com/Respect/Fluent/tree/ide-narrowing"
},
- "time": "2026-03-26T04:24:51+00:00"
+ "time": "2026-06-26T19:36:25+00:00"
},
{
"name": "respect/parameter",
@@ -2191,16 +2196,16 @@
},
{
"name": "pestphp/pest",
- "version": "v4.7.3",
+ "version": "v4.7.4",
"source": {
"type": "git",
"url": "https://github.com/pestphp/pest.git",
- "reference": "87882a8561bf3ddf230b9a6b764f367f687d5b2f"
+ "reference": "ee2e97e932d158faceeaa63a4dc17324b15152cb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/pestphp/pest/zipball/87882a8561bf3ddf230b9a6b764f367f687d5b2f",
- "reference": "87882a8561bf3ddf230b9a6b764f367f687d5b2f",
+ "url": "https://api.github.com/repos/pestphp/pest/zipball/ee2e97e932d158faceeaa63a4dc17324b15152cb",
+ "reference": "ee2e97e932d158faceeaa63a4dc17324b15152cb",
"shasum": ""
},
"require": {
@@ -2213,12 +2218,12 @@
"pestphp/pest-plugin-mutate": "^4.0.1",
"pestphp/pest-plugin-profanity": "^4.2.1",
"php": "^8.3.0",
- "phpunit/phpunit": "^12.5.29",
+ "phpunit/phpunit": "^12.5.30",
"symfony/process": "^7.4.13|^8.1.0"
},
"conflict": {
"filp/whoops": "<2.18.3",
- "phpunit/phpunit": ">12.5.29",
+ "phpunit/phpunit": ">12.5.30",
"sebastian/exporter": "<7.0.0",
"webmozart/assert": "<1.11.0"
},
@@ -2294,7 +2299,7 @@
],
"support": {
"issues": "https://github.com/pestphp/pest/issues",
- "source": "https://github.com/pestphp/pest/tree/v4.7.3"
+ "source": "https://github.com/pestphp/pest/tree/v4.7.4"
},
"funding": [
{
@@ -2306,7 +2311,7 @@
"type": "github"
}
],
- "time": "2026-06-12T05:57:27+00:00"
+ "time": "2026-06-25T19:09:05+00:00"
},
{
"name": "pestphp/pest-plugin",
@@ -3636,16 +3641,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "12.5.29",
+ "version": "12.5.30",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "9aa66a47db3ea70f1a468e66dd969f67e594945a"
+ "reference": "900400a5b616d6fb306f9549f6da33ba615d3fbb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9aa66a47db3ea70f1a468e66dd969f67e594945a",
- "reference": "9aa66a47db3ea70f1a468e66dd969f67e594945a",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/900400a5b616d6fb306f9549f6da33ba615d3fbb",
+ "reference": "900400a5b616d6fb306f9549f6da33ba615d3fbb",
"shasum": ""
},
"require": {
@@ -3714,7 +3719,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.29"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.30"
},
"funding": [
{
@@ -3722,7 +3727,7 @@
"type": "other"
}
],
- "time": "2026-06-04T06:14:42+00:00"
+ "time": "2026-06-15T13:12:30+00:00"
},
{
"name": "psr/cache",
@@ -4126,16 +4131,16 @@
},
{
"name": "respect/fluentgen",
- "version": "2.0.0",
+ "version": "dev-ide-narrowing",
"source": {
"type": "git",
"url": "https://github.com/Respect/FluentGen.git",
- "reference": "6a9065516f403c5f5abc86646290bd08e44c538e"
+ "reference": "518208d2a690ad0229c05ae6f001348dc6936da0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Respect/FluentGen/zipball/6a9065516f403c5f5abc86646290bd08e44c538e",
- "reference": "6a9065516f403c5f5abc86646290bd08e44c538e",
+ "url": "https://api.github.com/repos/Respect/FluentGen/zipball/518208d2a690ad0229c05ae6f001348dc6936da0",
+ "reference": "518208d2a690ad0229c05ae6f001348dc6936da0",
"shasum": ""
},
"require": {
@@ -4148,12 +4153,17 @@
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^12.5",
"respect/coding-standard": "^5.0",
- "respect/fluent": "^2.0"
+ "respect/fluent": "3.0.x-dev"
},
"suggest": {
"respect/fluent": "Enables #[Composable] prefix composition support"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-ide-narrowing": "2.1.x-dev"
+ }
+ },
"autoload": {
"psr-4": {
"Respect\\FluentGen\\": "src/"
@@ -4178,9 +4188,9 @@
],
"support": {
"issues": "https://github.com/Respect/FluentGen/issues",
- "source": "https://github.com/Respect/FluentGen/tree/2.0.0"
+ "source": "https://github.com/Respect/FluentGen/tree/ide-narrowing"
},
- "time": "2026-03-25T05:50:09+00:00"
+ "time": "2026-06-26T19:40:15+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -6809,9 +6819,12 @@
}
],
"aliases": [],
- "minimum-stability": "stable",
- "stability-flags": {},
- "prefer-stable": false,
+ "minimum-stability": "dev",
+ "stability-flags": {
+ "respect/fluent": 20,
+ "respect/fluentgen": 20
+ },
+ "prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": ">=8.5"
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 20d17139b..0cc9bec8f 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -15,6 +15,9 @@
src-dev/
tests/
+
+ tests/inference/assertions/*
+
@@ -28,6 +31,21 @@
src/Mixins/
tests/feature/
+
+
+ src/Mixins/
+
+
+ src/Mixins/
+
+
+ src/Mixins/
+
+
+ src/Mixins/
+
tests/Pest.php
tests/feature
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 47b7facab..1d4255f51 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -23,6 +23,16 @@ parameters:
path: tests/src/Message/TestingHandler.php
- message: '/Property Respect\\Validation\\Test\\Stubs\\.+::\$[a-zA-Z]+ is never read, only written./'
path: tests/src/Stubs
+ -
+ # Why: src/Mixins/* are generated typing aids. Their @return Chain<...> carry the
+ # narrowing types derived from #[Assurance] (the same ones FluentAnalysis computes
+ # at analysis time), e.g. bare `array` or `ArrayAccess`. Fully parameterising those
+ # generics would only clutter the IDE-facing types without adding narrowing value.
+ identifier: missingType.iterableValue
+ path: src/Mixins/*
+ -
+ identifier: missingType.generics
+ path: src/Mixins/*
level: 8
treatPhpDocTypesAsCertain: false
paths:
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 51339be5c..8dae82703 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -14,6 +14,9 @@
./tests/feature
+
+ tests/inference/
+
diff --git a/src-dev/Commands/LintMixinCommand.php b/src-dev/Commands/LintMixinCommand.php
index a31f6b188..a3e1644bf 100644
--- a/src-dev/Commands/LintMixinCommand.php
+++ b/src-dev/Commands/LintMixinCommand.php
@@ -18,6 +18,7 @@
use Respect\FluentGen\Fluent\MethodBuilder;
use Respect\FluentGen\Fluent\MixinGenerator;
use Respect\FluentGen\Fluent\PrefixConstantsGenerator;
+use Respect\FluentGen\Fluent\TerminalMethod;
use Respect\FluentGen\NamespaceScanner;
use Respect\Validation\Mixins\Chain;
use Respect\Validation\Validator;
@@ -82,6 +83,7 @@ interfaces: [
suffix: 'Builder',
returnType: Chain::class,
static: true,
+ emitNarrowing: true,
),
new InterfaceConfig(
suffix: 'Chain',
@@ -89,6 +91,29 @@ interfaces: [
rootExtends: [Validator::class],
rootComment: '@mixin ValidatorBuilder',
rootUses: [ValidatorBuilder::class],
+ emitNarrowing: true,
+ templateParam: 'TSure',
+ terminalMethods: [
+ new TerminalMethod(
+ name: 'assert',
+ returnType: 'void',
+ parameters: ['input' => 'mixed'],
+ comments: ['@phpstan-assert TSure $input', '@psalm-assert TSure $input'],
+ optionalParameters: ['template' => 'mixed'],
+ ),
+ new TerminalMethod(
+ name: 'check',
+ returnType: 'void',
+ parameters: ['input' => 'mixed'],
+ comments: ['@phpstan-assert TSure $input', '@psalm-assert TSure $input'],
+ optionalParameters: ['template' => 'mixed'],
+ ),
+ new TerminalMethod(
+ name: 'isValid',
+ returnType: 'bool',
+ parameters: ['input' => 'mixed'],
+ ),
+ ],
),
],
);
diff --git a/src/Mixins/AllBuilder.php b/src/Mixins/AllBuilder.php
index ea6f9af97..0c4f53f7c 100644
--- a/src/Mixins/AllBuilder.php
+++ b/src/Mixins/AllBuilder.php
@@ -17,300 +17,462 @@
interface AllBuilder
{
+ /** @return Chain */
public static function allAfter(callable $callable, Validator $validator): Chain;
+ /** @return Chain */
public static function allAllOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain> */
public static function allAlnum(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allAlpha(string ...$additionalChars): Chain;
+ /** @return Chain */
public static function allAlwaysInvalid(): Chain;
+ /** @return Chain */
public static function allAlwaysValid(): Chain;
+ /** @return Chain */
public static function allAnyOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain> */
public static function allArrayType(): Chain;
+ /** @return Chain> */
public static function allArrayVal(): Chain;
+ /** @return Chain */
public static function allBase(int $base, string $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'): Chain;
+ /** @return Chain> */
public static function allBase64(): Chain;
+ /** @return Chain */
public static function allBetween(mixed $minValue, mixed $maxValue): Chain;
+ /** @return Chain */
public static function allBetweenExclusive(mixed $minimum, mixed $maximum): Chain;
+ /** @return Chain */
public static function allBlank(): Chain;
+ /** @return Chain> */
public static function allBoolType(): Chain;
+ /** @return Chain> */
public static function allBoolVal(): Chain;
+ /** @return Chain> */
public static function allBsn(): Chain;
+ /** @return Chain> */
public static function allCallableType(): Chain;
+ /** @return Chain> */
public static function allCharset(string $charset, string ...$charsets): Chain;
+ /** @return Chain> */
public static function allCnh(): Chain;
+ /** @return Chain> */
public static function allCnpj(): Chain;
+ /** @return Chain> */
public static function allConsonant(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allContains(mixed $containsValue): Chain;
- /** @param non-empty-array $needles */
+ /**
+ * @param non-empty-array $needles
+ * @return Chain>
+ */
public static function allContainsAny(array $needles): Chain;
+ /** @return Chain> */
public static function allContainsCount(mixed $containsValue, int $count): Chain;
+ /** @return Chain> */
public static function allControl(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allCountable(): Chain;
- /** @param "alpha-2"|"alpha-3"|"numeric" $set */
+ /**
+ * @param "alpha-2"|"alpha-3"|"numeric" $set
+ * @return Chain>
+ */
public static function allCountryCode(string $set = 'alpha-2'): Chain;
+ /** @return Chain> */
public static function allCpf(): Chain;
+ /** @return Chain> */
public static function allCreditCard(string $brand = 'Any'): Chain;
- /** @param "alpha-3"|"numeric" $set */
+ /**
+ * @param "alpha-3"|"numeric" $set
+ * @return Chain>
+ */
public static function allCurrencyCode(string $set = 'alpha-3'): Chain;
+ /** @return Chain> */
public static function allDate(string $format = 'Y-m-d'): Chain;
+ /** @return Chain> */
public static function allDateTime(string|null $format = null): Chain;
- /** @param "years"|"months"|"days"|"hours"|"minutes"|"seconds"|"microseconds" $type */
+ /**
+ * @param "years"|"months"|"days"|"hours"|"minutes"|"seconds"|"microseconds" $type
+ * @return Chain>
+ */
public static function allDateTimeDiff(string $type, Validator $validator, string|null $format = null, DateTimeImmutable|null $now = null): Chain;
+ /** @return Chain> */
public static function allDecimal(int $decimals): Chain;
+ /** @return Chain> */
public static function allDigit(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allDirectory(): Chain;
+ /** @return Chain> */
public static function allDomain(bool $tldCheck = true): Chain;
+ /** @return Chain */
public static function allEach(Validator $validator): Chain;
+ /** @return Chain */
public static function allEachKey(Validator $validator): Chain;
+ /** @return Chain> */
public static function allEmail(): Chain;
+ /** @return Chain> */
public static function allEmoji(): Chain;
+ /** @return Chain> */
public static function allEndsWith(mixed $endValue, mixed ...$endValues): Chain;
+ /** @return Chain */
public static function allEquals(mixed $compareTo): Chain;
+ /** @return Chain */
public static function allEquivalent(mixed $compareTo): Chain;
+ /** @return Chain> */
public static function allEven(): Chain;
+ /** @return Chain> */
public static function allExecutable(): Chain;
+ /** @return Chain> */
public static function allExtension(string $extension): Chain;
+ /** @return Chain */
public static function allFactor(int $dividend): Chain;
- /** @param callable(mixed): Validator $factory */
+ /**
+ * @param callable(mixed): Validator $factory
+ * @return Chain
+ */
public static function allFactory(callable $factory): Chain;
+ /** @return Chain> */
public static function allFalseVal(): Chain;
+ /** @return Chain */
public static function allFalsy(): Chain;
+ /** @return Chain> */
public static function allFile(): Chain;
+ /** @return Chain> */
public static function allFinite(): Chain;
+ /** @return Chain> */
public static function allFloatType(): Chain;
+ /** @return Chain> */
public static function allFloatVal(): Chain;
+ /** @return Chain> */
public static function allFormat(Formatter $formatter): Chain;
+ /** @return Chain */
public static function allGiven(Validator $when, Validator $then): Chain;
+ /** @return Chain> */
public static function allGraph(string ...$additionalChars): Chain;
+ /** @return Chain */
public static function allGreaterThan(mixed $compareTo): Chain;
+ /** @return Chain */
public static function allGreaterThanOrEqual(mixed $compareTo): Chain;
+ /** @return Chain> */
public static function allHetu(): Chain;
+ /** @return Chain> */
public static function allHexRgbColor(): Chain;
+ /** @return Chain> */
public static function allIban(): Chain;
+ /** @return Chain */
public static function allIdentical(mixed $compareTo): Chain;
+ /** @return Chain> */
public static function allImage(): Chain;
+ /** @return Chain> */
public static function allImei(): Chain;
+ /** @return Chain */
public static function allIn(mixed $haystack): Chain;
+ /** @return Chain> */
public static function allInfinite(): Chain;
- /** @param class-string $class */
+ /**
+ * @param class-string $class
+ * @return Chain
+ */
public static function allInstance(string $class): Chain;
+ /** @return Chain> */
public static function allIntType(): Chain;
+ /** @return Chain> */
public static function allIntVal(): Chain;
+ /** @return Chain> */
public static function allIp(string $range = '*', int|null $options = null): Chain;
+ /** @return Chain> */
public static function allIsbn(): Chain;
+ /** @return Chain> */
public static function allIterableType(): Chain;
+ /** @return Chain> */
public static function allIterableVal(): Chain;
+ /** @return Chain> */
public static function allJson(): Chain;
- /** @param "alpha-2"|"alpha-3" $set */
+ /**
+ * @param "alpha-2"|"alpha-3" $set
+ * @return Chain>
+ */
public static function allLanguageCode(string $set = 'alpha-2'): Chain;
+ /** @return Chain> */
public static function allLeapDate(string $format): Chain;
+ /** @return Chain> */
public static function allLeapYear(): Chain;
+ /** @return Chain */
public static function allLength(Validator $validator): Chain;
+ /** @return Chain */
public static function allLessThan(mixed $compareTo): Chain;
+ /** @return Chain */
public static function allLessThanOrEqual(mixed $compareTo): Chain;
+ /** @return Chain> */
public static function allLowercase(): Chain;
+ /** @return Chain> */
public static function allLuhn(): Chain;
+ /** @return Chain> */
public static function allMacAddress(): Chain;
+ /** @return Chain */
public static function allMax(Validator $validator): Chain;
+ /** @return Chain> */
public static function allMimetype(string $mimetype): Chain;
+ /** @return Chain */
public static function allMin(Validator $validator): Chain;
+ /** @return Chain */
public static function allMultiple(int $multipleOf): Chain;
+ /** @return Chain> */
public static function allNegative(): Chain;
+ /** @return Chain> */
public static function allNfeAccessKey(): Chain;
+ /** @return Chain> */
public static function allNif(): Chain;
+ /** @return Chain> */
public static function allNip(): Chain;
+ /** @return Chain */
public static function allNoneOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain */
public static function allNot(Validator $validator): Chain;
+ /** @return Chain> */
public static function allNullType(): Chain;
+ /** @return Chain> */
public static function allNumber(): Chain;
+ /** @return Chain> */
public static function allNumericVal(): Chain;
+ /** @return Chain> */
public static function allObjectType(): Chain;
+ /** @return Chain> */
public static function allOdd(): Chain;
+ /** @return Chain */
public static function allOneOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain> */
public static function allPesel(): Chain;
+ /** @return Chain> */
public static function allPhone(string|null $countryCode = null): Chain;
+ /** @return Chain> */
public static function allPis(): Chain;
+ /** @return Chain> */
public static function allPolishIdCard(): Chain;
+ /** @return Chain> */
public static function allPortugueseNif(): Chain;
+ /** @return Chain> */
public static function allPositive(): Chain;
+ /** @return Chain> */
public static function allPostalCode(string $countryCode, bool $formatted = false): Chain;
+ /** @return Chain> */
public static function allPrintable(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allPublicDomainSuffix(): Chain;
+ /** @return Chain> */
public static function allPunct(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allReadable(): Chain;
+ /** @return Chain> */
public static function allRegex(string $regex): Chain;
+ /** @return Chain> */
public static function allResourceType(): Chain;
+ /** @return Chain> */
public static function allRoman(): Chain;
+ /** @return Chain */
public static function allSatisfies(callable $callback, mixed ...$arguments): Chain;
+ /** @return Chain> */
public static function allScalarVal(): Chain;
+ /** @return Chain */
public static function allShortCircuit(Validator ...$validators): Chain;
- /** @param "B"|"KB"|"MB"|"GB"|"TB"|"PB"|"EB"|"ZB"|"YB" $unit */
+ /**
+ * @param "B"|"KB"|"MB"|"GB"|"TB"|"PB"|"EB"|"ZB"|"YB" $unit
+ * @return Chain>
+ */
public static function allSize(string $unit, Validator $validator): Chain;
+ /** @return Chain> */
public static function allSlug(): Chain;
+ /** @return Chain> */
public static function allSorted(string $direction): Chain;
+ /** @return Chain> */
public static function allSpace(string ...$additionalChars): Chain;
+ /** @return Chain> */
public static function allSpaced(): Chain;
+ /** @return Chain> */
public static function allStartsWith(mixed $startValue, mixed ...$startValues): Chain;
+ /** @return Chain> */
public static function allStringType(): Chain;
+ /** @return Chain> */
public static function allStringVal(): Chain;
+ /** @return Chain> */
public static function allSubdivisionCode(string $countryCode): Chain;
- /** @param mixed[] $superset */
+ /**
+ * @param mixed[] $superset
+ * @return Chain>
+ */
public static function allSubset(array $superset): Chain;
+ /** @return Chain> */
public static function allSymbolicLink(): Chain;
+ /** @return Chain> */
public static function allTime(string $format = 'H:i:s'): Chain;
+ /** @return Chain> */
public static function allTld(): Chain;
+ /** @return Chain> */
public static function allTrimmed(string ...$trimValues): Chain;
+ /** @return Chain> */
public static function allTrueVal(): Chain;
+ /** @return Chain> */
public static function allUndef(): Chain;
+ /** @return Chain> */
public static function allUnique(): Chain;
+ /** @return Chain> */
public static function allUppercase(): Chain;
+ /** @return Chain> */
public static function allUrl(): Chain;
+ /** @return Chain> */
public static function allUuid(int|null $version = null): Chain;
+ /** @return Chain> */
public static function allVersion(): Chain;
+ /** @return Chain> */
public static function allVowel(string ...$additionalChars): Chain;
+ /** @return Chain */
public static function allWhen(Validator $when, Validator $then, Validator|null $else = null): Chain;
+ /** @return Chain> */
public static function allWritable(): Chain;
+ /** @return Chain> */
public static function allXdigit(string ...$additionalChars): Chain;
}
diff --git a/src/Mixins/AllChain.php b/src/Mixins/AllChain.php
index 521337b09..d62485a21 100644
--- a/src/Mixins/AllChain.php
+++ b/src/Mixins/AllChain.php
@@ -17,300 +17,462 @@
interface AllChain
{
+ /** @return Chain */
public function allAfter(callable $callable, Validator $validator): Chain;
+ /** @return Chain */
public function allAllOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain */
public function allAlnum(string ...$additionalChars): Chain;
+ /** @return Chain */
public function allAlpha(string ...$additionalChars): Chain;
+ /** @return Chain */
public function allAlwaysInvalid(): Chain;
+ /** @return Chain */
public function allAlwaysValid(): Chain;
+ /** @return Chain */
public function allAnyOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain */
public function allArrayType(): Chain;
+ /** @return Chain */
public function allArrayVal(): Chain;
+ /** @return Chain */
public function allBase(int $base, string $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'): Chain;
+ /** @return Chain */
public function allBase64(): Chain;
+ /** @return Chain */
public function allBetween(mixed $minValue, mixed $maxValue): Chain;
+ /** @return Chain */
public function allBetweenExclusive(mixed $minimum, mixed $maximum): Chain;
+ /** @return Chain */
public function allBlank(): Chain;
+ /** @return Chain */
public function allBoolType(): Chain;
+ /** @return Chain */
public function allBoolVal(): Chain;
+ /** @return Chain */
public function allBsn(): Chain;
+ /** @return Chain */
public function allCallableType(): Chain;
+ /** @return Chain */
public function allCharset(string $charset, string ...$charsets): Chain;
+ /** @return Chain */
public function allCnh(): Chain;
+ /** @return Chain */
public function allCnpj(): Chain;
+ /** @return Chain */
public function allConsonant(string ...$additionalChars): Chain;
+ /** @return Chain */
public function allContains(mixed $containsValue): Chain;
- /** @param non-empty-array $needles */
+ /**
+ * @param non-empty-array $needles
+ * @return Chain
+ */
public function allContainsAny(array $needles): Chain;
+ /** @return Chain */
public function allContainsCount(mixed $containsValue, int $count): Chain;
+ /** @return Chain */
public function allControl(string ...$additionalChars): Chain;
+ /** @return Chain */
public function allCountable(): Chain;
- /** @param "alpha-2"|"alpha-3"|"numeric" $set */
+ /**
+ * @param "alpha-2"|"alpha-3"|"numeric" $set
+ * @return Chain
+ */
public function allCountryCode(string $set = 'alpha-2'): Chain;
+ /** @return Chain */
public function allCpf(): Chain;
+ /** @return Chain */
public function allCreditCard(string $brand = 'Any'): Chain;
- /** @param "alpha-3"|"numeric" $set */
+ /**
+ * @param "alpha-3"|"numeric" $set
+ * @return Chain
+ */
public function allCurrencyCode(string $set = 'alpha-3'): Chain;
+ /** @return Chain */
public function allDate(string $format = 'Y-m-d'): Chain;
+ /** @return Chain */
public function allDateTime(string|null $format = null): Chain;
- /** @param "years"|"months"|"days"|"hours"|"minutes"|"seconds"|"microseconds" $type */
+ /**
+ * @param "years"|"months"|"days"|"hours"|"minutes"|"seconds"|"microseconds" $type
+ * @return Chain
+ */
public function allDateTimeDiff(string $type, Validator $validator, string|null $format = null, DateTimeImmutable|null $now = null): Chain;
+ /** @return Chain */
public function allDecimal(int $decimals): Chain;
+ /** @return Chain */
public function allDigit(string ...$additionalChars): Chain;
+ /** @return Chain */
public function allDirectory(): Chain;
+ /** @return Chain */
public function allDomain(bool $tldCheck = true): Chain;
+ /** @return Chain */
public function allEach(Validator $validator): Chain;
+ /** @return Chain */
public function allEachKey(Validator $validator): Chain;
+ /** @return Chain */
public function allEmail(): Chain;
+ /** @return Chain */
public function allEmoji(): Chain;
+ /** @return Chain */
public function allEndsWith(mixed $endValue, mixed ...$endValues): Chain;
+ /** @return Chain */
public function allEquals(mixed $compareTo): Chain;
+ /** @return Chain */
public function allEquivalent(mixed $compareTo): Chain;
+ /** @return Chain */
public function allEven(): Chain;
+ /** @return Chain */
public function allExecutable(): Chain;
+ /** @return Chain */
public function allExtension(string $extension): Chain;
+ /** @return Chain */
public function allFactor(int $dividend): Chain;
- /** @param callable(mixed): Validator $factory */
+ /**
+ * @param callable(mixed): Validator $factory
+ * @return Chain
+ */
public function allFactory(callable $factory): Chain;
+ /** @return Chain */
public function allFalseVal(): Chain;
+ /** @return Chain */
public function allFalsy(): Chain;
+ /** @return Chain */
public function allFile(): Chain;
+ /** @return Chain */
public function allFinite(): Chain;
+ /** @return Chain */
public function allFloatType(): Chain;
+ /** @return Chain */
public function allFloatVal(): Chain;
+ /** @return Chain */
public function allFormat(Formatter $formatter): Chain;
+ /** @return Chain */
public function allGiven(Validator $when, Validator $then): Chain;
+ /** @return Chain */
public function allGraph(string ...$additionalChars): Chain;
+ /** @return Chain */
public function allGreaterThan(mixed $compareTo): Chain;
+ /** @return Chain */
public function allGreaterThanOrEqual(mixed $compareTo): Chain;
+ /** @return Chain */
public function allHetu(): Chain;
+ /** @return Chain */
public function allHexRgbColor(): Chain;
+ /** @return Chain */
public function allIban(): Chain;
+ /** @return Chain */
public function allIdentical(mixed $compareTo): Chain;
+ /** @return Chain */
public function allImage(): Chain;
+ /** @return Chain */
public function allImei(): Chain;
+ /** @return Chain */
public function allIn(mixed $haystack): Chain;
+ /** @return Chain */
public function allInfinite(): Chain;
- /** @param class-string $class */
+ /**
+ * @param class-string $class
+ * @return Chain
+ */
public function allInstance(string $class): Chain;
+ /** @return Chain */
public function allIntType(): Chain;
+ /** @return Chain */
public function allIntVal(): Chain;
+ /** @return Chain */
public function allIp(string $range = '*', int|null $options = null): Chain;
+ /** @return Chain */
public function allIsbn(): Chain;
+ /** @return Chain */
public function allIterableType(): Chain;
+ /** @return Chain */
public function allIterableVal(): Chain;
+ /** @return Chain */
public function allJson(): Chain;
- /** @param "alpha-2"|"alpha-3" $set */
+ /**
+ * @param "alpha-2"|"alpha-3" $set
+ * @return Chain
+ */
public function allLanguageCode(string $set = 'alpha-2'): Chain;
+ /** @return Chain */
public function allLeapDate(string $format): Chain;
+ /** @return Chain */
public function allLeapYear(): Chain;
+ /** @return Chain */
public function allLength(Validator $validator): Chain;
+ /** @return Chain */
public function allLessThan(mixed $compareTo): Chain;
+ /** @return Chain */
public function allLessThanOrEqual(mixed $compareTo): Chain;
+ /** @return Chain */
public function allLowercase(): Chain;
+ /** @return Chain */
public function allLuhn(): Chain;
+ /** @return Chain */
public function allMacAddress(): Chain;
+ /** @return Chain */
public function allMax(Validator $validator): Chain;
+ /** @return Chain */
public function allMimetype(string $mimetype): Chain;
+ /** @return Chain */
public function allMin(Validator $validator): Chain;
+ /** @return Chain */
public function allMultiple(int $multipleOf): Chain;
+ /** @return Chain */
public function allNegative(): Chain;
+ /** @return Chain */
public function allNfeAccessKey(): Chain;
+ /** @return Chain */
public function allNif(): Chain;
+ /** @return Chain */
public function allNip(): Chain;
+ /** @return Chain */
public function allNoneOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain */
public function allNot(Validator $validator): Chain;
+ /** @return Chain */
public function allNullType(): Chain;
+ /** @return Chain */
public function allNumber(): Chain;
+ /** @return Chain */
public function allNumericVal(): Chain;
+ /** @return Chain */
public function allObjectType(): Chain;
+ /** @return Chain */
public function allOdd(): Chain;
+ /** @return Chain */
public function allOneOf(Validator $validator1, Validator $validator2, Validator ...$validators): Chain;
+ /** @return Chain */
public function allPesel(): Chain;
+ /** @return Chain