Classes
Validation expression language engine.
Exception class.
Exception thrown when validation rule execution fails.
Exception thrown when a bitwise expression is invalid.
Exception thrown when an attempt is made to create a rule alias that is invalid.
Exception thrown when rule definition is invalid.
Exception thrown when an attempt is made to create a rule macro that is invalid.
Exception thrown when rule statement is invalid.
Exception thrown when a validation expression is invalid.
Exception thrown when attempt is made to execute an unknown validation rule.
Exception thrown when validation is not successful or failed.
Exception thrown when validation is impossible or validation expression is illogical.
Validator throwable interface.
Generates rule constraints classes and markdown table by extracting rules from Validation::class
metadata.
Result class.
Rule definition class.
Validation rule names and aliases constants.
Inspector class.
Memoizer class.
Serializer class.
Holder for various miscellaneous utility function.
Mighty throwable interface.
Validator aware validation expression builder.
Validates any data using the passed validation expression.
Validates any data using a callback function.
Validates any data by compining a set of constraints to build up a Validation Expression.
Validates any data using a single validation rule.
Adds accepted
rule. Asserts that the input is accepted (equals: "on", "yes", "yeah", "yep", "yo", "ok", "okay", "aye", 1 or "1", true or "true") note that strings are treated in a case-insensitive manner.
Adds allowed
rule. Asserts that the input is allowed (can be empty or have any value, null and empty string are considered valid values).
Adds alnum
rule. Asserts that the input consists of alphanumeric characters only.
Adds alpha
rule. Asserts that the input consists of alphabetic characters only.
Adds amount
rule. Asserts that the input contains only numbers, an optional decimal point (comma or dot), and an optional minus (used for amounts of money for example).
Adds amount.dollar
rule. Asserts that the input is a validly formatted amount of USD, where decimal point and thousands separator are optional.
Adds amount.euro
rule. Asserts that the input is a validly formatted amount of EUR, where decimal point and thousands separator are optional.
Adds arr
rule. An alias for the array
rule.
Adds array
rule. Asserts that the input is an array.
Adds array.hasDistinct
rule. Asserts that the input is a multidimensional array that contains distinct values of the given key.
Adds array.hasKey
rule. Asserts that the input array has the given key.
Adds array.hasValue
rule. Asserts that the input array contains the given value. Works with scalar types.
Adds array.isAssociative
rule. Asserts that the input is an associative array.
Adds array.isSequential
rule. Asserts that the input is a sequential array.
Adds array.isUnique
rule. Asserts that the input array contains unique values. Works only with one-dimensional arrays.
Adds array.subset
rule. Asserts that the input is an array that contains the given subset. Note that this check applies only to the first dimension of the array.
Adds ascii
rule. Asserts that the input is a string containing only ASCII characters (ASCII compliant string).
Adds assert
rule. An alias for the if
rule.
Adds assert.equals
rule. An alias for the if.eq
rule.
Adds assert.greaterThan
rule. An alias for the if.gt
rule.
Adds assert.greaterThanOrEquals
rule. An alias for the if.gte
rule.
Adds assert.lessThan
rule. An alias for the if.lt
rule.
Adds assert.lessThanOrEquals
rule. An alias for the if.lte
rule.
Adds assert.notEquals
rule. An alias for the if.neq
rule.
Adds base64
rule. Asserts that the input is a valid Base64 encoded string.
Adds between
rule. Asserts that the input count is between the given values. Works with all data types (null: 0; boolean: 0 or 1; float/integer: number value; string: characters count; array/countable: elements count; object: accessible properties count).
Adds bic
rule. Asserts that the input is a valid BIC (Bank Identifier Code).
Adds bit
rule. Asserts that the input is bit (equals: 1 or "1", true; 0 or "0", false).
Adds bit.isOff
rule. Asserts that the input is a turned off bit (equals: false, 0 or "0").
Adds bit.isOn
rule. Asserts that the input is a turned on bit (equals: true, 1 or "1").
Adds blank
rule. An alias for the empty
rule.
Adds bool
rule. An alias for the boolean
rule.
Adds boolean
rule. Asserts that the input is a boolean.
Adds booleanLike
rule. Asserts that the input is value that can be parsed as a boolean (TRUE: true, "true", "1", "on", "yes"; FALSE: false, "false", "0", "off", "no", "", null).
Adds cakeday
rule. An alias for the datetime.birthday
rule.
Adds calender.day
rule. Asserts that the input looks like a calendar dayin shot or long format ("Mon" or "Monday").
Adds calender.month
rule. Asserts that the input looks like a calendar month in shot or long format ("Jan" or "January").
Adds callable
rule. Asserts that the input is a callable.
Adds choice
rule. An alias for the in
rule.
Adds cntrl
rule. Asserts that the input consists of control characters only.
Adds color
rule. Asserts that the input is a valid CSS color (Color Word, HEX, HEX-Alpha, RGB, RGBA, HSL, HSLA).
Adds color.hex
rule. Asserts that the input is a valid CSS HEX color.
Adds color.hexAlpha
rule. Asserts that the input is a valid CSS HEX-Alpha (4 or 8 Chars) color.
Adds color.hexLong
rule. Asserts that the input is a valid CSS 6-Char-HEX color.
Adds color.hexShort
rule. Asserts that the input is a valid CSS 3-Char-HEX color.
Adds color.hsl
rule. Asserts that the input is a valid CSS HSL color.
Adds color.hsl.new
rule. Asserts that the input is a valid CSS4 HSL color.
Adds color.hsla
rule. Asserts that the input is a valid CSS HSLA color.
Adds color.keyword
rule. Asserts that the input is a valid CSS YYY color.
Adds color.rgb
rule. Asserts that the input is a valid CSS RGB color.
Adds color.rgb.new
rule. Asserts that the input is a valid CSS4 RGB color.
Adds color.rgba
rule. Asserts that the input is a valid CSS RGBA color.
Adds count
rule. Asserts that the input count is equal to the given value. Works with all data types (null: 0; boolean: 0 or 1; float/integer: number value; string: characters count; array/countable: elements count; object: accessible properties count).
Adds countable
rule. Asserts that the input is a countable.
Adds country
rule. Asserts that the input is a valid country code (default: "ISO 3166-1 alpha-2"; long: "ISO 3166-1 alpha-3").
Adds creditcard
rule. Asserts that the input is a valid credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.americanExpress
rule. Asserts that the input is a valid American Express credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.chinaUnionPay
rule. Asserts that the input is a valid China UnionPay credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.dinersClub
rule. Asserts that the input is a valid Diners Club credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.discover
rule. Asserts that the input is a valid Discover credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.instaPayment
rule. Asserts that the input is a valid InstaPayment credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.jcb
rule. Asserts that the input is a valid JCB credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.laser
rule. Asserts that the input is a valid Laser credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.maestro
rule. Asserts that the input is a valid Maestro credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.mastercard
rule. Asserts that the input is a valid Mastercard credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.mir
rule. Asserts that the input is a valid MIR Payment System card number, balanced spaces and/or dashes are allowed.
Adds creditcard.uatp
rule. Asserts that the input is a valid UATP credit card number, balanced spaces and/or dashes are allowed.
Adds creditcard.visa
rule. Asserts that the input is a valid Visa credit card number, balanced spaces and/or dashes are allowed.
Adds currency
rule. Asserts that the input is a valid currency code (default: "ISO 4217 alpha"; numeric: "ISO 4217 numeric").
Adds currency.name
rule. Asserts that the input is a valid currency name (as in ISO 4217).
Adds cvv
rule. Asserts that the input is a valid CVV (Card Security Code).
Adds date
rule. An alias for the datetime
rule.
Adds date.after
rule. An alias for the datetime.gt
rule.
Adds date.afterOrEquals
rule. An alias for the datetime.gte
rule.
Adds date.before
rule. An alias for the datetime.lt
rule.
Adds date.beforeOrEquals
rule. An alias for the datetime.lte
rule.
Adds date.equals
rule. An alias for the datetime.eq
rule.
Adds date.format
rule. An alias for the datetime.format
rule.
Adds datestamp
rule. Asserts that the input looks like a human datestamp, DMY or MDY format, separated with dot, dash, or slash.
Adds datestamp.dmy
rule. Asserts that the input looks like a human DMY-formatted datestamp, separated with dot, dash, or slash.
Adds datestamp.mdy
rule. Asserts that the input looks like a human MDY-formatted datestamp, separated with dot, dash, or slash.
Adds datestamp.ymd
rule. Asserts that the input looks like a human YMD-formatted datestamp, separated with dot, dash, or slash.
Adds datetime
rule. Asserts that the input is a valid datetime string/object.
Adds datetime.birthday
rule. Asserts that the input is a datetime string/object that has birthday today. Input should preferably be in "YYYY-MM-DD" format.
Adds datetime.eq
rule. Asserts that the input is a datetime string/object equal to the given datetime string.
Adds datetime.format
rule. Asserts that the input is a valid datetime with the given format.
Adds datetime.format.global
rule. Asserts that the input looks like a valid global datetime string as defined in the HTML5 specification.
Adds datetime.format.local
rule. Asserts that the input looks like a valid local datetime string as defined in the HTML5 specification.
Adds datetime.gt
rule. Asserts that the input is a datetime string/object greater than (after) the given datetime string.
Adds datetime.gte
rule. Asserts that the input is a datetime string/object greater than (after) or equal to the given datetime string.
Adds datetime.lt
rule. Asserts that the input is a datetime string/object less than (before) the given datetime string.
Adds datetime.lte
rule. Asserts that the input is a datetime string/object less than (before) or equal to the given datetime string.
Adds declined
rule. Asserts that the input is declined (equals: "off", "no", "not", "nope", "neh", "nay", 0 or "0", false or "false") note that strings are treated in a case-insensitive manner.
Adds digit
rule. Asserts that the input consists of a digits only (numeric characters).
Adds domain
rule. Asserts that the input is a domain.
Adds domain.isActive
rule. Asserts that the input is an active domain. Works with domains and emails.
Adds double
rule. An alias for the float
rule.
Adds email
rule. Asserts that the input is an email address.
Adds email.withUnicode
rule. Asserts that the input is an email address (unicode allowed).
Adds emoji
rule. Asserts that the input contains an emoji.
Adds empty
rule. Asserts that the input is empty using empty() language construct (is blank, i.e. empty string, empty array, false, null, or 0).
Adds equals
rule. Asserts that the input is equal to the given value. Works with scalar types and null. Comparison operator is "==".
Adds esn
rule. Asserts that the input is a valid ESN (Electronic Serial Number).
Adds file
rule. Asserts that the input is a file (can be a file, a link, or a directory).
Adds file.basename
rule. Asserts that the input is a file and its basename is equal to the given basename.
Adds file.dirname
rule. Asserts that the input is a file and its dirname is equal to the given dirname.
Adds file.extension
rule. Asserts that the input is a file and its extension is equal to the given extension.
Adds file.filename
rule. Asserts that the input is a file and its filename is equal to the given filename.
Adds file.isDirectory
rule. Asserts that the input is a directory.
Adds file.isExecutable
rule. Asserts that the input is a file and is executable.
Adds file.isFile
rule. Asserts that the input is a file.
Adds file.isLink
rule. Asserts that the input is a link.
Adds file.isReadable
rule. Asserts that the input is a file and is readable.
Adds file.isUploaded
rule. Asserts that the input is a file that is uploaded via HTTP POST.
Adds file.isWritable
rule. Asserts that the input is a file and is writable.
Adds file.mime
rule. Asserts that the input is a file and its MIME type is one of the given MIME types.
Adds file.size
rule. Asserts that the input is a file and the size is equal to the given size in bytes.
Adds file.size.gte
rule. Asserts that the input is a file and the size is greater than or equal to the given size in bytes.
Adds file.size.lte
rule. Asserts that the input is a file and the size is less than or equal to the given size in bytes.
Adds filled
rule. An alias for the required
rule.
Adds float
rule. Asserts that the input is a float.
Adds floatLike
rule. Asserts that the input is a value that can be parsed as a float within the specifed range.
Adds floatLike.allowThousands
rule. Asserts that the input is a value that can be parsed as a float within the specifed range.
Adds forbidden
rule. Asserts that the input is forbidden (is null or not present).
Adds geolocation
rule. Asserts that the input is a valid geolocation (latitude and longitude coordinates combination).
Adds graph
rule. Asserts that the input consists of graphic characters only (characters that create a visible output).
Adds iban
rule. Asserts that the input is a valid IBAN (International Bank Account Number). The "ISO 3166-1 alpha-2" country code can be specifed to narrow the pattern.
Adds if
rule. Checks the condition between the first argument and the second argument, the condition operator can also be specified as the third argument.
Adds if.eq
rule. Checks the condition between the first argument and the second argument, the condition operator is "==".
Adds if.gt
rule. Checks the condition between the first argument and the second argument, the condition operator is ">".
Adds if.gte
rule. Checks the condition between the first argument and the second argument, the condition operator is ">=".
Adds if.id
rule. Checks the condition between the first argument and the second argument, the condition operator is "===".
Adds if.lt
rule. Checks the condition between the first argument and the second argument, the condition operator is "<".
Adds if.lte
rule. Checks the condition between the first argument and the second argument, the condition operator is "<=".
Adds if.neq
rule. Checks the condition between the first argument and the second argument, the condition operator is "!=".
Adds if.nid
rule. Checks the condition between the first argument and the second argument, the condition operator is "!==".
Adds image
rule. Asserts that the input is an image file (jpg, jpeg, png, gif, bmp, svg, or webp).
Adds image.dimensions
rule. Asserts that the input is an image and its dimensions are less than, equal to, or greater than the given width and height in pixels.
Adds image.height
rule. Asserts that the input is an image and its height is equal to the given height in pixels.
Adds image.height.gte
rule. Asserts that the input is an image and its height is greater than or equal to the given height in pixels.
Adds image.height.lte
rule. Asserts that the input is an image and its height is less than or equal to the given height in pixels.
Adds image.ratio
rule. Asserts that the input is an image and its aspect ratio is equal to the given ratio (ratio must be specified like "16:9").
Adds image.width
rule. Asserts that the input is an image and its width is equal to the given width in pixels.
Adds image.width.gte
rule. Asserts that the input is an image and its width is greater than or equal to the given width in pixels.
Adds image.width.lte
rule. Asserts that the input is an image and its width is less than or equal to the given width in pixels.
Adds imei
rule. Asserts that the input is a valid IMEI (International Mobile Station Equipment Identity Number).
Adds imei.sv
rule. Asserts that the input is a valid IMEI-SV (International Mobile Station Equipment Identity and Software Version Number).
Adds in
rule. Asserts that the input is in the given values. Works with scalar types and null.
Adds int
rule. An alias for the integer
rule.
Adds integer
rule. Asserts that the input is an integer.
Adds integerLike
rule. Asserts that the input is a value that can be parsed as an integer within the specifed range.
Adds integerLike.allowHex
rule. Asserts that the input is a value that can be parsed as an integer within the specifed range and can be in hexadecimal notation.
Adds integerLike.allowOctal
rule. Asserts that the input is a value that can be parsed as an integer within the specifed range and can be in octal notation.
Adds ip
rule. Asserts that the input is an IP address.
Adds ip.notPrivate
rule. Asserts that the input is an IP address not within private IPs range.
Adds ip.notReserved
rule. Asserts that the input is an IP address not within reserved IPs range.
Adds ip.v4
rule. Asserts that the input is an IPv4 address.
Adds ip.v6
rule. Asserts that the input is an IPv6 address.
Adds is
rule. An alias for the equals
rule.
Adds isbn
rule. Asserts that the input is a valid ISBN (International Standard Book Number). The type (10/13) can be specifed to narrow the pattern.
Adds isin
rule. Asserts that the input is a valid ISIN (International Securities Identification Number).
Adds issn
rule. Asserts that the input is a valid ISSN (International Standard Serial Number).
Adds iterable
rule. Asserts that the input is an iterable.
Adds json
rule. Asserts that the input is a valid JSON.
Adds language
rule. Asserts that the input is a valid language code (default: "ISO 639-1"; long: "ISO 639-2/T").
Adds length
rule. An alias for the count
rule.
Adds locale
rule. Asserts that the input is a valid locale identifier (default: [ISO 639-1] or [ISO 639-1][ISO 3166-1 alpha-2], case-insensitive, input is canonicalized before checking (dashes to underscores, no dots or charset); strict: [ISO 639-1] or [ISO 639-1][ISO 3166-1 alpha-2], case-sensitive without canonicalization.
Adds long
rule. An alias for the integer
rule.
Adds lower
rule. Asserts that the input consists of lowercase characters only.
Adds luhn
rule. Asserts that the input passes the Luhn Algorithm check. This rule is mostly used in conjunction with other rules like credit card numbers and identifiers to further check the validity of the subject.
Adds mac
rule. Asserts that the input is a MAC address.
Adds matches
rule. Asserts that the input matches the given pattern. Works with strings only.
Adds max
rule. Asserts that the input count is less than or equal to the given value. Works with all data types (null: 0; boolean: 0 or 1; float/integer: number value; string: characters count; array/countable: elements count; object: accessible properties count).
Adds meid
rule. Asserts that the input is a valid MEID (Mobile Equipment Identifier).
Adds meta
rule. Asserts that the input is a string containing only meta characters (special characters) (i.e. "@, #, $, ...").
Adds min
rule. Asserts that the input count is greater than or equal to the given value. Works with all data types (null: 0; boolean: 0 or 1; float/integer: number value; string: characters count; array/countable: elements count; object: accessible properties count).
Adds minmax
rule. An alias for the between
rule.
Adds nino
rule. Asserts that the input is a valid NINO (UK National Insurance Number).
Adds null
rule. Asserts that the input is null.
Adds number.isEven
rule. Asserts that the input is an even number.
Adds number.isFinite
rule. Asserts that the input is a finite number.
Adds number.isInfinite
rule. Asserts that the input is an infinite number.
Adds number.isMultipleOf
rule. Asserts that the input is a multiple of the given number.
Adds number.isNan
rule. Asserts that the input is a not a number.
Adds number.isNegative
rule. Asserts that the input is a negative number.
Adds number.isOdd
rule. Asserts that the input is an odd number.
Adds number.isPositive
rule. Asserts that the input is a positive number.
Adds numeric
rule. Asserts that the input is numeric.
Adds obj
rule. An alias for the object
rule.
Adds object
rule. Asserts that the input is an object.
Adds object.hasMethod
rule. Asserts that the input has the given method.
Adds object.hasProperty
rule. Asserts that the input has the given property.
Adds object.isInstanceOf
rule. Asserts that the input is an instance of the given class.
Adds object.isStringable
rule. Asserts that the input implements __toString() method.
Adds object.isSubclassOf
rule. Asserts that the input is a subclass of the given class.
Adds optional
rule. An alias for the allowed
rule.
Adds password
rule. Asserts that the input is a valid password (minimum 8 characters, consists of at least one small letter and one capital letter, at least one number, at least one special character, and optionally a space).
Adds pattern
rule. An alias for the matches
rule.
Adds phone
rule. Asserts that the input is a valid phone number (supports: North America, Europe and most Asian and Middle East countries).
Adds php.keyword
rule. Asserts that the input is a PHP language Keyword.
Adds php.reserved
rule. Asserts that the input is a PHP language reserved word.
Adds php.reserved.extra
rule. Asserts that the input is a PHP language reserved word including soft reserved words.
Adds present
rule. An alias for the required
rule.
Adds print
rule. Asserts that the input consists of printable characters only.
Adds punct
rule. Asserts that the input consists of punctuation characters only.
Adds range
rule. An alias for the between
rule.
Adds real
rule. An alias for the float
rule.
Adds regex
rule. Asserts that the input is a valid regular expression.
Adds regexp
rule. Asserts that the input matches a Perl-compatible regular expression.
Adds required
rule. Asserts that the input is required (is not blank, i.e. not a empty string or null).
Adds resource
rule. Asserts that the input is a resource.
Adds roman
rule. Asserts that the input is a valid roman number.
Adds same
rule. An alias for the equals
rule.
Adds scalar
rule. Asserts that the input is a scalar.
Adds serialized
rule. Asserts that the input is a valid PHP serialized data.
Adds sin
rule. Asserts that the input is a valid SIN (CA Social Insurance Number).
Adds size
rule. An alias for the count
rule.
Adds slug
rule. Asserts that the input is a valid slug.
Adds space
rule. Asserts that the input consists of whitespace characters only.
Adds spaceless
rule. Asserts that the input is a string containing no whitespace characters.
Adds ssn
rule. Asserts that the input is a valid SSN (Social Security Number).
Adds str
rule. An alias for the string
rule.
Adds stream
rule. An alias for the resource
rule.
Adds string.charset
rule. Asserts that the input is encoded in one of the given charsets (aliases included). The check is done in a case-sensitive manner.
Adds string
rule. Asserts that the input is a string.
Adds string.contains
rule. Asserts that the input contains the given substring. A second boolean argument can be specified to enable strict mode (case-sensitive).
Adds string.endsWith
rule. Asserts that the input ends with the given substring. A second boolean argument can be specified to enable strict mode (case-sensitive).
Adds string.length
rule. Asserts that the input is a string that is exactly the given length.
Adds string.startsWith
rule. Asserts that the input starts with the given substring. A second boolean argument can be specified to enable strict mode (case-sensitive).
Adds string.wordsCount
rule. Asserts that the input is a string containing exactly the given count of words.
Adds text
rule. Asserts that the input is a string containing letters and punctuation from any language.
Adds timestamp
rule. Asserts that the input looks like a human timestamp, 24 or 12 hours format with or without seconds.
Adds timestamp.12
rule. Asserts that the input looks like a human timestamp, 12 hours format with or without seconds and optional AM/PM..
This is an auto-generated class that was generated programmatically by:
MAKS\Mighty\Maker
Adds timestamp.hm
rule. Asserts that the input looks like a human timestamp, 24 or 12 hours format without seconds.
Adds timestamp.hms
rule. Asserts that the input looks like a human timestamp, 24 or 12 hours format with seconds.
Adds timestamp.ms
rule. Asserts that the input looks like a human timestamp, containing minutes and seconds only.
Adds timezone
rule. Asserts that the input is a valid timezone identifier (default: case-insensitive; strict: case-sensitive).
Adds type
rule. Asserts that the input is one of the given types.
Adds type.debug
rule. Asserts that the input is of the given type using get_debug_type().
Adds upper
rule. Asserts that the input consists of uppercase characters only.
Adds url
rule. Asserts that the input is a URL.
Adds url.withPath
rule. Asserts that the input is a URL that contains a path.
Adds url.withQuery
rule. Asserts that the input is a URL that contains a query.
Adds username
rule. Asserts that the input is a valid username (between 4-32 characters, consists of letters in any case, optionally numbers, optionally one of the following characters "-_." (not consecutive), and must always start with a letter and end with a letter or number).
Adds uuid
rule. Asserts that the input is a valid UUID. The version (v1/v2/v3/v4/v5) can be specifed to narrow the pattern.
Adds version
rule. Asserts that the input is a valid semantic version number.
Adds vin
rule. Asserts that the input is a valid VIN (Vehicle Identification Number).
Adds words
rule. Asserts that the input is a string containing only words and spaces without any other character.
Adds xdigit
rule. Asserts that the input represent hexadecimal digits.
Adds xml
rule. Asserts that the input is a valid XML.
Validates the shape of an array or object (traversable or not).
Validates the validity of a validatable object.
The interface for all validatable objects. See ValidatableObjectTrait
for implementation.
The trait for implementing ValidatableObjectInterface
.
Constraint interface.
Interface for constraints that validate multiple items.
Interface for constraints that validate a single item.
Validatable object constraints validator.
Validation expression builder.
Holder for a collection o f regular expressions.
Provides helpers to unit and backed enums to cast and retrieve names and values in a unified interface.