API / Minn\Support / KsesValues

KsesValues final class

Minn\Support\KsesValues · public/minn/src/Minn/Support/KsesValues.php · 38 lines

The value rules an allowlist attribute may carry, as the reference judges them: lengths count bytes, bounds need a whole number (up to six digits, up to six spaces either side), "valueless" compares the attribute's form, "values" compares without case, and a callback decides for itself. A rule the reference does not know passes. Where the reference fatals (a values rule that is not a list, a callback that does not exist) the value fails.

Public

staticsatisfies(string $value, string $valueless, array $rules): bool#

Whether a value meets every rule its attribute carries; "required" is the tag's concern, so it is skipped here.

$rulesarray<array-key, mixed>
staticcheck(string $value, string $valueless, string $rule, mixed $expected): bool#

One rule against one value; $valueless is "y" for a bare attribute and "n" for one with a value.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatewholeNumber(string $value): bool#