From 284b2bd17cbd0f9b96769735876d2cbd3591bada Mon Sep 17 00:00:00 2001 From: Damien <damien.burel@maarch.org> Date: Thu, 15 Nov 2018 15:11:25 +0100 Subject: [PATCH] [REFACTORING] composer again --- .../respect/validation/docs/concrete-api.md | 77 +++ .../respect/validation/docs/feature-guide.md | 301 +++++++++++ vendor/respect/validation/docs/index.md | 16 + .../respect/validation/docs/installation.md | 10 + vendor/respect/validation/docs/license.md | 30 ++ .../respect/validation/docs/list-of-rules.md | 329 +++++++++++++ vendor/respect/validation/docs/rules/Age.md | 46 ++ vendor/respect/validation/docs/rules/AllOf.md | 30 ++ vendor/respect/validation/docs/rules/Alnum.md | 44 ++ vendor/respect/validation/docs/rules/Alpha.md | 14 + .../validation/docs/rules/AlwaysInvalid.md | 14 + .../validation/docs/rules/AlwaysValid.md | 14 + .../validation/docs/rules/ArrayType.md | 27 + .../respect/validation/docs/rules/ArrayVal.md | 22 + .../validation/docs/rules/Attribute.md | 33 ++ vendor/respect/validation/docs/rules/Bank.md | 20 + .../validation/docs/rules/BankAccount.md | 20 + .../respect/validation/docs/rules/Between.md | 44 ++ vendor/respect/validation/docs/rules/Bic.md | 20 + .../respect/validation/docs/rules/BoolType.md | 27 + .../respect/validation/docs/rules/BoolVal.md | 31 ++ vendor/respect/validation/docs/rules/Bsn.md | 16 + vendor/respect/validation/docs/rules/Call.md | 51 ++ .../validation/docs/rules/CallableType.md | 25 + .../respect/validation/docs/rules/Callback.md | 21 + .../respect/validation/docs/rules/Charset.md | 19 + vendor/respect/validation/docs/rules/Cnh.md | 15 + vendor/respect/validation/docs/rules/Cnpj.md | 12 + vendor/respect/validation/docs/rules/Cntrl.md | 17 + .../validation/docs/rules/Consonant.md | 18 + .../respect/validation/docs/rules/Contains.md | 28 ++ .../validation/docs/rules/Countable.md | 19 + .../validation/docs/rules/CountryCode.md | 14 + vendor/respect/validation/docs/rules/Cpf.md | 28 ++ .../validation/docs/rules/CreditCard.md | 39 ++ .../validation/docs/rules/CurrencyCode.md | 15 + vendor/respect/validation/docs/rules/Date.md | 40 ++ vendor/respect/validation/docs/rules/Digit.md | 13 + .../validation/docs/rules/Directory.md | 30 ++ .../respect/validation/docs/rules/Domain.md | 40 ++ vendor/respect/validation/docs/rules/Each.md | 27 + vendor/respect/validation/docs/rules/Email.md | 16 + .../respect/validation/docs/rules/EndsWith.md | 31 ++ .../respect/validation/docs/rules/Equals.md | 17 + vendor/respect/validation/docs/rules/Even.md | 17 + .../validation/docs/rules/Executable.md | 23 + .../respect/validation/docs/rules/Exists.md | 30 ++ .../validation/docs/rules/Extension.md | 25 + .../respect/validation/docs/rules/Factor.md | 19 + .../respect/validation/docs/rules/FalseVal.md | 21 + .../validation/docs/rules/Fibonacci.md | 17 + vendor/respect/validation/docs/rules/File.md | 30 ++ .../validation/docs/rules/FilterVar.md | 18 + .../respect/validation/docs/rules/Finite.md | 18 + .../validation/docs/rules/FloatType.md | 25 + .../respect/validation/docs/rules/FloatVal.md | 17 + vendor/respect/validation/docs/rules/Graph.md | 15 + .../validation/docs/rules/HexRgbColor.md | 16 + .../validation/docs/rules/Identical.md | 18 + .../validation/docs/rules/IdentityCard.md | 21 + vendor/respect/validation/docs/rules/Image.md | 32 ++ vendor/respect/validation/docs/rules/Imei.md | 20 + vendor/respect/validation/docs/rules/In.md | 30 ++ .../respect/validation/docs/rules/Infinite.md | 17 + .../respect/validation/docs/rules/Instance.md | 17 + .../respect/validation/docs/rules/IntType.md | 27 + .../respect/validation/docs/rules/IntVal.md | 18 + vendor/respect/validation/docs/rules/Ip.md | 24 + .../respect/validation/docs/rules/Iterable.md | 5 + .../validation/docs/rules/IterableType.md | 20 + vendor/respect/validation/docs/rules/Json.md | 18 + vendor/respect/validation/docs/rules/Key.md | 34 ++ .../validation/docs/rules/KeyNested.md | 40 ++ .../respect/validation/docs/rules/KeySet.md | 51 ++ .../respect/validation/docs/rules/KeyValue.md | 62 +++ .../validation/docs/rules/LanguageCode.md | 20 + .../respect/validation/docs/rules/LeapDate.md | 18 + .../respect/validation/docs/rules/LeapYear.md | 17 + .../respect/validation/docs/rules/Length.md | 44 ++ .../validation/docs/rules/Lowercase.md | 14 + .../validation/docs/rules/MacAddress.md | 17 + vendor/respect/validation/docs/rules/Max.md | 36 ++ .../respect/validation/docs/rules/Mimetype.md | 25 + vendor/respect/validation/docs/rules/Min.md | 29 ++ .../validation/docs/rules/MinimumAge.md | 23 + .../respect/validation/docs/rules/Multiple.md | 14 + .../respect/validation/docs/rules/Negative.md | 14 + .../validation/docs/rules/NfeAccessKey.md | 16 + vendor/respect/validation/docs/rules/No.md | 24 + .../validation/docs/rules/NoWhitespace.md | 21 + .../respect/validation/docs/rules/NoneOf.md | 21 + vendor/respect/validation/docs/rules/Not.md | 24 + .../respect/validation/docs/rules/NotBlank.md | 34 ++ .../respect/validation/docs/rules/NotEmpty.md | 42 ++ .../validation/docs/rules/NotOptional.md | 39 ++ .../respect/validation/docs/rules/NullType.md | 25 + .../respect/validation/docs/rules/Numeric.md | 18 + .../validation/docs/rules/ObjectType.md | 24 + vendor/respect/validation/docs/rules/Odd.md | 17 + vendor/respect/validation/docs/rules/OneOf.md | 25 + .../respect/validation/docs/rules/Optional.md | 21 + .../validation/docs/rules/PerfectSquare.md | 16 + vendor/respect/validation/docs/rules/Pesel.md | 12 + vendor/respect/validation/docs/rules/Phone.md | 22 + .../respect/validation/docs/rules/PhpLabel.md | 24 + .../respect/validation/docs/rules/Positive.md | 14 + .../validation/docs/rules/PostalCode.md | 22 + .../validation/docs/rules/PrimeNumber.md | 16 + vendor/respect/validation/docs/rules/Prnt.md | 15 + vendor/respect/validation/docs/rules/Punct.md | 17 + .../respect/validation/docs/rules/Readable.md | 23 + vendor/respect/validation/docs/rules/Regex.md | 21 + .../validation/docs/rules/ResourceType.md | 21 + vendor/respect/validation/docs/rules/Roman.md | 16 + .../validation/docs/rules/ScalarVal.md | 15 + vendor/respect/validation/docs/rules/Sf.md | 19 + vendor/respect/validation/docs/rules/Size.md | 48 ++ vendor/respect/validation/docs/rules/Slug.md | 17 + vendor/respect/validation/docs/rules/Space.md | 15 + .../validation/docs/rules/StartsWith.md | 31 ++ .../validation/docs/rules/StringType.md | 22 + .../validation/docs/rules/SubdivisionCode.md | 284 +++++++++++ .../validation/docs/rules/SymbolicLink.md | 23 + vendor/respect/validation/docs/rules/Tld.md | 17 + .../respect/validation/docs/rules/TrueVal.md | 21 + vendor/respect/validation/docs/rules/Type.md | 31 ++ .../respect/validation/docs/rules/Uploaded.md | 23 + .../validation/docs/rules/Uppercase.md | 14 + vendor/respect/validation/docs/rules/Url.md | 24 + .../respect/validation/docs/rules/Version.md | 16 + .../respect/validation/docs/rules/VideoUrl.md | 35 ++ vendor/respect/validation/docs/rules/Vowel.md | 17 + vendor/respect/validation/docs/rules/When.md | 24 + .../respect/validation/docs/rules/Writable.md | 23 + .../respect/validation/docs/rules/Xdigit.md | 22 + vendor/respect/validation/docs/rules/Yes.md | 23 + vendor/respect/validation/docs/rules/Zend.md | 17 + vendor/setasign/fpdi/src/FpdfTplTrait.php | 466 ++++++++++++++++++ vendor/setasign/fpdi/src/Tcpdf/Fpdi.php | 260 ++++++++++ vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php | 99 ++++ vendor/setasign/fpdi/src/Tfpdf/Fpdi.php | 158 ++++++ vendor/slim/slim/Slim/Http/StatusCode.php | 81 +++ .../Resources/unidata/titleCaseRegexp.php | 5 + 143 files changed, 5176 insertions(+) create mode 100644 vendor/respect/validation/docs/concrete-api.md create mode 100644 vendor/respect/validation/docs/feature-guide.md create mode 100644 vendor/respect/validation/docs/index.md create mode 100644 vendor/respect/validation/docs/installation.md create mode 100644 vendor/respect/validation/docs/license.md create mode 100644 vendor/respect/validation/docs/list-of-rules.md create mode 100644 vendor/respect/validation/docs/rules/Age.md create mode 100644 vendor/respect/validation/docs/rules/AllOf.md create mode 100644 vendor/respect/validation/docs/rules/Alnum.md create mode 100644 vendor/respect/validation/docs/rules/Alpha.md create mode 100644 vendor/respect/validation/docs/rules/AlwaysInvalid.md create mode 100644 vendor/respect/validation/docs/rules/AlwaysValid.md create mode 100644 vendor/respect/validation/docs/rules/ArrayType.md create mode 100644 vendor/respect/validation/docs/rules/ArrayVal.md create mode 100644 vendor/respect/validation/docs/rules/Attribute.md create mode 100644 vendor/respect/validation/docs/rules/Bank.md create mode 100644 vendor/respect/validation/docs/rules/BankAccount.md create mode 100644 vendor/respect/validation/docs/rules/Between.md create mode 100644 vendor/respect/validation/docs/rules/Bic.md create mode 100644 vendor/respect/validation/docs/rules/BoolType.md create mode 100644 vendor/respect/validation/docs/rules/BoolVal.md create mode 100644 vendor/respect/validation/docs/rules/Bsn.md create mode 100644 vendor/respect/validation/docs/rules/Call.md create mode 100644 vendor/respect/validation/docs/rules/CallableType.md create mode 100644 vendor/respect/validation/docs/rules/Callback.md create mode 100644 vendor/respect/validation/docs/rules/Charset.md create mode 100644 vendor/respect/validation/docs/rules/Cnh.md create mode 100644 vendor/respect/validation/docs/rules/Cnpj.md create mode 100644 vendor/respect/validation/docs/rules/Cntrl.md create mode 100644 vendor/respect/validation/docs/rules/Consonant.md create mode 100644 vendor/respect/validation/docs/rules/Contains.md create mode 100644 vendor/respect/validation/docs/rules/Countable.md create mode 100644 vendor/respect/validation/docs/rules/CountryCode.md create mode 100644 vendor/respect/validation/docs/rules/Cpf.md create mode 100644 vendor/respect/validation/docs/rules/CreditCard.md create mode 100644 vendor/respect/validation/docs/rules/CurrencyCode.md create mode 100644 vendor/respect/validation/docs/rules/Date.md create mode 100644 vendor/respect/validation/docs/rules/Digit.md create mode 100644 vendor/respect/validation/docs/rules/Directory.md create mode 100644 vendor/respect/validation/docs/rules/Domain.md create mode 100644 vendor/respect/validation/docs/rules/Each.md create mode 100644 vendor/respect/validation/docs/rules/Email.md create mode 100644 vendor/respect/validation/docs/rules/EndsWith.md create mode 100644 vendor/respect/validation/docs/rules/Equals.md create mode 100644 vendor/respect/validation/docs/rules/Even.md create mode 100644 vendor/respect/validation/docs/rules/Executable.md create mode 100644 vendor/respect/validation/docs/rules/Exists.md create mode 100644 vendor/respect/validation/docs/rules/Extension.md create mode 100644 vendor/respect/validation/docs/rules/Factor.md create mode 100644 vendor/respect/validation/docs/rules/FalseVal.md create mode 100644 vendor/respect/validation/docs/rules/Fibonacci.md create mode 100644 vendor/respect/validation/docs/rules/File.md create mode 100644 vendor/respect/validation/docs/rules/FilterVar.md create mode 100644 vendor/respect/validation/docs/rules/Finite.md create mode 100644 vendor/respect/validation/docs/rules/FloatType.md create mode 100644 vendor/respect/validation/docs/rules/FloatVal.md create mode 100644 vendor/respect/validation/docs/rules/Graph.md create mode 100644 vendor/respect/validation/docs/rules/HexRgbColor.md create mode 100644 vendor/respect/validation/docs/rules/Identical.md create mode 100644 vendor/respect/validation/docs/rules/IdentityCard.md create mode 100644 vendor/respect/validation/docs/rules/Image.md create mode 100644 vendor/respect/validation/docs/rules/Imei.md create mode 100644 vendor/respect/validation/docs/rules/In.md create mode 100644 vendor/respect/validation/docs/rules/Infinite.md create mode 100644 vendor/respect/validation/docs/rules/Instance.md create mode 100644 vendor/respect/validation/docs/rules/IntType.md create mode 100644 vendor/respect/validation/docs/rules/IntVal.md create mode 100644 vendor/respect/validation/docs/rules/Ip.md create mode 100644 vendor/respect/validation/docs/rules/Iterable.md create mode 100644 vendor/respect/validation/docs/rules/IterableType.md create mode 100644 vendor/respect/validation/docs/rules/Json.md create mode 100644 vendor/respect/validation/docs/rules/Key.md create mode 100644 vendor/respect/validation/docs/rules/KeyNested.md create mode 100644 vendor/respect/validation/docs/rules/KeySet.md create mode 100644 vendor/respect/validation/docs/rules/KeyValue.md create mode 100644 vendor/respect/validation/docs/rules/LanguageCode.md create mode 100644 vendor/respect/validation/docs/rules/LeapDate.md create mode 100644 vendor/respect/validation/docs/rules/LeapYear.md create mode 100644 vendor/respect/validation/docs/rules/Length.md create mode 100644 vendor/respect/validation/docs/rules/Lowercase.md create mode 100644 vendor/respect/validation/docs/rules/MacAddress.md create mode 100644 vendor/respect/validation/docs/rules/Max.md create mode 100644 vendor/respect/validation/docs/rules/Mimetype.md create mode 100644 vendor/respect/validation/docs/rules/Min.md create mode 100644 vendor/respect/validation/docs/rules/MinimumAge.md create mode 100644 vendor/respect/validation/docs/rules/Multiple.md create mode 100644 vendor/respect/validation/docs/rules/Negative.md create mode 100644 vendor/respect/validation/docs/rules/NfeAccessKey.md create mode 100644 vendor/respect/validation/docs/rules/No.md create mode 100644 vendor/respect/validation/docs/rules/NoWhitespace.md create mode 100644 vendor/respect/validation/docs/rules/NoneOf.md create mode 100644 vendor/respect/validation/docs/rules/Not.md create mode 100644 vendor/respect/validation/docs/rules/NotBlank.md create mode 100644 vendor/respect/validation/docs/rules/NotEmpty.md create mode 100644 vendor/respect/validation/docs/rules/NotOptional.md create mode 100644 vendor/respect/validation/docs/rules/NullType.md create mode 100644 vendor/respect/validation/docs/rules/Numeric.md create mode 100644 vendor/respect/validation/docs/rules/ObjectType.md create mode 100644 vendor/respect/validation/docs/rules/Odd.md create mode 100644 vendor/respect/validation/docs/rules/OneOf.md create mode 100644 vendor/respect/validation/docs/rules/Optional.md create mode 100644 vendor/respect/validation/docs/rules/PerfectSquare.md create mode 100644 vendor/respect/validation/docs/rules/Pesel.md create mode 100644 vendor/respect/validation/docs/rules/Phone.md create mode 100644 vendor/respect/validation/docs/rules/PhpLabel.md create mode 100644 vendor/respect/validation/docs/rules/Positive.md create mode 100644 vendor/respect/validation/docs/rules/PostalCode.md create mode 100644 vendor/respect/validation/docs/rules/PrimeNumber.md create mode 100644 vendor/respect/validation/docs/rules/Prnt.md create mode 100644 vendor/respect/validation/docs/rules/Punct.md create mode 100644 vendor/respect/validation/docs/rules/Readable.md create mode 100644 vendor/respect/validation/docs/rules/Regex.md create mode 100644 vendor/respect/validation/docs/rules/ResourceType.md create mode 100644 vendor/respect/validation/docs/rules/Roman.md create mode 100644 vendor/respect/validation/docs/rules/ScalarVal.md create mode 100644 vendor/respect/validation/docs/rules/Sf.md create mode 100644 vendor/respect/validation/docs/rules/Size.md create mode 100644 vendor/respect/validation/docs/rules/Slug.md create mode 100644 vendor/respect/validation/docs/rules/Space.md create mode 100644 vendor/respect/validation/docs/rules/StartsWith.md create mode 100644 vendor/respect/validation/docs/rules/StringType.md create mode 100644 vendor/respect/validation/docs/rules/SubdivisionCode.md create mode 100644 vendor/respect/validation/docs/rules/SymbolicLink.md create mode 100644 vendor/respect/validation/docs/rules/Tld.md create mode 100644 vendor/respect/validation/docs/rules/TrueVal.md create mode 100644 vendor/respect/validation/docs/rules/Type.md create mode 100644 vendor/respect/validation/docs/rules/Uploaded.md create mode 100644 vendor/respect/validation/docs/rules/Uppercase.md create mode 100644 vendor/respect/validation/docs/rules/Url.md create mode 100644 vendor/respect/validation/docs/rules/Version.md create mode 100644 vendor/respect/validation/docs/rules/VideoUrl.md create mode 100644 vendor/respect/validation/docs/rules/Vowel.md create mode 100644 vendor/respect/validation/docs/rules/When.md create mode 100644 vendor/respect/validation/docs/rules/Writable.md create mode 100644 vendor/respect/validation/docs/rules/Xdigit.md create mode 100644 vendor/respect/validation/docs/rules/Yes.md create mode 100644 vendor/respect/validation/docs/rules/Zend.md create mode 100644 vendor/setasign/fpdi/src/FpdfTplTrait.php create mode 100644 vendor/setasign/fpdi/src/Tcpdf/Fpdi.php create mode 100644 vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php create mode 100644 vendor/setasign/fpdi/src/Tfpdf/Fpdi.php create mode 100644 vendor/slim/slim/Slim/Http/StatusCode.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php diff --git a/vendor/respect/validation/docs/concrete-api.md b/vendor/respect/validation/docs/concrete-api.md new file mode 100644 index 0000000000..735b6283d5 --- /dev/null +++ b/vendor/respect/validation/docs/concrete-api.md @@ -0,0 +1,77 @@ +# Concrete API + +There are many micro-frameworks that rely on magic methods. We don't. In this +document we're gonna explore the Respect\Validation API without fluent interfaces +or magic methods. We'll use a traditional dependency injection approach. + +```php +use Respect\Validation\Validator as v; + +$usernameValidator = v::alnum()->noWhitespace()->length(1,15); +$usernameValidator->validate('alganet'); // true +``` + +If you `var_dump($usernameValidator)`, you'll see a composite of objects with +`Respect\Validation\Rules\Alnum`, `Respect\Validation\Rules\NoWhitespace` and +`Respect\Validation\Rules\Length`. There is a specific object for each rule, and +the chain only builds the structure. You can build it by yourself: + +```php +use Respect\Validation\Rules; + +$usernameValidator = new Rules\AllOf( + new Rules\Alnum(), + new Rules\NoWhitespace(), + new Rules\Length(1, 15) +); +$usernameValidator->validate('alganet'); // true +``` + +This is still a very lean API. You can use it in any dependency injection +container or test it in the way you want. Nesting is still possible: + +```php +use Respect\Validation\Rules; + +$usernameValidator = new Rules\AllOf( + new Rules\Alnum(), + new Rules\NoWhitespace(), + new Rules\Length(1, 15) +); +$userValidator = new Rules\Key('name', $usernameValidator); +$userValidator->validate(['name' => 'alganet']); // true +``` + +## How It Works? + +The Respect\Validation chain is an +[internal DSL](http://martinfowler.com/bliki/InternalDslStyle.html). +It acts in the creational realm of objects (where Abstract Factories and Builders +live), and it's only job is to make rule construction terse and fluent. + +## FAQ + +> Is `v` in `v::something` a class name? + +No! The class is `Respect\Validation\Validator`, we suggest `v` as a very short alias. + +> Is `v::something()` a static call? + +Yes. Just like the default `DateTime::createFromFormat()` or +`Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration()`. It builds +something complex and returns for you. + +> I really don't like static calls, can I avoid it? + +Yes. Just use `$validator = new Validator();` each time you want a new validator, +and continue from there. + +> Do you have a static method for each rule? + +No. We use `__callStatic()`. + +> Magic methods are slow! Why do you use them? + +They're optional. If you use the `new` interface, they won't be called. + +(still, do some benchmarks, you'd be surprised with our implementation). diff --git a/vendor/respect/validation/docs/feature-guide.md b/vendor/respect/validation/docs/feature-guide.md new file mode 100644 index 0000000000..5d96e00790 --- /dev/null +++ b/vendor/respect/validation/docs/feature-guide.md @@ -0,0 +1,301 @@ +# Feature Guide + +## Namespace import + +Respect\Validation is namespaced, but you can make your life easier by importing +a single class into your context: + +```php +use Respect\Validation\Validator as v; +``` + +## Simple validation + +The Hello World validator is something like this: + +```php +$number = 123; +v::numeric()->validate($number); // true +``` + +## Chained validation + +It is possible to use validators in a chain. Sample below validates a string +containing numbers and letters, no whitespace and length between 1 and 15. + +```php +$usernameValidator = v::alnum()->noWhitespace()->length(1, 15); +$usernameValidator->validate('alganet'); // true +``` + +## Validating object attributes + +Given this simple object: + +```php +$user = new stdClass; +$user->name = 'Alexandre'; +$user->birthdate = '1987-07-01'; +``` + +Is possible to validate its attributes in a single chain: + +```php +$userValidator = v::attribute('name', v::stringType()->length(1,32)) + ->attribute('birthdate', v::date()->age(18)); + +$userValidator->validate($user); // true +``` + +Validating array keys is also possible using `v::key()` + +Note that we used `v::stringType()` and `v::date()` in the beginning of the validator. +Although is not mandatory, it is a good practice to use the type of the +validated object as the first node in the chain. + +## Input optional + +On oldest versions of Respect\Validation all validators treat input as optional +and accept an empty string input as valid. Even though a useful feature that +caused a lot of troubles for our team and neither was an obvious behavior. Also +there was some people who likes to accept `null` as optional value, not only an +empty string. + +For that reason all rules are mandatory now but if you want to treat a value as +optional you can use `v::optional()` rule: + +```php +v::alpha()->validate(''); // false input required +v::alpha()->validate(null); // false input required + +v::optional(v::alpha())->validate(''); // true +v::optional(v::alpha())->validate(null); // true +``` + +By _optional_ we consider `null` or an empty string (`''`). + +See more on [Optional](rules/Optional.md). + +## Negating rules + +You can use the `v::not()` to negate any rule: + +```php +v::not(v::intVal())->validate(10); // false, input must not be integer +``` + +## Validator reuse + +Once created, you can reuse your validator anywhere. Remember `$usernameValidator`? + +```php +$usernameValidator->validate('respect'); //true +$usernameValidator->validate('alexandre gaigalas'); // false +$usernameValidator->validate('#$%'); //false +``` + +## Exception types + +* `Respect\Validation\Exceptions\ExceptionInterface`: + * All exceptions implement this interface; +* `Respect\Validation\Exceptions\ValidationException`: + * Implements the `Respect\Validation\Exceptions\ExceptionInterface` interface + * Thrown when the `check()` fails + * All validation exceptions extend this class + * Available methods: + * `getMainMessage()`; + * `setMode($mode)`; + * `setName($name)`; + * `setParam($name, $value)`; + * `setTemplate($template)`; + * more... +* `Respect\Validation\Exceptions\NestedValidationException`: + * Extends the `Respect\Validation\Exceptions\ValidationException` class + * Usually thrown when the `assert()` fails + * Available methods: + * `findMessages()`; + * `getFullMessage()`; + * `getMessages()`; + * more... + +## Informative exceptions + +When something goes wrong, Validation can tell you exactly what's going on. For this, +we use the `assert()` method instead of `validate()`: + +```php +use Respect\Validation\Exceptions\NestedValidationException; + +try { + $usernameValidator->assert('really messed up screen#name'); +} catch(NestedValidationException $exception) { + echo $exception->getFullMessage(); +} +``` + +The printed message is exactly this, as a nested Markdown list: + +```no-highlight +- All of the required rules must pass for "really messed up screen#name" + - "really messed up screen#name" must contain only letters (a-z) and digits (0-9) + - "really messed up screen#name" must not contain whitespace + - "really messed up screen#name" must have a length between 1 and 15 +``` + +## Getting all messages as an array + +The Markdown list is fine, but unusable on a HTML form or something more custom. +For that you can use `getMessages()`. + +It will return all messages from the rules that did not pass the validation. + +```php +try { + $usernameValidator->assert('really messed up screen#name'); +} catch(NestedValidationException $exception) { + print_r($exception->getMessages()); +} +``` + +The code above may display something like: + +```no-highlight +Array +( + [0] => "really messed up screen#name" must contain only letters (a-z) and digits (0-9) + [1] => "really messed up screen#name" must not contain whitespace + [2] => "really messed up screen#name" must have a length between 1 and 15 +) +``` + +## Getting messages as an array by name + +If you want to get specific message by name you can use `findMessages()` passing +the names of the rules you want: + +```php +try { + $usernameValidator->assert('really messed up screen#name'); +} catch(NestedValidationException $exception) { + print_r($exception->findMessages(['alnum', 'noWhitespace'])); +} +``` + +The `findMessages()` returns an array with messages from the requested validators, +like this: + +```no-highlight +Array +( + [alnum] => "really messed up screen#name" must contain only letters (a-z) and digits (0-9) + [noWhitespace] => "really messed up screen#name" must not contain whitespace +) +``` + +## Custom messages + +Getting messages as an array is fine, but sometimes you need to customize them in order +to present them to the user. This is possible using the `findMessages()` method as well: + +```php +$errors = $exception->findMessages([ + 'alnum' => '{{name}} must contain only letters and digits', + 'length' => '{{name}} must not have more than 15 chars', + 'noWhitespace' => '{{name}} cannot contain spaces' +]); +``` + +For all messages, the `{{name}}` variable is available for templates. If you +do not define a name it uses the input to replace this placeholder. + +## Message localization + +You're also able to translate your message to another language with Validation. +The only thing one must do is to define the param `translator` as a callable that +will handle the translation: + +```php +$exception->setParam('translator', 'gettext'); +``` + +The example above uses `gettext()` but you can use any other callable value, like +`[$translator, 'trans']` or `you_custom_function()`. + +After that, if you call `getMainMessage()` or `getFullMessage()` (for nested), +the message will be translated. + +Note that `getMessage()` will keep the original message. + +## Custom rules + +You also can use your own rules: + +```php +namespace My\Validation\Rules; + +use Respect\Validation\Rules\AbstractRule; + +class MyRule extends AbstractRule +{ + public function validate($input) + { + // Do something here with the $input and return a boolean value + } +} +``` + +If you do want Validation to execute you rule (or rules) in the chain, you must +use `v::with()` passing your rule's namespace as an argument: + +```php +v::with('My\\Validation\\Rules\\'); +v::myRule(); // Try to load "My\Validation\Rules\MyRule" if any +``` + +By default `with()` appends the given prefix, but you can change this behavior +in order to overwrite default rules: + +```php +v::with('My\\Validation\\Rules', true); +v::alnum(); // Try to use "My\Validation\Rules\Alnum" if any +``` + +## Validator name + +On `v::attribute()` and `v::key()`, `{{name}}` is the attribute/key name. For others, +is the same as the input. You can customize a validator name using: + +```php +v::date('Y-m-d')->between('1980-02-02', 'now')->setName('Member Since'); +``` + +## Zend/Symfony validators + +It is also possible to reuse validators from other frameworks if they are installed: + +```php +$hostnameValidator = v::zend('Hostname')->assert('google.com'); +$timeValidator = v::sf('Time')->assert('22:00:01'); +``` + +## Validation methods + +We've seen `validate()` that returns true or false and `assert()` that throws a complete +validation report. There is also a `check()` method that returns an Exception +only with the first error found: + +```php +use Respect\Validation\Exceptions\ValidationException; + +try { + $usernameValidator->check('really messed up screen#name'); +} catch(ValidationException $exception) { + echo $exception->getMainMessage(); +} +``` + +Message: + +```no-highlight +"really messed up screen#name" must contain only letters (a-z) and digits (0-9) +``` diff --git a/vendor/respect/validation/docs/index.md b/vendor/respect/validation/docs/index.md new file mode 100644 index 0000000000..433d433767 --- /dev/null +++ b/vendor/respect/validation/docs/index.md @@ -0,0 +1,16 @@ +# Overview + +[](http://travis-ci.org/Respect/Validation) +[](https://scrutinizer-ci.com/g/Respect/Validation/?branch=master) +[](https://scrutinizer-ci.com/g/Respect/Validation/?branch=master) +[](https://packagist.org/packages/respect/validation) +[](https://packagist.org/packages/respect/validation) +[](https://packagist.org/packages/respect/validation) + +[The most awesome validation engine ever created for PHP.](http://bit.ly/1a1oeQv) + +- Complex rules made simple: `v::numeric()->positive()->between(1, 255)->validate($input)`. +- [Granularity control](feature-guide.md#validation-methods) for advanced reporting. +- More than 100 (fully tested) validators. +- [A concrete API](concrete-api.md) for non fluent usage. +- Works on PHP 5.4+ or HHVM 3.3+ diff --git a/vendor/respect/validation/docs/installation.md b/vendor/respect/validation/docs/installation.md new file mode 100644 index 0000000000..9c74c657c9 --- /dev/null +++ b/vendor/respect/validation/docs/installation.md @@ -0,0 +1,10 @@ +# Installation + +Package is available on [Packagist](http://packagist.org/packages/respect/validation), +you can install it using [Composer](http://getcomposer.org). + +```shell +composer require respect/validation +``` + +[PHP](https://php.net) 5.4+ or [HHVM](http://hhvm.com) 3.3+ are required. diff --git a/vendor/respect/validation/docs/license.md b/vendor/respect/validation/docs/license.md new file mode 100644 index 0000000000..ee76d0a384 --- /dev/null +++ b/vendor/respect/validation/docs/license.md @@ -0,0 +1,30 @@ +# License + +Copyright (c) 2009-2015, [Alexandre Gomes Gaigalas](http://github.com/alganet). + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Alexandre Gomes Gaigalas nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/respect/validation/docs/list-of-rules.md b/vendor/respect/validation/docs/list-of-rules.md new file mode 100644 index 0000000000..057be7bf32 --- /dev/null +++ b/vendor/respect/validation/docs/list-of-rules.md @@ -0,0 +1,329 @@ +# List of rules + +## Types + + * [ArrayVal](rules/ArrayVal.md) + * [ArrayType](rules/ArrayType.md) + * [BoolVal](rules/BoolVal.md) + * [BoolType](rules/BoolType.md) + * [CallableType](rules/CallableType.md) + * [Countable](rules/Countable.md) + * [Date](rules/Date.md) + * [FalseVal](rules/FalseVal.md) + * [FloatVal](rules/FloatVal.md) + * [FloatType](rules/FloatType.md) + * [Instance](rules/Instance.md) + * [IntVal](rules/IntVal.md) + * [IntType](rules/IntType.md) + * [IterableType](rules/IterableType.md) + * [NullType](rules/NullType.md) + * [Numeric](rules/Numeric.md) + * [ObjectType](rules/ObjectType.md) + * [ResourceType](rules/ResourceType.md) + * [ScalarVal](rules/ScalarVal.md) + * [StringType](rules/StringType.md) + * [TrueVal](rules/TrueVal.md) + * [Type](rules/Type.md) + * [Xdigit](rules/Xdigit.md) + +## Generics + + * [AlwaysInvalid](rules/AlwaysInvalid.md) + * [AlwaysValid](rules/AlwaysValid.md) + * [Call](rules/Call.md) + * [Callback](rules/Callback.md) + * [FilterVar](rules/FilterVar.md) + * [Not](rules/Not.md) + * [Optional](rules/Optional.md) + * [Type](rules/Type.md) + * [When](rules/When.md) + +## Comparing Values + + * [Age](rules/Age.md) + * [Between](rules/Between.md) + * [Equals](rules/Equals.md) + * [Identical](rules/Identical.md) + * [Max](rules/Max.md) + * [Min](rules/Min.md) + +## Numeric + + * [Between](rules/Between.md) + * [BoolType](rules/BoolType.md) + * [Even](rules/Even.md) + * [Factor](rules/Factor.md) + * [Fibonacci](rules/Fibonacci.md) + * [Finite](rules/Finite.md) + * [FloatVal](rules/FloatVal.md) + * [FloatType](rules/FloatType.md) + * [Infinite](rules/Infinite.md) + * [IntVal](rules/IntVal.md) + * [IntType](rules/IntType.md) + * [Multiple](rules/Multiple.md) + * [Negative](rules/Negative.md) + * [NotEmpty](rules/NotEmpty.md) + * [Numeric](rules/Numeric.md) + * [Odd](rules/Odd.md) + * [PerfectSquare](rules/PerfectSquare.md) + * [Positive](rules/Positive.md) + * [PrimeNumber](rules/PrimeNumber.md) + * [Roman](rules/Roman.md) + * [Xdigit](rules/Xdigit.md) + +## String + + * [Alnum](rules/Alnum.md) + * [Alpha](rules/Alpha.md) + * [Between](rules/Between.md) + * [Charset](rules/Charset.md) + * [Cntrl](rules/Cntrl.md) + * [Consonant](rules/Consonant.md) + * [Contains](rules/Contains.md) + * [Digit](rules/Digit.md) + * [EndsWith](rules/EndsWith.md) + * [Graph](rules/Graph.md) + * [In](rules/In.md) + * [Length](rules/Length.md) + * [Lowercase](rules/Lowercase.md) + * [NotEmpty](rules/NotEmpty.md) + * [NoWhitespace](rules/NoWhitespace.md) + * [PhpLabel](rules/PhpLabel.md) + * [Prnt](rules/Prnt.md) + * [Punct](rules/Punct.md) + * [Regex](rules/Regex.md) + * [ResourceType](rules/ResourceType.md) + * [Slug](rules/Slug.md) + * [Space](rules/Space.md) + * [StartsWith](rules/StartsWith.md) + * [Uppercase](rules/Uppercase.md) + * [Version](rules/Version.md) + * [Vowel](rules/Vowel.md) + * [Xdigit](rules/Xdigit.md) + +## Arrays + + * [ArrayVal](rules/ArrayVal.md) + * [ArrayType](rules/ArrayType.md) + * [Contains](rules/Contains.md) + * [Each](rules/Each.md) + * [EndsWith](rules/EndsWith.md) + * [In](rules/In.md) + * [Key](rules/Key.md) + * [KeyNested](rules/KeyNested.md) + * [KeySet](rules/KeySet.md) + * [KeyValue](rules/KeyValue.md) + * [Length](rules/Length.md) + * [NotEmpty](rules/NotEmpty.md) + * [StartsWith](rules/StartsWith.md) + +## Objects + + * [Attribute](rules/Attribute.md) + * [Instance](rules/Instance.md) + * [Length](rules/Length.md) + +## Date and Time + + * [Age](rules/Age.md) + * [Between](rules/Between.md) + * [Date](rules/Date.md) + * [LeapDate](rules/LeapDate.md) + * [LeapYear](rules/LeapYear.md) + * [MinimumAge](rules/MinimumAge.md) + +## Group Validators + + * [AllOf](rules/AllOf.md) + * [NoneOf](rules/NoneOf.md) + * [OneOf](rules/OneOf.md) + +## Regional + + * [CountryCode](rules/CountryCode.md) + * [CurrencyCode](rules/CurrencyCode.md) + * [IdentityCard](rules/IdentityCard.md) + * [LanguageCode](rules/LanguageCode.md) + * [PostalCode](rules/PostalCode.md) + * [SubdivisionCode](rules/SubdivisionCode.md) + * [Tld](rules/Tld.md) + +## Files + + * [Directory](rules/Directory.md) + * [Executable](rules/Executable.md) + * [Exists](rules/Exists.md) + * [Extension](rules/Extension.md) + * [File](rules/File.md) + * [Image](rules/Image.md) + * [Mimetype](rules/Mimetype.md) + * [Readable](rules/Readable.md) + * [Size](rules/Size.md) + * [SymbolicLink](rules/SymbolicLink.md) + * [Uploaded](rules/Uploaded.md) + * [Writable](rules/Writable.md) + +## Banking + + * [Bank](rules/Bank.md) + * [BankAccount](rules/BankAccount.md) + * [Bic](rules/Bic.md) + +## Other + + * [Bsn](rules/Bsn.md) + * [Cnh](rules/Cnh.md) + * [Cnpj](rules/Cnpj.md) + * [Cpf](rules/Cpf.md) + * [Domain](rules/Domain.md) + * [Email](rules/Email.md) + * [HexRgbColor](rules/HexRgbColor.md) + * [Imei](rules/Imei.md) + * [Ip](rules/Ip.md) + * [Json](rules/Json.md) + * [MacAddress](rules/MacAddress.md) + * [NfeAccessKey](rules/NfeAccessKey.md) + * [NotBlank](rules/NotBlank.md) + * [NotOptional](rules/NotOptional.md) + * [Pesel](rules/Pesel.md) + * [Phone](rules/Phone.md) + * [Sf](rules/Sf.md) + * [Url](rules/Url.md) + * [VideoUrl](rules/VideoUrl.md) + * [Zend](rules/Zend.md) + +## Yes/No + + * [No](rules/No.md) + * [Yes](rules/Yes.md) + +## Alphabetically + + * [Age](rules/Age.md) + * [AllOf](rules/AllOf.md) + * [Alnum](rules/Alnum.md) + * [Alpha](rules/Alpha.md) + * [AlwaysInvalid](rules/AlwaysInvalid.md) + * [AlwaysValid](rules/AlwaysValid.md) + * [ArrayVal](rules/ArrayVal.md) + * [ArrayType](rules/ArrayType.md) + * [Attribute](rules/Attribute.md) + * [Bank](rules/Bank.md) + * [BankAccount](rules/BankAccount.md) + * [Between](rules/Between.md) + * [Bic](rules/Bic.md) + * [BoolType](rules/BoolType.md) + * [Bsn](rules/Bsn.md) + * [Call](rules/Call.md) + * [CallableType](rules/CallableType.md) + * [Callback](rules/Callback.md) + * [Charset](rules/Charset.md) + * [Cnh](rules/Cnh.md) + * [Cnpj](rules/Cnpj.md) + * [Cntrl](rules/Cntrl.md) + * [Consonant](rules/Consonant.md) + * [Contains](rules/Contains.md) + * [Countable](rules/Countable.md) + * [CountryCode](rules/CountryCode.md) + * [Cpf](rules/Cpf.md) + * [CreditCard](rules/CreditCard.md) + * [Date](rules/Date.md) + * [Digit](rules/Digit.md) + * [Directory](rules/Directory.md) + * [Domain](rules/Domain.md) + * [Each](rules/Each.md) + * [Email](rules/Email.md) + * [EndsWith](rules/EndsWith.md) + * [Equals](rules/Equals.md) + * [Even](rules/Even.md) + * [Executable](rules/Executable.md) + * [Exists](rules/Exists.md) + * [Extension](rules/Extension.md) + * [Factor](rules/Factor.md) + * [FalseVal](rules/FalseVal.md) + * [Fibonacci](rules/Fibonacci.md) + * [File](rules/File.md) + * [FilterVar](rules/FilterVar.md) + * [Finite](rules/Finite.md) + * [FloatVal](rules/FloatVal.md) + * [FloatType](rules/FloatType.md) + * [Graph](rules/Graph.md) + * [HexRgbColor](rules/HexRgbColor.md) + * [Identical](rules/Identical.md) + * [IdentityCard](rules/IdentityCard.md) + * [Image](rules/Image.md) + * [Imei](rules/Imei.md) + * [In](rules/In.md) + * [Infinite](rules/Infinite.md) + * [Instance](rules/Instance.md) + * [IntVal](rules/IntVal.md) + * [IntType](rules/IntType.md) + * [Ip](rules/Ip.md) + * [IterableType](rules/IterableType.md) + * [Json](rules/Json.md) + * [Key](rules/Key.md) + * [KeyNested](rules/KeyNested.md) + * [KeySet](rules/KeySet.md) + * [KeyValue](rules/KeyValue.md) + * [LanguageCode](rules/LanguageCode.md) + * [LeapDate](rules/LeapDate.md) + * [LeapYear](rules/LeapYear.md) + * [Length](rules/Length.md) + * [Lowercase](rules/Lowercase.md) + * [MacAddress](rules/MacAddress.md) + * [Max](rules/Max.md) + * [Mimetype](rules/Mimetype.md) + * [Min](rules/Min.md) + * [MinimumAge](rules/MinimumAge.md) + * [Multiple](rules/Multiple.md) + * [Negative](rules/Negative.md) + * [NfeAccessKey](rules/NfeAccessKey.md) + * [No](rules/No.md) + * [NoWhitespace](rules/NoWhitespace.md) + * [NoneOf](rules/NoneOf.md) + * [Not](rules/Not.md) + * [NotBlank](rules/NotBlank.md) + * [NotEmpty](rules/NotEmpty.md) + * [NotOptional](rules/NotOptional.md) + * [NullType](rules/NullType.md) + * [Numeric](rules/Numeric.md) + * [ObjectType](rules/ObjectType.md) + * [Odd](rules/Odd.md) + * [OneOf](rules/OneOf.md) + * [Optional](rules/Optional.md) + * [PerfectSquare](rules/PerfectSquare.md) + * [Pesel](rules/Pesel.md) + * [Phone](rules/Phone.md) + * [PhpLabel](rules/PhpLabel.md) + * [Positive](rules/Positive.md) + * [PostalCode](rules/PostalCode.md) + * [PrimeNumber](rules/PrimeNumber.md) + * [Prnt](rules/Prnt.md) + * [Punct](rules/Punct.md) + * [Readable](rules/Readable.md) + * [Regex](rules/Regex.md) + * [ResourceType](rules/ResourceType.md) + * [Roman](rules/Roman.md) + * [ScalarVal](rules/ScalarVal.md) + * [Sf](rules/Sf.md) + * [Size](rules/Size.md) + * [Slug](rules/Slug.md) + * [Space](rules/Space.md) + * [StartsWith](rules/StartsWith.md) + * [StringType](rules/StringType.md) + * [SubdivisionCode](rules/SubdivisionCode.md) + * [SymbolicLink](rules/SymbolicLink.md) + * [Tld](rules/Tld.md) + * [TrueVal](rules/TrueVal.md) + * [Type](rules/Type.md) + * [Uploaded](rules/Uploaded.md) + * [Uppercase](rules/Uppercase.md) + * [Url](rules/Url.md) + * [Version](rules/Version.md) + * [VideoUrl](rules/VideoUrl.md) + * [Vowel](rules/Vowel.md) + * [When](rules/When.md) + * [Writable](rules/Writable.md) + * [Xdigit](rules/Xdigit.md) + * [Yes](rules/Yes.md) + * [Zend](rules/Zend.md) diff --git a/vendor/respect/validation/docs/rules/Age.md b/vendor/respect/validation/docs/rules/Age.md new file mode 100644 index 0000000000..740d7279b6 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Age.md @@ -0,0 +1,46 @@ +# Age + +- `v::age(int $minAge)` +- `v::age(int $minAge, int $maxAge)` +- `v::age(null, int $maxAge)` + +Validates ranges of years. + +The validated values can be any date value; internally they will be transformed +into [DateTime](http://php.net/manual/en/class.datetime.php) objects according +to the defined locale settings. + +The examples below validate if the given dates are lower or equal to 18 years ago: +```php +v::age(18)->validate('17 years ago'); // false +v::age(18)->validate('18 years ago'); // true +v::age(18)->validate('19 years ago'); // true +v::age(18)->validate('1970-01-01'); // true +v::age(18)->validate('today'); // false +``` + +The examples below validate if the given dates are between 10 and 50 years ago: +```php +v::age(10, 50)->validate('9 years ago'); // false +v::age(10, 50)->validate('10 years ago'); // true +v::age(10, 50)->validate('30 years ago'); // true +v::age(10, 50)->validate('50 years ago'); // true +v::age(10, 50)->validate('51 years ago'); // false +``` + +The examples below validate if the given dates are greater than or equal to 70 years ago: +```php +v::age(null, 70)->validate('today'); // true +v::age(null, 70)->validate('70 years ago'); // true +v::age(null, 70)->validate('71 years ago'); // false +``` + +Message template for this validator includes `{{minAge}}` and `{{maxAge}}`. + +*** +See also: + + * [Between](Between.md) + * [Date](Date.md) + * [Max](Max.md) + * [Min](Min.md) diff --git a/vendor/respect/validation/docs/rules/AllOf.md b/vendor/respect/validation/docs/rules/AllOf.md new file mode 100644 index 0000000000..7bd2ecf020 --- /dev/null +++ b/vendor/respect/validation/docs/rules/AllOf.md @@ -0,0 +1,30 @@ +# AllOf + +- `v::allOf(v $v1, v $v2, v $v3...)` + +Will validate if all inner validators validates. + +```php +v::allOf( + v::intVal(), + v::positive() +)->validate(15); // true +``` + +This is similar to the chain (which is an allOf already), but +its syntax allows you to set custom names for every node: + +```php +v::allOf( + v::intVal()->setName('Account Number'), + v::positive()->setName('Higher Than Zero') +)->setName('Positive integer') + ->validate(15); // true +``` + +*** +See also: + + * [OneOf](OneOf.md) + * [NoneOf](NoneOf.md) + * [When](When.md) diff --git a/vendor/respect/validation/docs/rules/Alnum.md b/vendor/respect/validation/docs/rules/Alnum.md new file mode 100644 index 0000000000..184c1e2cfb --- /dev/null +++ b/vendor/respect/validation/docs/rules/Alnum.md @@ -0,0 +1,44 @@ +# Alnum + +- `v::alnum()` +- `v::alnum(string $additionalChars)` + +Validates alphanumeric characters from a-Z and 0-9. + +```php +v::alnum()->validate('foo 123'); // true +v::alnum()->validate('number 100%'); // false +v::alnum('%')->validate('number 100%'); // true +``` + +Because this rule allows whitespaces by default, you can separate additional +characters with a whitespace: + +```php +v::alnum('- ! :')->validate('foo :- 123 !'); // true +``` + +This validator allows whitespace, if you want to +remove them add `->noWhitespace()` to the chain: + +```php +v::alnum()->noWhitespace()->validate('foo 123'); // false +``` + +You can restrict case using the `->lowercase()` and +`->uppercase()` validators: + +```php +v::alnum()->uppercase()->validate('aaa'); // false +``` + +Message template for this validator includes `{{additionalChars}}` as +the string of extra chars passed as the parameter. + +*** +See also: + + * [Alpha](Alpha.md) + * [Digit](Digit.md) + * [Consonant](Consonant.md) + * [Vowel](Vowel.md) diff --git a/vendor/respect/validation/docs/rules/Alpha.md b/vendor/respect/validation/docs/rules/Alpha.md new file mode 100644 index 0000000000..44f4dc3714 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Alpha.md @@ -0,0 +1,14 @@ +# Alpha + +- `v::alpha()` +- `v::alpha(string $additionalChars)` + +This is similar to `v::alnum()`, but it doesn't allow numbers. + +*** +See also: + + * [Alnum](Alnum.md) + * [Digit](Digit.md) + * [Consonant](Consonant.md) + * [Vowel](Vowel.md) diff --git a/vendor/respect/validation/docs/rules/AlwaysInvalid.md b/vendor/respect/validation/docs/rules/AlwaysInvalid.md new file mode 100644 index 0000000000..34b364deb3 --- /dev/null +++ b/vendor/respect/validation/docs/rules/AlwaysInvalid.md @@ -0,0 +1,14 @@ +# AlwaysInvalid + +- `v::alwaysInvalid()` + +Always return false. + +```php +v::alwaysInvalid()->validate($whatever); // false +``` + +*** +See also: + + * [AlwaysValid](AlwaysValid.md) diff --git a/vendor/respect/validation/docs/rules/AlwaysValid.md b/vendor/respect/validation/docs/rules/AlwaysValid.md new file mode 100644 index 0000000000..6a020bb420 --- /dev/null +++ b/vendor/respect/validation/docs/rules/AlwaysValid.md @@ -0,0 +1,14 @@ +# AlwaysValid + +- `v::alwaysValid()` + +Always returns true. + +```php +v::alwaysValid()->validate($whatever); // true +``` + +*** +See also: + + * [AlwaysInvalid](AlwaysInvalid.md) diff --git a/vendor/respect/validation/docs/rules/ArrayType.md b/vendor/respect/validation/docs/rules/ArrayType.md new file mode 100644 index 0000000000..ed72eb393c --- /dev/null +++ b/vendor/respect/validation/docs/rules/ArrayType.md @@ -0,0 +1,27 @@ +# ArrayType + +- `v::arrayType()` + +Validates whether the type of an input is array. + +```php +v::arrayType()->validate([]); // true +v::arrayType()->validate([1, 2, 3]); // true +v::arrayType()->validate(new ArrayObject()); // false +``` + +*** +See also: + + * [ArrayVal](ArrayVal.md) + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [Countable](Countable.md) + * [FloatType](FloatType.md) + * [IntType](IntType.md) + * [IterableType](IterableType.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/ArrayVal.md b/vendor/respect/validation/docs/rules/ArrayVal.md new file mode 100644 index 0000000000..ec9eaf066a --- /dev/null +++ b/vendor/respect/validation/docs/rules/ArrayVal.md @@ -0,0 +1,22 @@ +# ArrayVal + +- `v::arrayVal()` + +Validates if the input is an array or if the input can be used as an array +(instance of `ArrayAccess`). + +```php +v::arrayVal()->validate([]); // true +v::arrayVal()->validate(new ArrayObject); // true +``` + +*** +See also: + + * [ArrayType](ArrayType.md) + * [Countable](Countable.md) + * [Each](Each.md) + * [IterableType](IterableType.md) + * [Key](Key.md) + * [KeySet](KeySet.md) + * [KeyValue](KeyValue.md) diff --git a/vendor/respect/validation/docs/rules/Attribute.md b/vendor/respect/validation/docs/rules/Attribute.md new file mode 100644 index 0000000000..e48b6b664b --- /dev/null +++ b/vendor/respect/validation/docs/rules/Attribute.md @@ -0,0 +1,33 @@ +# Attribute + +- `v::attribute(string $name)` +- `v::attribute(string $name, v $validator)` +- `v::attribute(string $name, v $validator, boolean $mandatory = true)` + +Validates an object attribute. + +```php +$obj = new stdClass; +$obj->foo = 'bar'; + +v::attribute('foo')->validate($obj); // true +``` + +You can also validate the attribute itself: + +```php +v::attribute('foo', v::equals('bar'))->validate($obj); // true +``` + +Third parameter makes the attribute presence optional: + +```php +v::attribute('lorem', v::stringType(), false)->validate($obj); // true +``` + +The name of this validator is automatically set to the attribute name. + +*** +See also: + + * [Key](Key.md) diff --git a/vendor/respect/validation/docs/rules/Bank.md b/vendor/respect/validation/docs/rules/Bank.md new file mode 100644 index 0000000000..028d71985d --- /dev/null +++ b/vendor/respect/validation/docs/rules/Bank.md @@ -0,0 +1,20 @@ +# Bank + +- `v::bank(string $countryCode)` + +Validates a bank. + +```php +v::bank("de")->validate("70169464"); // true +v::bank("de")->validate("12345"); // false +``` + +These country codes are supported: + + * "de" (Germany) - You must add `"malkusch/bav": "~1.0"` to your `require` property on composer.json file. + +*** +See also: + + * [BankAccount](BankAccount.md) + * [Bic](Bic.md) diff --git a/vendor/respect/validation/docs/rules/BankAccount.md b/vendor/respect/validation/docs/rules/BankAccount.md new file mode 100644 index 0000000000..f9d319d7f8 --- /dev/null +++ b/vendor/respect/validation/docs/rules/BankAccount.md @@ -0,0 +1,20 @@ +# BankAccount + +- `v::bankAccount(string $countryCode, string $bank)` + +Validates a bank account for a given bank. + +```php +v::bankAccount("de", "70169464")->validate("1112"); // true +v::bankAccount("de", "70169464")->validate("1234"); // false +``` + +These country codes are supported: + + * "de" (Germany) - You must add `"malkusch/bav": "~1.0"` to your `require` property on composer.json file. + +*** +See also: + + * [Bank](Bank.md) + * [Bic](Bic.md) diff --git a/vendor/respect/validation/docs/rules/Between.md b/vendor/respect/validation/docs/rules/Between.md new file mode 100644 index 0000000000..5c0204afc9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Between.md @@ -0,0 +1,44 @@ +# Between + +- `v::between(mixed $start, mixed $end)` +- `v::between(mixed $start, mixed $end, boolean $inclusive = true)` + +Validates ranges. Most simple example: + +```php +v::intVal()->between(10, 20)->validate(15); // true +``` + +The type as the first validator in a chain is a good practice, +since between accepts many types: + +```php +v::stringType()->between('a', 'f')->validate('c'); // true +``` + +Also very powerful with dates: + +```php +v::date()->between('2009-01-01', '2013-01-01')->validate('2010-01-01'); // true +``` + +Date ranges accept strtotime values: + +```php +v::date()->between('yesterday', 'tomorrow')->validate('now'); // true +``` + +A third parameter may be passed to validate the passed values inclusive: + +```php +v::date()->between(10, 20, true)->validate(20); // true +``` + +Message template for this validator includes `{{minValue}}` and `{{maxValue}}`. + +*** +See also: + + * [Length](Length.md) + * [Min](Min.md) + * [Max](Max.md) diff --git a/vendor/respect/validation/docs/rules/Bic.md b/vendor/respect/validation/docs/rules/Bic.md new file mode 100644 index 0000000000..82c67e8810 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Bic.md @@ -0,0 +1,20 @@ +# Bic + +- `v::bic(string $countryCode)` + +Validates a BIC (Bank Identifier Code) for a given country. + +```php +v::bic("de")->validate("VZVDDED1XXX"); // true +v::bic("de")->validate("VZVDDED1"); // true +``` + +Theses country codes are supported: + + * "de" (Germany) - You must add `"malkusch/bav": "~1.0"` to your `require` property on composer.json file. + +*** +See also: + + * [Bank](Bank.md) + * [BankAccount](BankAccount.md) diff --git a/vendor/respect/validation/docs/rules/BoolType.md b/vendor/respect/validation/docs/rules/BoolType.md new file mode 100644 index 0000000000..9795621898 --- /dev/null +++ b/vendor/respect/validation/docs/rules/BoolType.md @@ -0,0 +1,27 @@ +# BoolType + +- `v::boolType()` + +Validates if the input is a boolean value: + +```php +v::boolType()->validate(true); // true +v::boolType()->validate(false); // true +``` + +*** +See also: + + * [ArrayType](ArrayType.md) + * [CallableType](CallableType.md) + * [FloatType](FloatType.md) + * [FloatVal](FloatVal.md) + * [IntType](IntType.md) + * [No](No.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [TrueVal](TrueVal.md) + * [Type](Type.md) + * [Yes](Yes.md) diff --git a/vendor/respect/validation/docs/rules/BoolVal.md b/vendor/respect/validation/docs/rules/BoolVal.md new file mode 100644 index 0000000000..26bf9a6d0d --- /dev/null +++ b/vendor/respect/validation/docs/rules/BoolVal.md @@ -0,0 +1,31 @@ +# BoolVal + +- `v::boolVal()` + +Validates if the input results in a boolean value: + +```php +v::boolVal()->validate('on'); // true +v::boolVal()->validate('off'); // true +v::boolVal()->validate('yes'); // true +v::boolVal()->validate('no'); // true +v::boolVal()->validate(1); // true +v::boolVal()->validate(0); // true +``` + +*** +See also: + + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [FloatType](FloatType.md) + * [FloatVal](FloatVal.md) + * [IntType](IntType.md) + * [No](No.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [TrueVal](TrueVal.md) + * [Type](Type.md) + * [Yes](Yes.md) diff --git a/vendor/respect/validation/docs/rules/Bsn.md b/vendor/respect/validation/docs/rules/Bsn.md new file mode 100644 index 0000000000..e67f55e70d --- /dev/null +++ b/vendor/respect/validation/docs/rules/Bsn.md @@ -0,0 +1,16 @@ +# Bsn + +- `v::bsn()` + +Validates a Dutch citizen service number ([BSN](https://nl.wikipedia.org/wiki/Burgerservicenummer)). + +```php +v::bsn()->validate('612890053'); // true +``` + +*** +See also: + + * [Cnh](Cnh.md) + * [Cnpj](Cnpj.md) + * [Cpf](Cpf.md) diff --git a/vendor/respect/validation/docs/rules/Call.md b/vendor/respect/validation/docs/rules/Call.md new file mode 100644 index 0000000000..f56b0a8e5e --- /dev/null +++ b/vendor/respect/validation/docs/rules/Call.md @@ -0,0 +1,51 @@ +# Call + +- `v::call(callable $callback)` + +This is a very low level validator. It calls a function, method or closure +for the input and then validates it. Consider the following variable: + +```php +$url = 'http://www.google.com/search?q=respect.github.com' +``` + +To validate every part of this URL we could use the native `parse_url` +function to break its parts: + +```php +$parts = parse_url($url); +``` + +This function returns an array containing `scheme`, `host`, `path` and `query`. +We can validate them this way: + +```php +v::arrayVal()->key('scheme', v::startsWith('http')) + ->key('host', v::domain()) + ->key('path', v::stringType()) + ->key('query', v::notEmpty()); +``` + +Using `v::call()` you can do this in a single chain: + +```php +v::call( + 'parse_url', + v::arrayVal()->key('scheme', v::startsWith('http')) + ->key('host', v::domain()) + ->key('path', v::stringType()) + ->key('query', v::notEmpty()) +)->validate($url); +``` + +It is possible to call methods and closures as the first parameter: + +```php +v::call([$myObj, 'methodName'], v::intVal())->validate($myInput); +v::call(function($input) {}, v::intVal())->validate($myInput); +``` + +*** +See also: + + * [Callback](Callback.md) diff --git a/vendor/respect/validation/docs/rules/CallableType.md b/vendor/respect/validation/docs/rules/CallableType.md new file mode 100644 index 0000000000..7f24dca7b0 --- /dev/null +++ b/vendor/respect/validation/docs/rules/CallableType.md @@ -0,0 +1,25 @@ +# CallableType + +- `v::callableType()` + +Validates if the input is a callable value. + +```php +v::callableType()->validate(function () {}); // true +v::callableType()->validate('trim'); // true +v::callableType()->validate([new ObjectType, 'methodName']); // true +``` + +*** +See also: + + * [ArrayType](ArrayType.md) + * [BoolType](BoolType.md) + * [Callback](Callback.md) + * [FloatType](FloatType.md) + * [IntType](IntType.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/Callback.md b/vendor/respect/validation/docs/rules/Callback.md new file mode 100644 index 0000000000..d5ec6b86c6 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Callback.md @@ -0,0 +1,21 @@ +# Callback + +- `v::callback(callable $callback)` + +This is a wildcard validator, it uses a function name, method or closure +to validate something: + +```php +v::callback('is_int')->validate(10); // true +``` + +(Please note that this is a sample, the `v::intVal()` validator is much better). + +As in `v::call()`, you can pass a method or closure to it. + +*** +See also: + + * [Call](Call.md) + * [CallableType](CallableType.md) + * [FilterVar](FilterVar.md) diff --git a/vendor/respect/validation/docs/rules/Charset.md b/vendor/respect/validation/docs/rules/Charset.md new file mode 100644 index 0000000000..43d889bdc6 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Charset.md @@ -0,0 +1,19 @@ +# Charset + +- `v::charset(mixed $charset)` + +Validates if a string is in a specific charset. + +```php +v::charset('ASCII')->validate('açúcar'); // false +v::charset('ASCII')->validate('sugar'); //true +v::charset(['ISO-8859-1', 'EUC-JP'])->validate('日本国'); // true +``` + +The array format is a logic OR, not AND. + +*** +See also: + + * [Alnum](Alnum.md) + * [Alpha](Alpha.md) diff --git a/vendor/respect/validation/docs/rules/Cnh.md b/vendor/respect/validation/docs/rules/Cnh.md new file mode 100644 index 0000000000..6815929a39 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Cnh.md @@ -0,0 +1,15 @@ +# Cnh + +- `v::cnh()` + +Validates a Brazillian driver's license. + +```php +v::cnh()->validate('02650306461'); // true +``` + +*** +See also: + + * [Cnpj](Cnpj.md) + * [Cpf](Cpf.md) diff --git a/vendor/respect/validation/docs/rules/Cnpj.md b/vendor/respect/validation/docs/rules/Cnpj.md new file mode 100644 index 0000000000..846d391762 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Cnpj.md @@ -0,0 +1,12 @@ +# Cnpj + +- `v::cnpj()` + +Validates the Brazillian CNPJ number. Ignores non-digit chars, so +use `->digit()` if needed. + +*** +See also: + + * [Cpf](Cpf.md) + * [Cnh](Cnh.md) diff --git a/vendor/respect/validation/docs/rules/Cntrl.md b/vendor/respect/validation/docs/rules/Cntrl.md new file mode 100644 index 0000000000..7a6552aa8e --- /dev/null +++ b/vendor/respect/validation/docs/rules/Cntrl.md @@ -0,0 +1,17 @@ +# Cntrl + +- `v::cntrl()` +- `v::cntrl(string $additionalChars)` + +This is similar to `v::alnum()`, but only accepts control characters: + +```php +v::cntrl()->validate("\n\r\t"); // true +``` + +*** +See also: + + * [Alnum](Alnum.md) + * [Prnt](Prnt.md) + * [Space](Space.md) diff --git a/vendor/respect/validation/docs/rules/Consonant.md b/vendor/respect/validation/docs/rules/Consonant.md new file mode 100644 index 0000000000..fac1fe5331 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Consonant.md @@ -0,0 +1,18 @@ +# Consonant + +- `v::consonant()` +- `v::consonant(string $additionalChars)` + +Similar to `v::alnum()`. Validates strings that contain only consonants: + +```php +v::consonant()->validate('xkcd'); // true +``` + +*** +See also: + + * [Alnum](Alnum.md) + * [Digit](Digit.md) + * [Alpha](Alpha.md) + * [Vowel](Vowel.md) diff --git a/vendor/respect/validation/docs/rules/Contains.md b/vendor/respect/validation/docs/rules/Contains.md new file mode 100644 index 0000000000..6036494fe4 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Contains.md @@ -0,0 +1,28 @@ +# Contains + +- `v::contains(mixed $value)` +- `v::contains(mixed $value, boolean $identical = false)` + +For strings: + +```php +v::contains('ipsum')->validate('lorem ipsum'); // true +``` + +For arrays: + +```php +v::contains('ipsum')->validate(['ipsum', 'lorem']); // true +``` + +A second parameter may be passed for identical comparison instead +of equal comparison. + +Message template for this validator includes `{{containsValue}}`. + +*** +See also: + + * [StartsWith](StartsWith.md) + * [EndsWith](EndsWith.md) + * [In](In.md) diff --git a/vendor/respect/validation/docs/rules/Countable.md b/vendor/respect/validation/docs/rules/Countable.md new file mode 100644 index 0000000000..0353de4d7a --- /dev/null +++ b/vendor/respect/validation/docs/rules/Countable.md @@ -0,0 +1,19 @@ +# Countable + +- `v::countable()` + +Validates if the input is countable, in other words, if you're allowed to use +[count()](http://php.net/count) function on it. + +```php +v::countable()->validate([]); // true +v::countable()->validate(new ArrayObject()); // true +v::countable()->validate('string'); // false +``` + +*** +See also: + + * [ArrayVal](ArrayVal.md) + * [Instance](Instance.md) + * [IterableType](IterableType.md) diff --git a/vendor/respect/validation/docs/rules/CountryCode.md b/vendor/respect/validation/docs/rules/CountryCode.md new file mode 100644 index 0000000000..469313db2d --- /dev/null +++ b/vendor/respect/validation/docs/rules/CountryCode.md @@ -0,0 +1,14 @@ +# CountryCode + +- `v::countryCode()` + +Validates an ISO country code like US or BR. + +```php +v::countryCode()->validate('BR'); // true +``` + +*** +See also: + + * [Tld](Tld.md) diff --git a/vendor/respect/validation/docs/rules/Cpf.md b/vendor/respect/validation/docs/rules/Cpf.md new file mode 100644 index 0000000000..0fc3a717af --- /dev/null +++ b/vendor/respect/validation/docs/rules/Cpf.md @@ -0,0 +1,28 @@ +# Cpf + +- `v::cpf()` + +Validates a Brazillian CPF number. + +```php +v::cpf()->validate('44455566820'); // true +``` + +It ignores any non-digit char: + +```php +v::cpf()->validate('444.555.668-20'); // true +``` + +If you need to validate digits only, add `->digit()` to +the chain: + +```php +v::digit()->cpf()->validate('44455566820'); // true +``` + +*** +See also: + + * [Cnpj](Cnpj.md) + * [Cnh](Cnh.md) diff --git a/vendor/respect/validation/docs/rules/CreditCard.md b/vendor/respect/validation/docs/rules/CreditCard.md new file mode 100644 index 0000000000..aa9783a233 --- /dev/null +++ b/vendor/respect/validation/docs/rules/CreditCard.md @@ -0,0 +1,39 @@ +# CreditCard + +- `v::creditCard()` +- `v::creditCard(string $brand)` + +Validates a credit card number. + +```php +v::creditCard()->validate('5376 7473 9720 8720'); // true + +v::creditCard('American Express')->validate('340316193809364'); // true +v::creditCard('Diners Club')->validate('30351042633884'); // true +v::creditCard('Discover')->validate('6011000990139424'); // true +v::creditCard('JCB')->validate('3566002020360505'); // true +v::creditCard('Master')->validate('5376747397208720'); // true +v::creditCard('Visa')->validate('4024007153361885'); // true +``` + +The current supported brands are: + +- American Express +- Diners Club +- Discover +- JCB +- MasterCard +- Visa + +It ignores any non-digit chars, so use `->digit()` when appropriate. + +```php +v::digit()->creditCard()->validate('5376747397208720'); // true +``` + +*** +See also: + + * [Bank](Bank.md) + * [BankAccount](BankAccount.md) + * [Bic](Bic.md) diff --git a/vendor/respect/validation/docs/rules/CurrencyCode.md b/vendor/respect/validation/docs/rules/CurrencyCode.md new file mode 100644 index 0000000000..95c13fae47 --- /dev/null +++ b/vendor/respect/validation/docs/rules/CurrencyCode.md @@ -0,0 +1,15 @@ +# CurrencyCode + +- `v::currencyCode()` + +Validates an [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code like GBP or EUR. + +```php +v::currencyCode()->validate('GBP'); // true +``` + +*** +See also: + + * [CountryCode](CountryCode.md) + * [SubdivisionCode](SubdivisionCode.md) diff --git a/vendor/respect/validation/docs/rules/Date.md b/vendor/respect/validation/docs/rules/Date.md new file mode 100644 index 0000000000..4afb9ecbd5 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Date.md @@ -0,0 +1,40 @@ +# Date + +- `v::date()` +- `v::date(string $format)` + +Validates if input is a date: + +```php +v::date()->validate('2009-01-01'); // true +``` + +Also accepts strtotime values: + +```php +v::date()->validate('now'); // true +``` + +And DateTime instances: + +```php +v::date()->validate(new DateTime); // true +``` + +You can pass a format when validating strings: + +```php +v::date('Y-m-d')->validate('01-01-2009'); // false +``` + +Format has no effect when validating DateTime instances. + +Message template for this validator includes `{{format}}`. + +*** +See also: + + * [Between](Between.md) + * [MinimumAge](MinimumAge.md) + * [LeapDate](LeapDate.md) + * [LeapYear](LeapYear.md) diff --git a/vendor/respect/validation/docs/rules/Digit.md b/vendor/respect/validation/docs/rules/Digit.md new file mode 100644 index 0000000000..c4638483f4 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Digit.md @@ -0,0 +1,13 @@ +# Digit + +- `v::digit()` + +This is similar to `v::alnum()`, but it doesn't allow a-Z. + +*** +See also: + + * [Alnum](Alnum.md) + * [Alpha](Alpha.md) + * [Vowel](Vowel.md) + * [Consonant](Consonant.md) diff --git a/vendor/respect/validation/docs/rules/Directory.md b/vendor/respect/validation/docs/rules/Directory.md new file mode 100644 index 0000000000..7d49c63b72 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Directory.md @@ -0,0 +1,30 @@ +# Directory + +- `v::directory()` + +Validates directories. + +```php +v::directory()->validate(__DIR__); // true +v::directory()->validate(__FILE__); // false +``` + +This validator will consider SplFileInfo instances, so you can do something like: + +```php +v::directory()->validate(new \SplFileInfo($directory)); +``` + +*** +See also: + + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Domain.md b/vendor/respect/validation/docs/rules/Domain.md new file mode 100644 index 0000000000..ac5d76a7b7 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Domain.md @@ -0,0 +1,40 @@ +# Domain + +- `v::domain()` +- `v::domain(boolean $tldCheck = true)` + +Validates domain names. + +```php +v::domain()->validate('google.com'); +``` + +You can skip *top level domain* (TLD) checks to validate internal +domain names: + +```php +v::domain(false)->validate('dev.machine.local'); +``` + +This is a composite validator, it validates several rules +internally: + + * If input is an IP address, it fails. + * If input contains whitespace, it fails. + * If input does not contain any dots, it fails. + * If input has less than two parts, it fails. + * Input must end with a top-level-domain to pass (if not skipped). + * Each part must be alphanumeric and not start with an hyphen. + * [PunnyCode][] is accepted for [Internationalizing Domain Names in Applications][IDNA]. + +Messages for this validator will reflect rules above. + +*** +See also: + + * [Ip](Ip.md) + * [MacAddress](MacAddress.md) + * [Tld](Tld.md) + +[PunnyCode]: http://en.wikipedia.org/wiki/Punycode "Wikipedia: Punnycode" +[IDNA]: http://en.wikipedia.org/wiki/Internationalized_domain_name#Internationalizing_Domain_Names_in_Applications "Wikipedia: Internationalized domain name" diff --git a/vendor/respect/validation/docs/rules/Each.md b/vendor/respect/validation/docs/rules/Each.md new file mode 100644 index 0000000000..ecc1c66635 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Each.md @@ -0,0 +1,27 @@ +# Each + +- `v::each(v $validatorForValue)` +- `v::each(null, v $validatorForKey)` +- `v::each(v $validatorForValue, v $validatorForKey)` + +Iterates over an array or Iterator and validates the value or key +of each entry: + +```php +$releaseDates = [ + 'validation' => '2010-01-01', + 'template' => '2011-01-01', + 'relational' => '2011-02-05', +]; + +v::arrayVal()->each(v::date())->validate($releaseDates); // true +v::arrayVal()->each(v::date(), v::stringType()->lowercase())->validate($releaseDates); // true +``` + +Using `arrayVal()` before `each()` is a best practice. + +*** +See also: + + * [Key](Key.md) + * [ArrayVal](ArrayVal.md) diff --git a/vendor/respect/validation/docs/rules/Email.md b/vendor/respect/validation/docs/rules/Email.md new file mode 100644 index 0000000000..64a4d7cf3c --- /dev/null +++ b/vendor/respect/validation/docs/rules/Email.md @@ -0,0 +1,16 @@ +# Email + +- `v::email()` + +Validates an email address. + +```php +v::email()->validate('alexandre@gaigalas.net'); // true +``` + +*** +See also: + + * [Phone](Phone.md) + * [Url](Url.md) + * [VideoUrl](VideoUrl.md) diff --git a/vendor/respect/validation/docs/rules/EndsWith.md b/vendor/respect/validation/docs/rules/EndsWith.md new file mode 100644 index 0000000000..99ec5b215a --- /dev/null +++ b/vendor/respect/validation/docs/rules/EndsWith.md @@ -0,0 +1,31 @@ +# EndsWith + +- `v::endsWith(mixed $value)` +- `v::endsWith(mixed $value, boolean $identical = false)` + +This validator is similar to `v::contains()`, but validates +only if the value is at the end of the input. + +For strings: + +```php +v::endsWith('ipsum')->validate('lorem ipsum'); // true +``` + +For arrays: + +```php +v::endsWith('ipsum')->validate(['lorem', 'ipsum']); // true +``` + +A second parameter may be passed for identical comparison instead +of equal comparison. + +Message template for this validator includes `{{endValue}}`. + +*** +See also: + + * [StartsWith](StartsWith.md) + * [Contains](Contains.md) + * [In](In.md) diff --git a/vendor/respect/validation/docs/rules/Equals.md b/vendor/respect/validation/docs/rules/Equals.md new file mode 100644 index 0000000000..e28f783dfc --- /dev/null +++ b/vendor/respect/validation/docs/rules/Equals.md @@ -0,0 +1,17 @@ +# Equals + +- `v::equals(mixed $value)` + +Validates if the input is equal to some value. + +```php +v::equals('alganet')->validate('alganet'); // true +``` + +Message template for this validator includes `{{compareTo}}`. + +*** +See also: + + * [Contains](Contains.md) + * [Identical](Identical.md) diff --git a/vendor/respect/validation/docs/rules/Even.md b/vendor/respect/validation/docs/rules/Even.md new file mode 100644 index 0000000000..da52597b85 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Even.md @@ -0,0 +1,17 @@ +# Even + +- `v::even()` + +Validates an even number. + +```php +v::intVal()->even()->validate(2); // true +``` + +Using `int()` before `even()` is a best practice. + +*** +See also: + + * [Odd](Odd.md) + * [Multiple](Multiple.md) diff --git a/vendor/respect/validation/docs/rules/Executable.md b/vendor/respect/validation/docs/rules/Executable.md new file mode 100644 index 0000000000..7c1e1303dc --- /dev/null +++ b/vendor/respect/validation/docs/rules/Executable.md @@ -0,0 +1,23 @@ +# Executable + +- `v::executable()` + +Validates if a file is an executable. + +```php +v::email()->executable('script.sh'); // true +``` + +*** +See also: + + * [Directory](Directory.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Exists.md b/vendor/respect/validation/docs/rules/Exists.md new file mode 100644 index 0000000000..681c50743b --- /dev/null +++ b/vendor/respect/validation/docs/rules/Exists.md @@ -0,0 +1,30 @@ +# Exists + +- `v::exists()` + +Validates files or directories. + +```php +v::exists()->validate(__FILE__); // true +v::exists()->validate(__DIR__); // true +``` + +This validator will consider SplFileInfo instances, so you can do something like: + +```php +v::exists()->validate(new \SplFileInfo($file)); +``` + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Extension.md b/vendor/respect/validation/docs/rules/Extension.md new file mode 100644 index 0000000000..4abc0d5ba5 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Extension.md @@ -0,0 +1,25 @@ +# Extension + +- `v::extension(string $extension)` + +Validates if the file extension matches the expected one: + +```php +v::extension('png')->validate('image.png'); // true +``` + +This rule is case-sensitive. + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Factor.md b/vendor/respect/validation/docs/rules/Factor.md new file mode 100644 index 0000000000..1e04276432 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Factor.md @@ -0,0 +1,19 @@ +# Factor + +- `v::factor(int $dividend)` + +Validates if the input is a factor of the defined dividend. + +```php +v::factor(0)->validate(5); // true +v::factor(4)->validate(2); // true +v::factor(4)->validate(3); // false +``` + +*** +See also: + + * [Digit](Digit.md) + * [Finite](Finite.md) + * [Infinite](Infinite.md) + * [Numeric](Numeric.md) diff --git a/vendor/respect/validation/docs/rules/FalseVal.md b/vendor/respect/validation/docs/rules/FalseVal.md new file mode 100644 index 0000000000..6ca060d33c --- /dev/null +++ b/vendor/respect/validation/docs/rules/FalseVal.md @@ -0,0 +1,21 @@ +# FalseVal + +- `v::falseVal()` + +Validates if a value is considered as `false`. + +```php +v::falseVal()->validate(false); // true +v::falseVal()->validate(0); // true +v::falseVal()->validate('0'); // true +v::falseVal()->validate('false'); // true +v::falseVal()->validate('off'); // true +v::falseVal()->validate('no'); // true +v::falseVal()->validate('0.5'); // false +v::falseVal()->validate('2'); // false +``` + +*** +See also: + + * [TrueVal](TrueVal.md) diff --git a/vendor/respect/validation/docs/rules/Fibonacci.md b/vendor/respect/validation/docs/rules/Fibonacci.md new file mode 100644 index 0000000000..fe8c5235b7 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Fibonacci.md @@ -0,0 +1,17 @@ +# Fibonacci + + - `v::fibonacci()` + +Validates whether the input follows the Fibonacci integer sequence. + +```php +v::fibonacci()->validate(1); // true +v::fibonacci()->validate('34'); // true +v::fibonacci()->validate(6); // false +``` + +*** +See also: + + * [PrimeNumber](PrimeNumber.md) + * [PerfectSquare](PerfectSquare.md) \ No newline at end of file diff --git a/vendor/respect/validation/docs/rules/File.md b/vendor/respect/validation/docs/rules/File.md new file mode 100644 index 0000000000..8454d0258d --- /dev/null +++ b/vendor/respect/validation/docs/rules/File.md @@ -0,0 +1,30 @@ +# File + +- `v::file()` + +Validates files. + +```php +v::file()->validate(__FILE__); // true +v::file()->validate(__DIR__); // false +``` + +This validator will consider SplFileInfo instances, so you can do something like: + +```php +v::file()->validate(new \SplFileInfo($file)); +``` + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/FilterVar.md b/vendor/respect/validation/docs/rules/FilterVar.md new file mode 100644 index 0000000000..a13d4fa091 --- /dev/null +++ b/vendor/respect/validation/docs/rules/FilterVar.md @@ -0,0 +1,18 @@ +# FilterVar + +- `v::filterVar(int $filter)` +- `v::filterVar(int $filter, mixed $options)` + +A wrapper for PHP's [filter_var()](http://php.net/filter_var) function. + +```php +v::filterVar(FILTER_VALIDATE_EMAIL)->validate('bob@example.com'); // true +v::filterVar(FILTER_VALIDATE_URL)->validate('http://example.com'); // true +v::filterVar(FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)->validate('http://example.com'); // false +v::filterVar(FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)->validate('http://example.com/path'); // true +``` + +*** +See also: + + * [Callback](Callback.md) diff --git a/vendor/respect/validation/docs/rules/Finite.md b/vendor/respect/validation/docs/rules/Finite.md new file mode 100644 index 0000000000..42ef9f30d6 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Finite.md @@ -0,0 +1,18 @@ +# Finite + +- `v::finite()` + +Validates if the input is a finite number. + +```php +v::finite()->validate('10'); // true +v::finite()->validate(10); // true +``` + +*** +See also: + + * [Digit](Digit.md) + * [Infinite](Infinite.md) + * [IntVal](IntVal.md) + * [Numeric](Numeric.md) diff --git a/vendor/respect/validation/docs/rules/FloatType.md b/vendor/respect/validation/docs/rules/FloatType.md new file mode 100644 index 0000000000..87efee8351 --- /dev/null +++ b/vendor/respect/validation/docs/rules/FloatType.md @@ -0,0 +1,25 @@ +# FloatType + +- `v::floatType()` + +Validates whether the type of a value is float. + +```php +v::floatType()->validate(1.5); // true +v::floatType()->validate('1.5'); // false +v::floatType()->validate(0e5); // true +``` + +*** +See also: + + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [FloatVal](FloatVal.md) + * [IntType](IntType.md) + * [IntVal](IntVal.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/FloatVal.md b/vendor/respect/validation/docs/rules/FloatVal.md new file mode 100644 index 0000000000..f73c2fc073 --- /dev/null +++ b/vendor/respect/validation/docs/rules/FloatVal.md @@ -0,0 +1,17 @@ +# FloatVal + +- `v::floatVal()` + +Validates a floating point number. + +```php +v::floatVal()->validate(1.5); // true +v::floatVal()->validate('1e5'); // true +``` + +*** +See also: + + * [FloatType](FloatType.md) + * [IntType](IntType.md) + * [IntVal](IntVal.md) diff --git a/vendor/respect/validation/docs/rules/Graph.md b/vendor/respect/validation/docs/rules/Graph.md new file mode 100644 index 0000000000..2c7503ad78 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Graph.md @@ -0,0 +1,15 @@ +# Graph + +- `v::graph()` +- `v::graph(string $additionalChars)` + +Validates all characters that are graphically represented. + +```php +v::graph()->validate('LKM@#$%4;'); // true +``` + +*** +See also: + + * [Prnt](Prnt.md) diff --git a/vendor/respect/validation/docs/rules/HexRgbColor.md b/vendor/respect/validation/docs/rules/HexRgbColor.md new file mode 100644 index 0000000000..3e4a1e98d9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/HexRgbColor.md @@ -0,0 +1,16 @@ +# HexRgbColor + +- `v::hexRgbColor()` + +Validates a hex RGB color + +```php +v::hexRgbColor()->validate('#FFFAAA'); // true +v::hexRgbColor()->validate('123123'); // true +v::hexRgbColor()->validate('FCD'); // true +``` + +*** +See also: + + * [Vxdigit](Vxdigit.md) diff --git a/vendor/respect/validation/docs/rules/Identical.md b/vendor/respect/validation/docs/rules/Identical.md new file mode 100644 index 0000000000..0a280678ab --- /dev/null +++ b/vendor/respect/validation/docs/rules/Identical.md @@ -0,0 +1,18 @@ +# Identical + +- `v::identical(mixed $value)` + +Validates if the input is identical to some value. + +```php +v::identical(42)->validate(42); // true +v::identical(42)->validate('42'); // false +``` + +Message template for this validator includes `{{compareTo}}`. + +*** +See also: + + * [Contains](Contains.md) + * [Equals](Equals.md) diff --git a/vendor/respect/validation/docs/rules/IdentityCard.md b/vendor/respect/validation/docs/rules/IdentityCard.md new file mode 100644 index 0000000000..052eca1a28 --- /dev/null +++ b/vendor/respect/validation/docs/rules/IdentityCard.md @@ -0,0 +1,21 @@ +# IdentityCard + +- `v::identityCard(string $countryCode)` + +Validates Identity Card numbers according to the defined country. + +```php +v::identityCard('PL')->validate('AYW036733'); // true +v::identityCard('PL')->validate('APH505567'); // true +v::identityCard('PL')->validate('APH 505567'); // false +v::identityCard('PL')->validate('AYW036731'); // false +``` + +For now this rule only accepts Polish Identity Card numbers (Dowód Osobisty). + +*** +See also: + + * [Bank](Bank.md) + * [Pesel](Pesel.md) + * [SubdivisionCode](SubdivisionCode.md) diff --git a/vendor/respect/validation/docs/rules/Image.md b/vendor/respect/validation/docs/rules/Image.md new file mode 100644 index 0000000000..5a84facf66 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Image.md @@ -0,0 +1,32 @@ +# Image + +- `v::image()` +- `v::image(finfo $fileInfo)` + +Validates if the file is a valid image by checking its MIME type. + +```php +v::image()->validate('image.gif'); // true +v::image()->validate('image.jpg'); // true +v::image()->validate('image.png'); // true +``` + +All the validations above must return `false` if the input is not a valid file +or of the MIME doesn't match with the file extension. + +This rule relies on [fileinfo](http://php.net/fileinfo) PHP extension. + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Imei.md b/vendor/respect/validation/docs/rules/Imei.md new file mode 100644 index 0000000000..96ed8e0a2a --- /dev/null +++ b/vendor/respect/validation/docs/rules/Imei.md @@ -0,0 +1,20 @@ +# Imei + +- `v::imei()` + +Validates is the input is a valid [IMEI][]. + +```php +v::imei()->validate('35-209900-176148-1'); // true +v::imei()->validate('490154203237518'); // true +``` + +*** +See also: + + * [Bsn](Bsn.md) + * [Cnh](Cnh.md) + * [Cnpj](Cnpj.md) + * [Cpf](Cpf.md) + +[IMEI]: https://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity "International Mobile Station Equipment Identity" diff --git a/vendor/respect/validation/docs/rules/In.md b/vendor/respect/validation/docs/rules/In.md new file mode 100644 index 0000000000..a8aa698141 --- /dev/null +++ b/vendor/respect/validation/docs/rules/In.md @@ -0,0 +1,30 @@ +# In + +- `v::in(mixed $haystack)` +- `v::in(mixed $haystack, boolean $identical = false)` + +Validates if the input is contained in a specific haystack. + +For strings: + +```php +v::in('lorem ipsum')->validate('ipsum'); // true +``` + +For arrays: + +```php +v::in(['lorem', 'ipsum'])->validate('lorem'); // true +``` + +A second parameter may be passed for identical comparison instead +of equal comparison. + +Message template for this validator includes `{{haystack}}`. + +*** +See also: + + * [StartsWith](StartsWith.md) + * [EndsWith](EndsWith.md) + * [Contains](Contains.md) diff --git a/vendor/respect/validation/docs/rules/Infinite.md b/vendor/respect/validation/docs/rules/Infinite.md new file mode 100644 index 0000000000..d29c666a4f --- /dev/null +++ b/vendor/respect/validation/docs/rules/Infinite.md @@ -0,0 +1,17 @@ +# Infinite + +- `v::infinite()` + +Validates if the input is an infinite number. + +```php +v::infinite()->validate(INF); // true +``` + +*** +See also: + + * [Digit](Digit.md) + * [Finite](Finite.md) + * [IntVal](IntVal.md) + * [Numeric](Numeric.md) diff --git a/vendor/respect/validation/docs/rules/Instance.md b/vendor/respect/validation/docs/rules/Instance.md new file mode 100644 index 0000000000..bbb45dd0c8 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Instance.md @@ -0,0 +1,17 @@ +# Instance + +- `v::instance(string $instanceName)` + +Validates if the input is an instance of the given class or interface. + +```php +v::instance('DateTime')->validate(new DateTime); // true +v::instance('Traversable')->validate(new ArrayObject); // true +``` + +Message template for this validator includes `{{instanceName}}`. + +*** +See also: + + * [ObjectType](ObjectType.md) diff --git a/vendor/respect/validation/docs/rules/IntType.md b/vendor/respect/validation/docs/rules/IntType.md new file mode 100644 index 0000000000..d4313657fc --- /dev/null +++ b/vendor/respect/validation/docs/rules/IntType.md @@ -0,0 +1,27 @@ +# IntType + +- `v::intType()` + +Validates whether the type of a value is integer. + +```php +v::intType()->validate(42); // true +v::intType()->validate('10'); // false +``` + +*** +See also: + + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [Digit](Digit.md) + * [Finite](Finite.md) + * [FloatType](FloatType.md) + * [Infinite](Infinite.md) + * [IntVal](IntVal.md) + * [NullType](NullType.md) + * [Numeric](Numeric.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/IntVal.md b/vendor/respect/validation/docs/rules/IntVal.md new file mode 100644 index 0000000000..18a0404619 --- /dev/null +++ b/vendor/respect/validation/docs/rules/IntVal.md @@ -0,0 +1,18 @@ +# IntVal + +- `v::intVal()` + +Validates if the input is an integer. + +```php +v::intVal()->validate('10'); // true +v::intVal()->validate(10); // true +``` + +*** +See also: + + * [Digit](Digit.md) + * [Finite](Finite.md) + * [Infinite](Infinite.md) + * [Numeric](Numeric.md) diff --git a/vendor/respect/validation/docs/rules/Ip.md b/vendor/respect/validation/docs/rules/Ip.md new file mode 100644 index 0000000000..927dbc7ef6 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Ip.md @@ -0,0 +1,24 @@ +# Ip + +- `v::ip()` +- `v::ip(mixed $options)` + +Validates IP Addresses. This validator uses the native filter_var() +PHP function. + +```php +v::ip()->validate('192.168.0.1'); +``` + +You can pass a parameter with filter_var flags for IP. + +```php +v::ip(FILTER_FLAG_NO_PRIV_RANGE)->validate('127.0.0.1'); // false +``` + +*** +See also: + + * [Domain](Domain.md) + * [MacAddress](MacAddress.md) + * [Tld](Tld.md) diff --git a/vendor/respect/validation/docs/rules/Iterable.md b/vendor/respect/validation/docs/rules/Iterable.md new file mode 100644 index 0000000000..b64abe2889 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Iterable.md @@ -0,0 +1,5 @@ +# Iterable + +- `v::iterable()` + +**Deprecated**: Use [IterableType](IterableType.md) instead. diff --git a/vendor/respect/validation/docs/rules/IterableType.md b/vendor/respect/validation/docs/rules/IterableType.md new file mode 100644 index 0000000000..a246af271f --- /dev/null +++ b/vendor/respect/validation/docs/rules/IterableType.md @@ -0,0 +1,20 @@ +# IterableType + +- `v::iterableType()` + +Validates if the input is iterable, in other words, if you're able to iterate +over it with [foreach](http://php.net/foreach) language construct. + +```php +v::iterableType()->validate([]); // true +v::iterableType()->validate(new ArrayObject()); // true +v::iterableType()->validate(new stdClass()); // true +v::iterableType()->validate('string'); // false +``` + +*** +See also: + + * [ArrayVal](ArrayVal.md) + * [Countable](Countable.md) + * [Instance](Instance.md) diff --git a/vendor/respect/validation/docs/rules/Json.md b/vendor/respect/validation/docs/rules/Json.md new file mode 100644 index 0000000000..eb41367cea --- /dev/null +++ b/vendor/respect/validation/docs/rules/Json.md @@ -0,0 +1,18 @@ +# Json + +- `v::json()` + +Validates if the given input is a valid JSON. + +```php +v::json()->validate('{"foo":"bar"}'); // true +``` + +*** +See also: + + * [Domain](Domain.md) + * [Email](Email.md) + * [FilterVar](FilterVar.md) + * [Phone](Phone.md) + * [VideoUrl](VideoUrl.md) diff --git a/vendor/respect/validation/docs/rules/Key.md b/vendor/respect/validation/docs/rules/Key.md new file mode 100644 index 0000000000..70a74c07a5 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Key.md @@ -0,0 +1,34 @@ +# Key + +- `v::key(string $name)` +- `v::key(string $name, v $validator)` +- `v::key(string $name, v $validator, boolean $mandatory = true)` + +Validates an array key. + +```php +$dict = [ + 'foo' => 'bar' +]; + +v::key('foo')->validate($dict); // true +``` + +You can also validate the key value itself: + +```php +v::key('foo', v::equals('bar'))->validate($dict); // true +``` + +Third parameter makes the key presence optional: + +```php +v::key('lorem', v::stringType(), false)->validate($dict); // true +``` + +The name of this validator is automatically set to the key name. + +*** +See also: + + * [Attribute](Attribute.md) diff --git a/vendor/respect/validation/docs/rules/KeyNested.md b/vendor/respect/validation/docs/rules/KeyNested.md new file mode 100644 index 0000000000..3129dde31c --- /dev/null +++ b/vendor/respect/validation/docs/rules/KeyNested.md @@ -0,0 +1,40 @@ +# KeyNested + +- `v::keyNested(string $name)` +- `v::keyNested(string $name, v $validator)` +- `v::keyNested(string $name, v $validator, boolean $mandatory = true)` + +Validates an array key or an object property using `.` to represent nested data. + +Validating keys from arrays or `ArrayAccess` instances: + +```php +$array = [ + 'foo' => [ + 'bar' => 123, + ], +]; + +v::keyNested('foo.bar')->validate($array); // true +``` + +Validating object properties: + +```php +$object = new stdClass(); +$object->foo = new stdClass(); +$object->foo->bar = 42; + +v::keyNested('foo.bar')->validate($object); // true +``` + +This rule was inspired by [Yii2 ArrayHelper][]. + +*** +See also: + + * [Attribute](Attribute.md) + * [Key](Key.md) + + +[Yii2 ArrayHelper]: https://github.com/yiisoft/yii2/blob/68c30c1/framework/helpers/BaseArrayHelper.php "Yii2 ArrayHelper" diff --git a/vendor/respect/validation/docs/rules/KeySet.md b/vendor/respect/validation/docs/rules/KeySet.md new file mode 100644 index 0000000000..faf40818aa --- /dev/null +++ b/vendor/respect/validation/docs/rules/KeySet.md @@ -0,0 +1,51 @@ +# KeySet + +- `v::keySet(Key $rule...)` + +Validates a keys in a defined structure. + +```php +$dict = ['foo' => 42]; + +v::keySet( + v::key('foo', v::intVal()) +)->validate($dict); // true +``` + +Extra keys are not allowed: +```php +$dict = ['foo' => 42, 'bar' => 'String']; + +v::keySet( + v::key('foo', v::intVal()) +)->validate($dict); // false +``` + +Missing required keys are not allowed: +```php +$dict = ['foo' => 42, 'bar' => 'String']; + +v::keySet( + v::key('foo', v::intVal()), + v::key('bar', v::stringType()), + v::key('baz', v::boolType()) +)->validate($dict); // false +``` + +Missing non-required keys are allowed: +```php +$dict = ['foo' => 42, 'bar' => 'String']; + +v::keySet( + v::key('foo', v::intVal()), + v::key('bar', v::stringType()), + v::key('baz', v::boolType(), false) +)->validate($dict); // true +``` + +The keys' order is not considered in the validation. + +*** +See also: + + * [Key](Key.md) diff --git a/vendor/respect/validation/docs/rules/KeyValue.md b/vendor/respect/validation/docs/rules/KeyValue.md new file mode 100644 index 0000000000..98ee9db873 --- /dev/null +++ b/vendor/respect/validation/docs/rules/KeyValue.md @@ -0,0 +1,62 @@ +# KeyValue + +- `keyValue(string $comparedKey, string $ruleName, string $baseKey)` + +Performs validation of `$comparedKey` using the rule named on `$ruleName` with +`$baseKey` as base. + +Sometimes, when validating arrays, the validation of a key value depends on +another key value and that may cause some ugly code since you need the input +before the validation, making some checking manually: + +```php +v::key('password')->check($_POST); +v::key('password_confirmation', v::equals($_POST['password']))->check($_POST); +``` + +The problem with the above code is because you do not know if `password` is a +valid key, so you must check it manually before performing the validation on +`password_confirmation`. + +The `keyValue()` rule makes this job easier by creating a rule named on +`$ruleName` passing `$baseKey` as the first argument of this rule, see an example: + +```php +v::keyValue('password_confirmation', 'equals', 'password')->validate($_POST); +``` + +The above code will result on `true` if _`$_POST['password_confirmation']` is +[equals](Equals.md) to `$_POST['password']`_, it's the same of: + +See another example: + +```php +v::keyValue('state', 'subdivisionCode', 'country')->validate($_POST); +``` + +The above code will result on `true` if _`$_POST['state']` is a +[subdivision code](SubdivisionCode.md) of `$_POST['country']`_: + +This rule will invalidate the input if `$comparedKey` or `$baseKey` don't exist, +or if the rule named on `$ruleName` could not be created (or don't exist). + +When using `assert()` or `check()` methods and the rule do not pass, it overwrites +all values in the validation exceptions with `$baseKey` and `$comparedKey`. + +```php +v::keyValue('password_confirmation', 'equals', 'password')->check($input); +``` + +The above code may generate the message: + +``` +password_confirmation must be equals "password" +``` + +*** +See also: + + * [Key](Key.md) + * [KeyNested](KeyNested.md) + * [KeySet](KeySet.md) + diff --git a/vendor/respect/validation/docs/rules/LanguageCode.md b/vendor/respect/validation/docs/rules/LanguageCode.md new file mode 100644 index 0000000000..a990f315a9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/LanguageCode.md @@ -0,0 +1,20 @@ +# LanguageCode + +- `v::languageCode()` + +Validates a language code based on ISO 639: + +```php +v::languageCode()->validate('pt'); // true +v::languageCode()->validate('en'); // true +v::languageCode()->validate('it'); // true +v::languageCode('alpha-3')->validate('ita'); // true +v::languageCode('alpha-3')->validate('eng'); // true +``` + +You can choose between alpha-2 and alpha-3, alpha-2 is set by default. + +*** +See also: + + * [CountryCode](CountryCode.md) \ No newline at end of file diff --git a/vendor/respect/validation/docs/rules/LeapDate.md b/vendor/respect/validation/docs/rules/LeapDate.md new file mode 100644 index 0000000000..aa0e7581f7 --- /dev/null +++ b/vendor/respect/validation/docs/rules/LeapDate.md @@ -0,0 +1,18 @@ +# LeapDate + +- `v::leapDate(string $format)` + +Validates if a date is leap. + +```php +v::leapDate('Y-m-d')->validate('1988-02-29'); // true +``` + +This validator accepts DateTime instances as well. The $format +parameter is mandatory. + +*** +See also: + + * [Date](Date.md) + * [LeapYear](LeapYear.md) diff --git a/vendor/respect/validation/docs/rules/LeapYear.md b/vendor/respect/validation/docs/rules/LeapYear.md new file mode 100644 index 0000000000..db20899316 --- /dev/null +++ b/vendor/respect/validation/docs/rules/LeapYear.md @@ -0,0 +1,17 @@ +# LeapYear + +- `v::leapYear()` + +Validates if a year is leap. + +```php +v::leapYear()->validate('1988'); // true +``` + +This validator accepts DateTime instances as well. + +*** +See also: + + * [Date](Date.md) + * [LeapDate](LeapDate.md) diff --git a/vendor/respect/validation/docs/rules/Length.md b/vendor/respect/validation/docs/rules/Length.md new file mode 100644 index 0000000000..2fbf519536 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Length.md @@ -0,0 +1,44 @@ +# Length + +- `v::length(int $min, int $max)` +- `v::length(int $min, null)` +- `v::length(null, int $max)` +- `v::length(int $min, int $max, boolean $inclusive = true)` + +Validates lengths. Most simple example: + +```php +v::stringType()->length(1, 5)->validate('abc'); // true +``` + +You can also validate only minimum length: + +```php +v::stringType()->length(5, null)->validate('abcdef'); // true +``` + +Only maximum length: + +```php +v::stringType()->length(null, 5)->validate('abc'); // true +``` + +The type as the first validator in a chain is a good practice, +since length accepts many types: + +```php +v::arrayVal()->length(1, 5)->validate(['foo', 'bar']); // true +``` + +A third parameter may be passed to validate the passed values inclusive: + +```php +v::stringType()->length(1, 5, true)->validate('a'); // true +``` + +Message template for this validator includes `{{minValue}}` and `{{maxValue}}`. + +*** +See also: + + * [Between](Between.md) diff --git a/vendor/respect/validation/docs/rules/Lowercase.md b/vendor/respect/validation/docs/rules/Lowercase.md new file mode 100644 index 0000000000..a79f82b76f --- /dev/null +++ b/vendor/respect/validation/docs/rules/Lowercase.md @@ -0,0 +1,14 @@ +# Lowercase + +- `v::lowercase()` + +Validates if string characters are lowercase in the input: + +```php +v::stringType()->lowercase()->validate('xkcd'); // true +``` + +*** +See also: + + * [Uppercase](Uppercase.md) diff --git a/vendor/respect/validation/docs/rules/MacAddress.md b/vendor/respect/validation/docs/rules/MacAddress.md new file mode 100644 index 0000000000..92f427af30 --- /dev/null +++ b/vendor/respect/validation/docs/rules/MacAddress.md @@ -0,0 +1,17 @@ +# MacAddress + +- `v::macAddress()` + +Validates a Mac Address. + +```php +v::macAddress()->validate('00:11:22:33:44:55'); // true +v::macAddress()->validate('af-AA-22-33-44-55'); // true +``` + +*** +See also: + + * [Domain](Domain.md) + * [Ip](Ip.md) + * [Tld](Tld.md) diff --git a/vendor/respect/validation/docs/rules/Max.md b/vendor/respect/validation/docs/rules/Max.md new file mode 100644 index 0000000000..1c199b9497 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Max.md @@ -0,0 +1,36 @@ +# Max + +- `v::max(mixed $maxValue)` +- `v::max(mixed $maxValue, boolean $inclusive = true)` + +Validates if the input doesn't exceed the maximum value. + +```php +v::intVal()->max(15)->validate(20); // false +v::intVal()->max(20)->validate(20); // false +v::intVal()->max(20, true)->validate(20); // true +``` + +Also accepts dates: + +```php +v::date()->max('2012-01-01')->validate('2010-01-01'); // true +``` + +Also date intervals: + +```php +// Same of minimum age validation +v::date()->max('-18 years')->validate('1988-09-09'); // true +``` + +`true` may be passed as a parameter to indicate that inclusive +values must be used. + +Message template for this validator includes `{{maxValue}}`. + +*** +See also: + + * [Min](Min.md) + * [Between](Between.md) diff --git a/vendor/respect/validation/docs/rules/Mimetype.md b/vendor/respect/validation/docs/rules/Mimetype.md new file mode 100644 index 0000000000..a2af05e8c7 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Mimetype.md @@ -0,0 +1,25 @@ +# Mimetype + +- `v::mimetype(string $mimetype)` + +Validates if the file mimetype matches the expected one: + +```php +v::mimetype('image/png')->validate('image.png'); // true +``` + +This rule is case-sensitive and requires [fileinfo](http://php.net/fileinfo) PHP extension. + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Min.md b/vendor/respect/validation/docs/rules/Min.md new file mode 100644 index 0000000000..460154f25f --- /dev/null +++ b/vendor/respect/validation/docs/rules/Min.md @@ -0,0 +1,29 @@ +# Min + +- `v::min(mixed $minValue)` +- `v::min(mixed $minValue, boolean $inclusive = true)` + +Validates if the input is greater than the minimum value. + +```php +v::intVal()->min(15)->validate(5); // false +v::intVal()->min(5)->validate(5); // false +v::intVal()->min(5, true)->validate(5); // true +``` + +Also accepts dates: + +```php +v::date()->min('2012-01-01')->validate('2015-01-01'); // true +``` + +`true` may be passed as a parameter to indicate that inclusive +values must be used. + +Message template for this validator includes `{{minValue}}`. + +*** +See also: + + * [Max](Max.md) + * [Between](Between.md) diff --git a/vendor/respect/validation/docs/rules/MinimumAge.md b/vendor/respect/validation/docs/rules/MinimumAge.md new file mode 100644 index 0000000000..33b457ae0b --- /dev/null +++ b/vendor/respect/validation/docs/rules/MinimumAge.md @@ -0,0 +1,23 @@ +# MinimumAge + +This is going to be deprecated, please use [Age](Age.md) instead. + +- `v::minimumAge(int $age)` +- `v::minimumAge(int $age, string $format)` + +Validates a minimum age for a given date. + +```php +v::minimumAge(18)->validate('1987-01-01'); // true +v::minimumAge(18, 'd/m/Y')->validate('01/01/1987'); // true +``` + +Using `date()` before is a best-practice. + +Message template for this validator includes `{{age}}`. + +*** +See also: + + * [Age](Age.md) + * [Date](Date.md) diff --git a/vendor/respect/validation/docs/rules/Multiple.md b/vendor/respect/validation/docs/rules/Multiple.md new file mode 100644 index 0000000000..b6d8c7ff02 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Multiple.md @@ -0,0 +1,14 @@ +# Multiple + +- `v::multiple(int $multipleOf)` + +Validates if the input is a multiple of the given parameter + +```php +v::intVal()->multiple(3)->validate(9); // true +``` + +*** +See also: + + * [PrimeNumber](PrimeNumber.md) diff --git a/vendor/respect/validation/docs/rules/Negative.md b/vendor/respect/validation/docs/rules/Negative.md new file mode 100644 index 0000000000..efecb52018 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Negative.md @@ -0,0 +1,14 @@ +# Negative + +- `v::negative()` + +Validates if a number is lower than zero + +```php +v::numeric()->negative()->validate(-15); // true +``` + +*** +See also: + + * [Positive](Positive.md) diff --git a/vendor/respect/validation/docs/rules/NfeAccessKey.md b/vendor/respect/validation/docs/rules/NfeAccessKey.md new file mode 100644 index 0000000000..2f9188f1b0 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NfeAccessKey.md @@ -0,0 +1,16 @@ +# NfeAccessKey + +- `v::nfeAccessKey(string $accessKey)` + +Validates the access key of the Brazilian electronic invoice (NFe). + +```php +v::nfeAccessKey()->validate('31841136830118868211870485416765268625116906'); // true +``` + +*** +See also: + + * [Cnh](Cnh.md) + * [Cnpj](Cnpj.md) + * [Cpf](Cpf.md) diff --git a/vendor/respect/validation/docs/rules/No.md b/vendor/respect/validation/docs/rules/No.md new file mode 100644 index 0000000000..e50b4c72be --- /dev/null +++ b/vendor/respect/validation/docs/rules/No.md @@ -0,0 +1,24 @@ +# No + +- `v::no()` +- `v::no(boolean $locale)` + +Validates if value is considered as "No". + +```php +v::no()->validate('N'); // true +v::no()->validate('Nay'); // true +v::no()->validate('Nix'); // true +v::no()->validate('No'); // true +v::no()->validate('Nope'); // true +v::no()->validate('Not'); // true +``` + +This rule is case insensitive. + +If `$locale` is TRUE, uses the value of [nl_langinfo()](http://php.net/nl_langinfo) with `NOEXPR` constant. + +*** +See also: + + * [Yes](Yes.md) diff --git a/vendor/respect/validation/docs/rules/NoWhitespace.md b/vendor/respect/validation/docs/rules/NoWhitespace.md new file mode 100644 index 0000000000..052cfcdee0 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NoWhitespace.md @@ -0,0 +1,21 @@ +# NoWhitespace + +- `v::noWhitespace()` + +Validates if a string contains no whitespace (spaces, tabs and line breaks); + +```php +v::noWhitespace()->validate('foo bar'); //false +v::noWhitespace()->validate("foo\nbar"); // false +``` + +This is most useful when chaining with other validators such as `v::alnum()` + +*** +See also: + + * [Alnum](Alnum.md) + * [Alpha](Alpha.md) + * [NotBlank](NotBlank.md) + * [NotEmpty](NotEmpty.md) + * [NotOptional](NotOptional.md) diff --git a/vendor/respect/validation/docs/rules/NoneOf.md b/vendor/respect/validation/docs/rules/NoneOf.md new file mode 100644 index 0000000000..44e91537e8 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NoneOf.md @@ -0,0 +1,21 @@ +# NoneOf + +- `v::noneOf(v $v1, v $v2, v $v3...)` + +Validates if NONE of the given validators validate: + +```php +v::noneOf( + v::intVal(), + v::floatVal() +)->validate('foo'); // true +``` + +In the sample above, 'foo' isn't a integer nor a float, so noneOf returns true. + +*** +See also: + + * [Not](Not.md) + * [AllOf](AllOf.md) + * [OneOf](OneOf.md) diff --git a/vendor/respect/validation/docs/rules/Not.md b/vendor/respect/validation/docs/rules/Not.md new file mode 100644 index 0000000000..31f575bca1 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Not.md @@ -0,0 +1,24 @@ +# Not + +- `v::not(v $negatedValidator)` + +Negates any rule. + +```php +v::not(v::ip())->validate('foo'); // true +``` + +In the sample above, validator returns true because 'foo' isn't an IP Address. + +You can negate complex, grouped or chained validators as well: + +```php +v::not(v::intVal()->positive())->validate(-1.5); // true +``` + +Each other validation has custom messages for negated rules. + +*** +See also: + + * [NoneOf](NoneOf.md) diff --git a/vendor/respect/validation/docs/rules/NotBlank.md b/vendor/respect/validation/docs/rules/NotBlank.md new file mode 100644 index 0000000000..35a5ef2de2 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NotBlank.md @@ -0,0 +1,34 @@ +# NotBlank + +- `v::notBlank()` + +Validates if the given input is not a blank value (`null`, zeros, empty strings +or empty arrays, recursively). + +```php +v::notBlank()->validate(null); // false +v::notBlank()->validate(''); // false +v::notBlank()->validate([]); // false +v::notBlank()->validate(' '); // false +v::notBlank()->validate(0); // false +v::notBlank()->validate('0'); // false +v::notBlank()->validate(0); // false +v::notBlank()->validate('0.0'); // false +v::notBlank()->validate(false); // false +v::notBlank()->validate(['']); // false +v::notBlank()->validate([' ']); // false +v::notBlank()->validate([0]); // false +v::notBlank()->validate(['0']); // false +v::notBlank()->validate([false]); // false +v::notBlank()->validate([[''], [0]]); // false +v::notBlank()->validate(new stdClass()); // false +``` + +It's similar to [NotEmpty](NotEmpty.md) but it's way more strict. + +*** +See also: + + * [NoWhitespace](NoWhitespace.md) + * [NotEmpty](NotEmpty.md) + * [NullType](NullType.md) diff --git a/vendor/respect/validation/docs/rules/NotEmpty.md b/vendor/respect/validation/docs/rules/NotEmpty.md new file mode 100644 index 0000000000..ab888f6a64 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NotEmpty.md @@ -0,0 +1,42 @@ +# NotEmpty + +- `v::notEmpty()` + +Validates if the given input is not empty or in other words is input mandatory and +required. This function also takes whitespace into account, use `noWhitespace()` +if no spaces or linebreaks and other whitespace anywhere in the input is desired. + +```php +v::stringType()->notEmpty()->validate(''); // false +``` + +Null values are empty: + +```php +v::notEmpty()->validate(null); // false +``` + +Numbers: + +```php +v::intVal()->notEmpty()->validate(0); // false +``` + +Empty arrays: + +```php +v::arrayVal()->notEmpty()->validate([]); // false +``` + +Whitespace: + +```php +v::stringType()->notEmpty()->validate(' '); //false +v::stringType()->notEmpty()->validate("\t \n \r"); //false +``` + +*** +See also: + + * [NoWhitespace](NoWhitespace.md) + * [NullType](NullType.md) diff --git a/vendor/respect/validation/docs/rules/NotOptional.md b/vendor/respect/validation/docs/rules/NotOptional.md new file mode 100644 index 0000000000..487e7f1ef2 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NotOptional.md @@ -0,0 +1,39 @@ +# NotOptional + +- `v::notOptional()` + +Validates if the given input is not optional. By _optional_ we consider `null` +or an empty string (`''`). + +```php +v::notOptional()->validate(''); // false +v::notOptional()->validate(null); // false +``` + +Other values: + +```php +v::notOptional()->validate([]); // true +v::notOptional()->validate(' '); // true +v::notOptional()->validate(0); // true +v::notOptional()->validate('0'); // true +v::notOptional()->validate(0); // true +v::notOptional()->validate('0.0'); // true +v::notOptional()->validate(false); // true +v::notOptional()->validate(['']); // true +v::notOptional()->validate([' ']); // true +v::notOptional()->validate([0]); // true +v::notOptional()->validate(['0']); // true +v::notOptional()->validate([false]); // true +v::notOptional()->validate([[''), [0]]); // true +v::notOptional()->validate(new stdClass()); // true +``` + +*** +See also: + + * [NoWhitespace](NoWhitespace.md) + * [NotBlank](NotBlank.md) + * [NotEmpty](NotEmpty.md) + * [NullType](NullType.md) + * [Optional](Optional.md) diff --git a/vendor/respect/validation/docs/rules/NullType.md b/vendor/respect/validation/docs/rules/NullType.md new file mode 100644 index 0000000000..5b39feb6c2 --- /dev/null +++ b/vendor/respect/validation/docs/rules/NullType.md @@ -0,0 +1,25 @@ +# NullType + +- `v::nullType()` + +Validates if the input is null. + +```php +v::nullType()->validate(null); // true +``` + +*** +See also: + + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [FloatType](FloatType.md) + * [IntType](IntType.md) + * [NotBlank](NotBlank.md) + * [NotEmpty](NotEmpty.md) + * [NotOptional](NotOptional.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/Numeric.md b/vendor/respect/validation/docs/rules/Numeric.md new file mode 100644 index 0000000000..d8121fb61c --- /dev/null +++ b/vendor/respect/validation/docs/rules/Numeric.md @@ -0,0 +1,18 @@ +# Numeric + +- `v::numeric()` + +Validates on any numeric value. + +```php +v::numeric()->validate(-12); // true +v::numeric()->validate('135.0'); // true +``` + +*** +See also: + + * [Digit](Digit.md) + * [Finite](Finite.md) + * [Infinite](Infinite.md) + * [IntVal](IntVal.md) diff --git a/vendor/respect/validation/docs/rules/ObjectType.md b/vendor/respect/validation/docs/rules/ObjectType.md new file mode 100644 index 0000000000..3921260315 --- /dev/null +++ b/vendor/respect/validation/docs/rules/ObjectType.md @@ -0,0 +1,24 @@ +# ObjectType + +- `v::objectType()` + +Validates if the input is an object. + +```php +v::objectType()->validate(new stdClass); // true +``` + +*** +See also: + + * [Attribute](Attribute.md) + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [FloatType](FloatType.md) + * [Instance](Instance.md) + * [IntType](IntType.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/Odd.md b/vendor/respect/validation/docs/rules/Odd.md new file mode 100644 index 0000000000..b1a8d05fc9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Odd.md @@ -0,0 +1,17 @@ +# Odd + +- `v::odd()` + +Validates an odd number. + +```php +v::intVal()->odd()->validate(3); // true +``` + +Using `int()` before `odd()` is a best practice. + +*** +See also: + + * [Even](Even.md) + * [Multiple](Multiple.md) diff --git a/vendor/respect/validation/docs/rules/OneOf.md b/vendor/respect/validation/docs/rules/OneOf.md new file mode 100644 index 0000000000..e16be50df0 --- /dev/null +++ b/vendor/respect/validation/docs/rules/OneOf.md @@ -0,0 +1,25 @@ +# OneOf + +- `v::oneOf(v $v1, v $v2, v $v3...)` + +This is a group validator that acts as an OR operator. + +```php +v::oneOf( + v::intVal(), + v::floatVal() +)->validate(15.5); // true +``` + +In the sample above, `v::intVal()` doesn't validates, but +`v::floatVal()` validates, so oneOf returns true. + +`v::oneOf` returns true if at least one inner validator +passes. + +*** +See also: + + * [AllOf](AllOf.md) + * [NoneOf](NoneOf.md) + * [When](When.md) diff --git a/vendor/respect/validation/docs/rules/Optional.md b/vendor/respect/validation/docs/rules/Optional.md new file mode 100644 index 0000000000..1a4aa5ec09 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Optional.md @@ -0,0 +1,21 @@ +# Optional + +- `v::optional(v $rule)` + +Validates if the given input is optional or not. By _optional_ we consider `null` +or an empty string (`''`). + +```php +v::optional(v::alpha())->validate(''); // true +v::optional(v::digit())->validate(null); // true +``` + + +*** +See also: + + * [NoWhitespace](NoWhitespace.md) + * [NotBlank](NotBlank.md) + * [NotEmpty](NotEmpty.md) + * [NotOptional](NotOptional.md) + * [NullType](NullType.md) diff --git a/vendor/respect/validation/docs/rules/PerfectSquare.md b/vendor/respect/validation/docs/rules/PerfectSquare.md new file mode 100644 index 0000000000..3a344b27c9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/PerfectSquare.md @@ -0,0 +1,16 @@ +# PerfectSquare + +- `v::perfectSquare()` + +Validates a perfect square. + +```php +v::perfectSquare()->validate(25); // true (5*5) +v::perfectSquare()->validate(9); // true (3*3) +``` + +*** +See also: + + * [Factor](Factor.md) + * [PrimeNumber](PrimeNumber.md) diff --git a/vendor/respect/validation/docs/rules/Pesel.md b/vendor/respect/validation/docs/rules/Pesel.md new file mode 100644 index 0000000000..275ff7f8d3 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Pesel.md @@ -0,0 +1,12 @@ +# Pesel + +- `v::pesel()` + +Validates PESEL (Polish human identification number). + +```php +v::pesel()->validate('21120209256'); // true +v::pesel()->validate('97072704800'); // true +v::pesel()->validate('97072704801'); // false +v::pesel()->validate('PESEL123456'); // false +``` diff --git a/vendor/respect/validation/docs/rules/Phone.md b/vendor/respect/validation/docs/rules/Phone.md new file mode 100644 index 0000000000..ac3cba9b95 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Phone.md @@ -0,0 +1,22 @@ +# Phone + +- `v::phone()` + +Validates a valid 7, 10, 11 digit phone number (North America, Europe and most +Asian and Middle East countries), supporting country and area codes (in dot, +space or dashed notations) such as: + + (555)555-5555 + 555 555 5555 + +5(555)555.5555 + 33(1)22 22 22 22 + +33(1)22 22 22 22 + +33(020)7777 7777 + 03-6106666 + +*** +See also: + + * [Email](Email.md) + * [Url](Url.md) + * [VideoUrl](VideoUrl.md) diff --git a/vendor/respect/validation/docs/rules/PhpLabel.md b/vendor/respect/validation/docs/rules/PhpLabel.md new file mode 100644 index 0000000000..4295267d72 --- /dev/null +++ b/vendor/respect/validation/docs/rules/PhpLabel.md @@ -0,0 +1,24 @@ +# PhpLabel + +- `v::phpLabel()` + +Validates if a value is considered a valid PHP Label, +so that it can be used as a *variable*, *function* or *class* name, for example. + +Reference: +http://php.net/manual/en/language.variables.basics.php + +```php +v::phpLabel()->validate('person'); //true +v::phpLabel()->validate('foo'); //true +v::phpLabel()->validate('4ccess'); //false +``` + +*** +See also: + + * [Regex](Regex.md) + * [ResourceType](ResourceType.md) + * [Slug](Slug.md) + * [Charset](Charset.md) + \ No newline at end of file diff --git a/vendor/respect/validation/docs/rules/Positive.md b/vendor/respect/validation/docs/rules/Positive.md new file mode 100644 index 0000000000..ecf75d9f00 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Positive.md @@ -0,0 +1,14 @@ +# Positive + +- `v::positive()` + +Validates if a number is higher than zero + +```php +v::numeric()->positive()->validate(-15); // false +``` + +*** +See also: + + * [Negative](Negative.md) diff --git a/vendor/respect/validation/docs/rules/PostalCode.md b/vendor/respect/validation/docs/rules/PostalCode.md new file mode 100644 index 0000000000..c18ec96ede --- /dev/null +++ b/vendor/respect/validation/docs/rules/PostalCode.md @@ -0,0 +1,22 @@ +# PostalCode + +- `v::postalCode(string $countryCode)` + +Validates a postal code according to the given country code. + +```php +v::postalCode('BR')->validate('02179000'); // true +v::postalCode('BR')->validate('02179-000'); // true +v::postalCode('US')->validate('02179-000'); // false +v::postalCode('US')->validate('55372'); // true +v::postalCode('PL')->validate('99-300'); // true +``` + +Message template for this validator includes `{{countryCode}}`. + +Extracted from [GeoNames](http://www.geonames.org/). + +*** +See also: + + * [CountryCode](CountryCode.md) diff --git a/vendor/respect/validation/docs/rules/PrimeNumber.md b/vendor/respect/validation/docs/rules/PrimeNumber.md new file mode 100644 index 0000000000..dee58eabd4 --- /dev/null +++ b/vendor/respect/validation/docs/rules/PrimeNumber.md @@ -0,0 +1,16 @@ +# PrimeNumber + +- `v::primeNumber()` + +Validates a prime number + +```php +v::primeNumber()->validate(7); // true +``` + +*** +See also: + + * [Factor](Factor.md) + * [PerfectSquare](PerfectSquare.md) + * [PrimeNumber](PrimeNumber.md) diff --git a/vendor/respect/validation/docs/rules/Prnt.md b/vendor/respect/validation/docs/rules/Prnt.md new file mode 100644 index 0000000000..29dc6d7639 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Prnt.md @@ -0,0 +1,15 @@ +# Prnt + +- `v::prnt()` +- `v::prnt(string $additionalChars)` + +Similar to `v::graph` but accepts whitespace. + +```php +v::prnt()->validate('LMKA0$% _123'); // true +``` + +*** +See also: + + * [Graph](Graph.md) diff --git a/vendor/respect/validation/docs/rules/Punct.md b/vendor/respect/validation/docs/rules/Punct.md new file mode 100644 index 0000000000..d49411aa90 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Punct.md @@ -0,0 +1,17 @@ +# Punct + +- `v::punct()` +- `v::punct(string $additionalChars)` + +Accepts only punctuation characters: + +```php +v::punct()->validate('&,.;[]'); // true +``` + +*** +See also: + + * [Cntrl](Cntrl.md) + * [Graph](Graph.md) + * [Prnt](Prnt.md) diff --git a/vendor/respect/validation/docs/rules/Readable.md b/vendor/respect/validation/docs/rules/Readable.md new file mode 100644 index 0000000000..00a074eb91 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Readable.md @@ -0,0 +1,23 @@ +# Readable + +- `v::readable()` + +Validates if the given data is a file exists and is readable. + +```php +v::readable()->validate('/path/of/a/readable/file'); // true +``` + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Regex.md b/vendor/respect/validation/docs/rules/Regex.md new file mode 100644 index 0000000000..ed0d251734 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Regex.md @@ -0,0 +1,21 @@ +# Regex + +- `v::regex(string $regex)` + +Evaluates a regex on the input and validates if matches + +```php +v::regex('/[a-z]/')->validate('a'); // true +``` + +Message template for this validator includes `{{regex}}` + +*** +See also: + + * [Alnum](Alnum.md) + * [Alpha](Alpha.md) + * [Contains](Contains.md) + * [Digit](Digit.md) + * [EndsWith](EndsWith.md) + * [StartsWith](StartsWith.md) diff --git a/vendor/respect/validation/docs/rules/ResourceType.md b/vendor/respect/validation/docs/rules/ResourceType.md new file mode 100644 index 0000000000..c21a2f1d89 --- /dev/null +++ b/vendor/respect/validation/docs/rules/ResourceType.md @@ -0,0 +1,21 @@ +# ResourceType + +- `v::resourceType()` + +Validates if the input is a resource. + +```php +v::resourceType()->validate(fopen('/path/to/file.txt', 'w')); // true +``` + +*** +See also: + + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [FloatType](FloatType.md) + * [IntType](IntType.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/Roman.md b/vendor/respect/validation/docs/rules/Roman.md new file mode 100644 index 0000000000..b619930e1b --- /dev/null +++ b/vendor/respect/validation/docs/rules/Roman.md @@ -0,0 +1,16 @@ +# Roman + +- `v::roman()` + +Validates roman numbers + +```php +v::roman()->validate('IV'); // true +``` + +*** +See also: + + * [In](In.md) + * [Regex](Regex.md) + * [Uppercase](Uppercase.md) diff --git a/vendor/respect/validation/docs/rules/ScalarVal.md b/vendor/respect/validation/docs/rules/ScalarVal.md new file mode 100644 index 0000000000..366657854d --- /dev/null +++ b/vendor/respect/validation/docs/rules/ScalarVal.md @@ -0,0 +1,15 @@ +# ScalarVal + +- `v::scalarVal()` + +Validates if the input is a scalar value. + +```php +v::scalarVal()->validate([]); // false +v::scalarVal()->validate(135.0); // true +``` + +*** +See also: + + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/Sf.md b/vendor/respect/validation/docs/rules/Sf.md new file mode 100644 index 0000000000..a7988a8b98 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Sf.md @@ -0,0 +1,19 @@ +# Sf + +- `v::sf(string $validator)` + +Use Symfony2 validators inside Respect\Validation flow. Messages +are preserved. + +```php +v::sf('Time')->validate('15:00:00'); +``` + + +You must add `"symfony/validator": "~2.6"` to your `require` property on composer.json file. + + +*** +See also: + + * [Zend](Zend.md) diff --git a/vendor/respect/validation/docs/rules/Size.md b/vendor/respect/validation/docs/rules/Size.md new file mode 100644 index 0000000000..13f5aee4e9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Size.md @@ -0,0 +1,48 @@ +# Size + +- `v::size(string $minSize)` +- `v::size(string $minSize, string $maxSize)` +- `v::size(null, string $maxSize)` + +Validates file sizes: + +```php +v::size('1KB')->validate($filename); // Must have at least 1KB size +v::size('1MB', '2MB')->validate($filename); // Must have the size between 1MB and 2MB +v::size(null, '1GB')->validate($filename); // Must not be greater than 1GB +``` + +Sizes are not case-sensitive and the accepted values are: + +- B +- KB +- MB +- GB +- TB +- PB +- EB +- ZB +- YB + +This validator will consider `SplFileInfo` instances, like: + +```php +$fileInfo = new SplFileInfo($filename); +v::size('1.5mb')->validate($fileInfo); // Will return true or false +``` + +Message template for this validator includes `{{minSize}}` and `{{maxSize}}`. + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Slug.md b/vendor/respect/validation/docs/rules/Slug.md new file mode 100644 index 0000000000..599bbbaac9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Slug.md @@ -0,0 +1,17 @@ +# Slug + +- `v::slug()` + +Validates slug-like strings: + +```php +v::slug()->validate('my-wordpress-title'); // true +v::slug()->validate('my-wordpress--title'); // false +v::slug()->validate('my-wordpress-title-'); // false +``` + +*** +See also: + + * [Url](Url.md) + * [VideoUrl](VideoUrl.md) diff --git a/vendor/respect/validation/docs/rules/Space.md b/vendor/respect/validation/docs/rules/Space.md new file mode 100644 index 0000000000..a0faec5713 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Space.md @@ -0,0 +1,15 @@ +# Space + +- `v::space()` +- `v::space(string $additionalChars)` + +Accepts only whitespace: + +```php +v::space()->validate(' '); // true +``` + +*** +See also: + + * [Cntrl](Cntrl.md) diff --git a/vendor/respect/validation/docs/rules/StartsWith.md b/vendor/respect/validation/docs/rules/StartsWith.md new file mode 100644 index 0000000000..842655d94b --- /dev/null +++ b/vendor/respect/validation/docs/rules/StartsWith.md @@ -0,0 +1,31 @@ +# StartsWith + +- `v::startsWith(mixed $value)` +- `v::startsWith(mixed $value, boolean $identical = false)` + +This validator is similar to `v::contains()`, but validates +only if the value is at the beginning of the input. + +For strings: + +```php +v::startsWith('lorem')->validate('lorem ipsum'); // true +``` + +For arrays: + +```php +v::startsWith('lorem')->validate(['lorem', 'ipsum']); // true +``` + +`true` may be passed as a parameter to indicate identical comparison +instead of equal. + +Message template for this validator includes `{{startValue}}`. + +*** +See also: + + * [EndsWith](EndsWith.md) + * [Contains](Contains.md) + * [In](In.md) diff --git a/vendor/respect/validation/docs/rules/StringType.md b/vendor/respect/validation/docs/rules/StringType.md new file mode 100644 index 0000000000..624c3df8cf --- /dev/null +++ b/vendor/respect/validation/docs/rules/StringType.md @@ -0,0 +1,22 @@ +# StringType + +- `v::stringType()` + +Validates a string. + +```php +v::stringType()->validate('hi'); // true +``` + +*** +See also: + + * [Alnum](Alnum.md) + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [FloatType](FloatType.md) + * [IntType](IntType.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/SubdivisionCode.md b/vendor/respect/validation/docs/rules/SubdivisionCode.md new file mode 100644 index 0000000000..3cb031922e --- /dev/null +++ b/vendor/respect/validation/docs/rules/SubdivisionCode.md @@ -0,0 +1,284 @@ +# SubdivisionCode + +- `v::subdivisionCode(string $countryCode)` + +Validates subdivision country codes according to [ISO 3166-2][]. + +The `$countryCode` must be a country in [ISO 3166-1 alpha-2][] format. + +```php +v::subdivisionCode('BR')->validate('SP'); // true +v::subdivisionCode('US')->validate('CA'); // true +``` + +This rule is case sensitive. + +## Available country codes + +- `AD`: Andorra +- `AE`: United Arab Emirates +- `AF`: Afghanistan +- `AG`: Antigua and Barbuda +- `AI`: Anguilla +- `AL`: Albania +- `AM`: Armenia +- `AN`: AN.html +- `AO`: Angola +- `AQ`: Antarctica +- `AR`: Argentina +- `AS`: American Samoa +- `AT`: Austria +- `AU`: Australia +- `AW`: Aruba +- `AX`: Åland +- `AZ`: Azerbaijan +- `BA`: Bosnia and Herzegovina +- `BB`: Barbados +- `BD`: Bangladesh +- `BE`: Belgium +- `BF`: Burkina Faso +- `BG`: Bulgaria +- `BH`: Bahrain +- `BI`: Burundi +- `BJ`: Benin +- `BL`: Saint Barthélemy +- `BM`: Bermuda +- `BN`: Brunei +- `BO`: Bolivia +- `BQ`: Bonaire +- `BR`: Brazil +- `BS`: Bahamas +- `BT`: Bhutan +- `BV`: Bouvet Island +- `BW`: Botswana +- `BY`: Belarus +- `BZ`: Belize +- `CA`: Canada +- `CC`: Cocos [Keeling] Islands +- `CD`: Democratic Republic of the Congo +- `CF`: Central African Republic +- `CG`: Republic of the Congo +- `CH`: Switzerland +- `CI`: Ivory Coast +- `CK`: Cook Islands +- `CL`: Chile +- `CM`: Cameroon +- `CN`: China +- `CO`: Colombia +- `CR`: Costa Rica +- `CS`: CS.html +- `CU`: Cuba +- `CV`: Cape Verde +- `CW`: Curacao +- `CX`: Christmas Island +- `CY`: Cyprus +- `CZ`: Czech Republic +- `DE`: Germany +- `DJ`: Djibouti +- `DK`: Denmark +- `DM`: Dominica +- `DO`: Dominican Republic +- `DZ`: Algeria +- `EC`: Ecuador +- `EE`: Estonia +- `EG`: Egypt +- `EH`: Western Sahara +- `ER`: Eritrea +- `ES`: Spain +- `ET`: Ethiopia +- `FI`: Finland +- `FJ`: Fiji +- `FK`: Falkland Islands +- `FM`: Micronesia +- `FO`: Faroe Islands +- `FR`: France +- `GA`: Gabon +- `GB`: United Kingdom +- `GD`: Grenada +- `GE`: Georgia +- `GF`: French Guiana +- `GG`: Guernsey +- `GH`: Ghana +- `GI`: Gibraltar +- `GL`: Greenland +- `GM`: Gambia +- `GN`: Guinea +- `GP`: Guadeloupe +- `GQ`: Equatorial Guinea +- `GR`: Greece +- `GS`: South Georgia and the South Sandwich Islands +- `GT`: Guatemala +- `GU`: Guam +- `GW`: Guinea-Bissau +- `GY`: Guyana +- `HK`: Hong Kong +- `HM`: Heard Island and McDonald Islands +- `HN`: Honduras +- `HR`: Croatia +- `HT`: Haiti +- `HU`: Hungary +- `ID`: Indonesia +- `IE`: Ireland +- `IL`: Israel +- `IM`: Isle of Man +- `IN`: India +- `IO`: British Indian Ocean Territory +- `IQ`: Iraq +- `IR`: Iran +- `IS`: Iceland +- `IT`: Italy +- `JE`: Jersey +- `JM`: Jamaica +- `JO`: Jordan +- `JP`: Japan +- `KE`: Kenya +- `KG`: Kyrgyzstan +- `KH`: Cambodia +- `KI`: Kiribati +- `KM`: Comoros +- `KN`: Saint Kitts and Nevis +- `KP`: North Korea +- `KR`: South Korea +- `KW`: Kuwait +- `KY`: Cayman Islands +- `KZ`: Kazakhstan +- `LA`: Laos +- `LB`: Lebanon +- `LC`: Saint Lucia +- `LI`: Liechtenstein +- `LK`: Sri Lanka +- `LR`: Liberia +- `LS`: Lesotho +- `LT`: Lithuania +- `LU`: Luxembourg +- `LV`: Latvia +- `LY`: Libya +- `MA`: Morocco +- `MC`: Monaco +- `MD`: Moldova +- `ME`: Montenegro +- `MF`: Saint Martin +- `MG`: Madagascar +- `MH`: Marshall Islands +- `MK`: Macedonia +- `ML`: Mali +- `MM`: Myanmar [Burma] +- `MN`: Mongolia +- `MO`: Macao +- `MP`: Northern Mariana Islands +- `MQ`: Martinique +- `MR`: Mauritania +- `MS`: Montserrat +- `MT`: Malta +- `MU`: Mauritius +- `MV`: Maldives +- `MW`: Malawi +- `MX`: Mexico +- `MY`: Malaysia +- `MZ`: Mozambique +- `NA`: Namibia +- `NC`: New Caledonia +- `NE`: Niger +- `NF`: Norfolk Island +- `NG`: Nigeria +- `NI`: Nicaragua +- `NL`: Netherlands +- `NO`: Norway +- `NP`: Nepal +- `NR`: Nauru +- `NU`: Niue +- `NZ`: New Zealand +- `OM`: Oman +- `PA`: Panama +- `PE`: Peru +- `PF`: French Polynesia +- `PG`: Papua New Guinea +- `PH`: Philippines +- `PK`: Pakistan +- `PL`: Poland +- `PM`: Saint Pierre and Miquelon +- `PN`: Pitcairn Islands +- `PR`: Puerto Rico +- `PS`: Palestine +- `PT`: Portugal +- `PW`: Palau +- `PY`: Paraguay +- `QA`: Qatar +- `RE`: Réunion +- `RO`: Romania +- `RS`: Serbia +- `RU`: Russia +- `RW`: Rwanda +- `SA`: Saudi Arabia +- `SB`: Solomon Islands +- `SC`: Seychelles +- `SD`: Sudan +- `SE`: Sweden +- `SG`: Singapore +- `SH`: Saint Helena +- `SI`: Slovenia +- `SJ`: Svalbard and Jan Mayen +- `SK`: Slovakia +- `SL`: Sierra Leone +- `SM`: San Marino +- `SN`: Senegal +- `SO`: Somalia +- `SR`: Suriname +- `SS`: South Sudan +- `ST`: São Tomé and Príncipe +- `SV`: El Salvador +- `SX`: Sint Maarten +- `SY`: Syria +- `SZ`: Swaziland +- `TC`: Turks and Caicos Islands +- `TD`: Chad +- `TF`: French Southern Territories +- `TG`: Togo +- `TH`: Thailand +- `TJ`: Tajikistan +- `TK`: Tokelau +- `TL`: East Timor +- `TM`: Turkmenistan +- `TN`: Tunisia +- `TO`: Tonga +- `TR`: Turkey +- `TT`: Trinidad and Tobago +- `TV`: Tuvalu +- `TW`: Taiwan +- `TZ`: Tanzania +- `UA`: Ukraine +- `UG`: Uganda +- `UM`: U.S. Minor Outlying Islands +- `US`: United States +- `UY`: Uruguay +- `UZ`: Uzbekistan +- `VA`: Vatican City +- `VC`: Saint Vincent and the Grenadines +- `VE`: Venezuela +- `VG`: British Virgin Islands +- `VI`: U.S. Virgin Islands +- `VN`: Vietnam +- `VU`: Vanuatu +- `WF`: Wallis and Futuna +- `WS`: Samoa +- `XK`: Kosovo +- `YE`: Yemen +- `YT`: Mayotte +- `ZA`: South Africa +- `ZM`: Zambia +- `ZW`: Zimbabwe + +All data was extrated from [GeoNames][] which is licensed under a +[Creative Commons Attribution 3.0 License][]. + +*** +See also: + + * [CountryCode](CountryCode.md) + * [Tld](Tld.md) + + +[Creative Commons Attribution 3.0 License]: http://creativecommons.org/licenses/by/3.0 "Creative Commons Attribution 3.0 License" +[GeoNames]: http://www.geonames.org "GetNames" +[ISO 3166-1 alpha-2]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 "ISO 3166-1 alpha-2" +[ISO 3166-2]: http://en.wikipedia.org/wiki/ISO_3166-2 "ISO 3166-2" diff --git a/vendor/respect/validation/docs/rules/SymbolicLink.md b/vendor/respect/validation/docs/rules/SymbolicLink.md new file mode 100644 index 0000000000..bc9019657b --- /dev/null +++ b/vendor/respect/validation/docs/rules/SymbolicLink.md @@ -0,0 +1,23 @@ +# SymbolicLink + +- `v::symbolicLink()` + +Validates if the given data is a path of a valid symbolic link. + +```php +v::symbolicLink()->validate('/path/of/valid/symbolic/link'); // true +``` + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [Uploaded](Uploaded.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Tld.md b/vendor/respect/validation/docs/rules/Tld.md new file mode 100644 index 0000000000..db05452a19 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Tld.md @@ -0,0 +1,17 @@ +# Tld + +- `v::tld()` + +Validates a top-level domain + +```php +v::tld()->validate('com'); // true +v::tld()->validate('ly'); // true +v::tld()->validate('org'); // true +``` + +*** +See also: + + * [Domain](Domain.md) + * [CountryCode](CountryCode.md) diff --git a/vendor/respect/validation/docs/rules/TrueVal.md b/vendor/respect/validation/docs/rules/TrueVal.md new file mode 100644 index 0000000000..59869d2004 --- /dev/null +++ b/vendor/respect/validation/docs/rules/TrueVal.md @@ -0,0 +1,21 @@ +# TrueVal + +- `v::trueVal()` + +Validates if a value is considered as `true`. + +```php +v::trueVal()->validate(true); // true +v::trueVal()->validate(1); // true +v::trueVal()->validate('1'); // true +v::trueVal()->validate('true'); // true +v::trueVal()->validate('on'); // true +v::trueVal()->validate('yes'); // true +v::trueVal()->validate('0.5'); // false +v::trueVal()->validate('2'); // false +``` + +*** +See also: + + * [FalseVal](FalseVal.md) diff --git a/vendor/respect/validation/docs/rules/Type.md b/vendor/respect/validation/docs/rules/Type.md new file mode 100644 index 0000000000..50f2abb9f9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Type.md @@ -0,0 +1,31 @@ +# Type + +- `v::type(string $type)` + +Validates the type of input. + +```php +v::type('bool')->validate(true); // true +v::type('callable')->validate(function (){}); // true +v::type('object')->validate(new stdClass()); // true +``` + +*** +See also: + + * [ArrayVal](ArrayVal.md) + * [BoolType](BoolType.md) + * [CallableType](CallableType.md) + * [Finite](Finite.md) + * [FloatType](FloatType.md) + * [FloatVal](FloatVal.md) + * [Infinite](Infinite.md) + * [Instance](Instance.md) + * [IntType](IntType.md) + * [IntVal](IntVal.md) + * [NullType](NullType.md) + * [ObjectType](ObjectType.md) + * [ResourceType](ResourceType.md) + * [ScalarVal](ScalarVal.md) + * [StringType](StringType.md) + * [Type](Type.md) diff --git a/vendor/respect/validation/docs/rules/Uploaded.md b/vendor/respect/validation/docs/rules/Uploaded.md new file mode 100644 index 0000000000..774f9bb821 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Uploaded.md @@ -0,0 +1,23 @@ +# Uploaded + +- `v::uploaded()` + +Validates if the given data is a file that was uploaded via HTTP POST. + +```php +v::uploaded()->validate('/path/of/an/uploaded/file'); // true +``` + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Writable](Writable.md) diff --git a/vendor/respect/validation/docs/rules/Uppercase.md b/vendor/respect/validation/docs/rules/Uppercase.md new file mode 100644 index 0000000000..1dff7acf58 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Uppercase.md @@ -0,0 +1,14 @@ +# Uppercase + +- `v::uppercase()` + +Validates if string characters are uppercase in the input: + +```php +v::stringType()->uppercase()->validate('W3C'); // true +``` + +*** +See also: + + * [Lowercase](Lowercase.md) diff --git a/vendor/respect/validation/docs/rules/Url.md b/vendor/respect/validation/docs/rules/Url.md new file mode 100644 index 0000000000..5638cf55f4 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Url.md @@ -0,0 +1,24 @@ +# Url + +- `v::url()` + +Validates if input is an URL: + +```php +v::url()->validate('http://example.com'); // true +v::url()->validate('https://www.youtube.com/watch?v=6FOUqQt3Kg0'); // true +v::url()->validate('ldap://[::1]'); // true +v::url()->validate('mailto:john.doe@example.com'); // true +v::url()->validate('news:new.example.com'); // true +``` + +This rule uses [FilterVar](FilterVar.md) + +*** +See also: + + * [Domain](Domain.md) + * [Email](Email.md) + * [FilterVar](FilterVar.md) + * [Phone](Phone.md) + * [VideoUrl](VideoUrl.md) diff --git a/vendor/respect/validation/docs/rules/Version.md b/vendor/respect/validation/docs/rules/Version.md new file mode 100644 index 0000000000..aad3ce8a3d --- /dev/null +++ b/vendor/respect/validation/docs/rules/Version.md @@ -0,0 +1,16 @@ +# Version + +- `v::version()` + +Validates version numbers using Semantic Versioning. + +```php +v::version()->validate('1.0.0'); +``` + +*** +See also: + + * [Equals](Equals.md) + * [Regex](Regex.md) + * [Roman](Roman.md) diff --git a/vendor/respect/validation/docs/rules/VideoUrl.md b/vendor/respect/validation/docs/rules/VideoUrl.md new file mode 100644 index 0000000000..1ef962793b --- /dev/null +++ b/vendor/respect/validation/docs/rules/VideoUrl.md @@ -0,0 +1,35 @@ +# VideoUrl + +- `v::videoUrl()` +- `v::videoUrl(string $service)` + +Validates if the input is a video URL value: + +```php +v::videoUrl()->validate('https://player.vimeo.com/video/71787467'); // true +v::videoUrl()->validate('https://vimeo.com/71787467'); // true +v::videoUrl()->validate('https://www.youtube.com/embed/netHLn9TScY'); // true +v::videoUrl()->validate('https://www.youtube.com/watch?v=netHLn9TScY'); // true +v::videoUrl()->validate('https://youtu.be/netHLn9TScY'); // true + +v::videoUrl('youtube')->validate('https://www.youtube.com/watch?v=netHLn9TScY'); // true +v::videoUrl('vimeo')->validate('https://vimeo.com/71787467'); // true + +v::videoUrl()->validate('https://youtube.com'); // false +v::videoUrl('youtube')->validate('https://vimeo.com/71787467'); // false +``` + +The services accepted are: + +- YouTube +- Vimeo + +The `$service` value is not case-sensitive. + +Message template for this validator includes `{{service}}`. + + +*** +See also: + + * [Url](Url.md) diff --git a/vendor/respect/validation/docs/rules/Vowel.md b/vendor/respect/validation/docs/rules/Vowel.md new file mode 100644 index 0000000000..98d806f5d9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Vowel.md @@ -0,0 +1,17 @@ +# Vowel + +- `v::vowel()` + +Similar to `v::alnum()`. Validates strings that contains only vowels: + +```php +v::vowel()->validate('aei'); // true +``` + +*** +See also: + + * [Alnum](Alnum.md) + * [Digit](Digit.md) + * [Alpha](Alpha.md) + * [Consonant](Consonant.md) diff --git a/vendor/respect/validation/docs/rules/When.md b/vendor/respect/validation/docs/rules/When.md new file mode 100644 index 0000000000..6254cb34d9 --- /dev/null +++ b/vendor/respect/validation/docs/rules/When.md @@ -0,0 +1,24 @@ +# When + +- `v::when(v $if, v $then, v $else)` +- `v::when(v $if, v $then)` + +A ternary validator that accepts three parameters. + +When the `$if` validates, returns validation for `$then`. +When the `$if` doesn't validate, returns validation for `$else`, if defined. + +```php +v::when(v::intVal(), v::positive(), v::notEmpty())->validate($input); +``` + +In the sample above, if `$input` is an integer, then it must be positive. +If `$input` is not an integer, then it must not me empty. +When `$else` is not defined use [AlwaysInvalid](AlwaysInvalid.md) + +*** +See also: + + * [AllOf](AllOf.md) + * [OneOf](OneOf.md) + * [NoneOf](NoneOf.md) diff --git a/vendor/respect/validation/docs/rules/Writable.md b/vendor/respect/validation/docs/rules/Writable.md new file mode 100644 index 0000000000..b7aa5e4365 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Writable.md @@ -0,0 +1,23 @@ +# Writable + +- `v::writable()` + +Validates if the given input is writable file. + +```php +v::writable()->validate('/path/of/a/writable/file'); // true +``` + +*** +See also: + + * [Directory](Directory.md) + * [Executable](Executable.md) + * [Exists](Exists.md) + * [Extension](Extension.md) + * [File](File.md) + * [Mimetype](Mimetype.md) + * [Readable](Readable.md) + * [Size](Size.md) + * [SymbolicLink](SymbolicLink.md) + * [Uploaded](Uploaded.md) diff --git a/vendor/respect/validation/docs/rules/Xdigit.md b/vendor/respect/validation/docs/rules/Xdigit.md new file mode 100644 index 0000000000..9e79d0fdfc --- /dev/null +++ b/vendor/respect/validation/docs/rules/Xdigit.md @@ -0,0 +1,22 @@ +# Xdigit + +- `v::xdigit()` + +Accepts an hexadecimal number: + +```php +v::xdigit()->validate('abc123'); // true +``` + +Notice, however, that it doesn't accept strings starting with 0x: + +```php +v::xdigit()->validate('0x1f'); // false +``` + +*** +See also: + + * [Digit](Digit.md) + * [Alnum](Alnum.md) + * [HexRgbColor](HexRgbColor.md) diff --git a/vendor/respect/validation/docs/rules/Yes.md b/vendor/respect/validation/docs/rules/Yes.md new file mode 100644 index 0000000000..9fef6d8f4d --- /dev/null +++ b/vendor/respect/validation/docs/rules/Yes.md @@ -0,0 +1,23 @@ +# Yes + +- `v::yes()` +- `v::yes(boolean $locale)` + +Validates if value is considered as "Yes". + +```php +v::yes()->validate('Y'); // true +v::yes()->validate('Yea'); // true +v::yes()->validate('Yeah'); // true +v::yes()->validate('Yep'); // true +v::yes()->validate('Yes'); // true +``` + +This rule is case insensitive. + +If `$locale` is TRUE, uses the value of [nl_langinfo()](http://php.net/nl_langinfo) with `YESEXPR` constant. + +*** +See also: + + * [No](No.md) diff --git a/vendor/respect/validation/docs/rules/Zend.md b/vendor/respect/validation/docs/rules/Zend.md new file mode 100644 index 0000000000..8ec0ae8ed7 --- /dev/null +++ b/vendor/respect/validation/docs/rules/Zend.md @@ -0,0 +1,17 @@ +# Zend + +- `v::zend(mixed $validator)` + +Use Zend validators inside Respect\Validation flow. Messages +are preserved. + +```php +v::zend('Hostname')->validate('google.com'); +``` + +You must add `"zendframework/zend-validator": "~2.3"` to your `require` property on composer.json file. + +*** +See also: + + * [Sf](Sf.md) diff --git a/vendor/setasign/fpdi/src/FpdfTplTrait.php b/vendor/setasign/fpdi/src/FpdfTplTrait.php new file mode 100644 index 0000000000..11796b1f5c --- /dev/null +++ b/vendor/setasign/fpdi/src/FpdfTplTrait.php @@ -0,0 +1,466 @@ +<?php +/** + * This file is part of FPDI + * + * @package setasign\Fpdi + * @copyright Copyright (c) 2018 Setasign - Jan Slabon (https://www.setasign.com) + * @license http://opensource.org/licenses/mit-license The MIT License + */ + +namespace setasign\Fpdi; + +/** + * Trait FpdfTplTrait + * + * This class adds a templating feature to tFPDF. + * + * @package setasign\Fpdi + */ +trait FpdfTplTrait +{ + /** + * Data of all created templates. + * + * @var array + */ + protected $templates = []; + + /** + * The template id for the currently created template. + * + * @var null|int + */ + protected $currentTemplateId; + + /** + * A counter for template ids. + * + * @var int + */ + protected $templateId = 0; + + /** + * Set the page format of the current page. + * + * @param array $size An array with two values defining the size. + * @param string $orientation "L" for landscape, "P" for portrait. + * @throws \BadMethodCallException + */ + public function setPageFormat($size, $orientation) + { + if ($this->currentTemplateId !== null) { + throw new \BadMethodCallException('The page format cannot be changed when writing to a template.'); + } + + if (!\in_array($orientation, ['P', 'L'], true)) { + throw new \InvalidArgumentException(\sprintf( + 'Invalid page orientation "%s"! Only "P" and "L" are allowed!', + $orientation + )); + } + + $size = $this->_getpagesize($size); + + if ($orientation != $this->CurOrientation + || $size[0] != $this->CurPageSize[0] + || $size[1] != $this->CurPageSize[1] + ) { + // New size or orientation + if ($orientation === 'P') { + $this->w = $size[0]; + $this->h = $size[1]; + } else { + $this->w = $size[1]; + $this->h = $size[0]; + } + $this->wPt = $this->w * $this->k; + $this->hPt = $this->h * $this->k; + $this->PageBreakTrigger = $this->h - $this->bMargin; + $this->CurOrientation = $orientation; + $this->CurPageSize = $size; + + $this->PageInfo[$this->page]['size'] = array($this->wPt, $this->hPt); + } + } + + /** + * Draws a template onto the page or another template. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $tpl The template id + * @param array|float|int $x The abscissa of upper-left corner. Alternatively you could use an assoc array + * with the keys "x", "y", "width", "height", "adjustPageSize". + * @param float|int $y The ordinate of upper-left corner. + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @param bool $adjustPageSize + * @return array The size + * @see FpdfTplTrait::getTemplateSize() + */ + public function useTemplate($tpl, $x = 0, $y = 0, $width = null, $height = null, $adjustPageSize = false) + { + if (!isset($this->templates[$tpl])) { + throw new \InvalidArgumentException('Template does not exist!'); + } + + if (\is_array($x)) { + unset($x['tpl']); + \extract($x, EXTR_IF_EXISTS); + /** @noinspection NotOptimalIfConditionsInspection */ + /** @noinspection CallableParameterUseCaseInTypeContextInspection */ + if (\is_array($x)) { + $x = 0; + } + } + + $template = $this->templates[$tpl]; + + $originalSize = $this->getTemplateSize($tpl); + $newSize = $this->getTemplateSize($tpl, $width, $height); + if ($adjustPageSize) { + $this->setPageFormat($newSize, $newSize['orientation']); + } + + $this->_out( + // reset standard values, translate and scale + \sprintf( + 'q 0 J 1 w 0 j 0 G 0 g %.4F 0 0 %.4F %.4F %.4F cm /%s Do Q', + ($newSize['width'] / $originalSize['width']), + ($newSize['height'] / $originalSize['height']), + $x * $this->k, + ($this->h - $y - $newSize['height']) * $this->k, + $template['id'] + ) + ); + + return $newSize; + } + + /** + * Get the size of a template. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $tpl The template id + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @return array|bool An array with following keys: width, height, 0 (=width), 1 (=height), orientation (L or P) + */ + public function getTemplateSize($tpl, $width = null, $height = null) + { + if (!isset($this->templates[$tpl])) { + return false; + } + + if ($width === null && $height === null) { + $width = $this->templates[$tpl]['width']; + $height = $this->templates[$tpl]['height']; + } elseif ($width === null) { + $width = $height * $this->templates[$tpl]['width'] / $this->templates[$tpl]['height']; + } + + if ($height === null) { + $height = $width * $this->templates[$tpl]['height'] / $this->templates[$tpl]['width']; + } + + if ($height <= 0. || $width <= 0.) { + throw new \InvalidArgumentException('Width or height parameter needs to be larger than zero.'); + } + + return [ + 'width' => $width, + 'height' => $height, + 0 => $width, + 1 => $height, + 'orientation' => $width > $height ? 'L' : 'P' + ]; + } + + /** + * Begins a new template. + * + * @param float|int|null $width The width of the template. If null, the current page width is used. + * @param float|int|null $height The height of the template. If null, the current page height is used. + * @param bool $groupXObject Define the form XObject as a group XObject to support transparency (if used). + * @return int A template identifier. + */ + public function beginTemplate($width = null, $height = null, $groupXObject = false) + { + if ($width === null) { + $width = $this->w; + } + + if ($height === null) { + $height = $this->h; + } + + $templateId = $this->getNextTemplateId(); + + // initiate buffer with current state of FPDF + $buffer = "2 J\n" + . \sprintf('%.2F w', $this->LineWidth * $this->k) . "\n"; + + if ($this->FontFamily) { + $buffer .= \sprintf("BT /F%d %.2F Tf ET\n", $this->CurrentFont['i'], $this->FontSizePt); + } + + if ($this->DrawColor !== '0 G') { + $buffer .= $this->DrawColor . "\n"; + } + if ($this->FillColor !== '0 g') { + $buffer .= $this->FillColor . "\n"; + } + + if ($groupXObject && \version_compare('1.4', $this->PDFVersion, '>')) { + $this->PDFVersion = '1.4'; + } + + $this->templates[$templateId] = [ + 'objectNumber' => null, + 'id' => 'TPL' . $templateId, + 'buffer' => $buffer, + 'width' => $width, + 'height' => $height, + 'groupXObject' => $groupXObject, + 'state' => [ + 'x' => $this->x, + 'y' => $this->y, + 'AutoPageBreak' => $this->AutoPageBreak, + 'bMargin' => $this->bMargin, + 'tMargin' => $this->tMargin, + 'lMargin' => $this->lMargin, + 'rMargin' => $this->rMargin, + 'h' => $this->h, + 'w' => $this->w, + 'FontFamily' => $this->FontFamily, + 'FontStyle' => $this->FontStyle, + 'FontSizePt' => $this->FontSizePt, + 'FontSize' => $this->FontSize, + 'underline' => $this->underline, + 'TextColor' => $this->TextColor, + 'DrawColor' => $this->DrawColor, + 'FillColor' => $this->FillColor, + 'ColorFlag' => $this->ColorFlag + ] + ]; + + $this->SetAutoPageBreak(false); + $this->currentTemplateId = $templateId; + + $this->h = $height; + $this->w = $width; + + $this->SetXY($this->lMargin, $this->tMargin); + $this->SetRightMargin($this->w - $width + $this->rMargin); + + return $templateId; + } + + /** + * Ends a template. + * + * @return bool|int|null A template identifier. + */ + public function endTemplate() + { + if (null === $this->currentTemplateId) { + return false; + } + + $templateId = $this->currentTemplateId; + $template = $this->templates[$templateId]; + + $state = $template['state']; + $this->SetXY($state['x'], $state['y']); + $this->tMargin = $state['tMargin']; + $this->lMargin = $state['lMargin']; + $this->rMargin = $state['rMargin']; + $this->h = $state['h']; + $this->w = $state['w']; + $this->SetAutoPageBreak($state['AutoPageBreak'], $state['bMargin']); + + $this->FontFamily = $state['FontFamily']; + $this->FontStyle = $state['FontStyle']; + $this->FontSizePt = $state['FontSizePt']; + $this->FontSize = $state['FontSize']; + + $this->TextColor = $state['TextColor']; + $this->DrawColor = $state['DrawColor']; + $this->FillColor = $state['FillColor']; + $this->ColorFlag = $state['ColorFlag']; + + $this->underline = $state['underline']; + + $fontKey = $this->FontFamily . $this->FontStyle; + if ($fontKey) { + $this->CurrentFont =& $this->fonts[$fontKey]; + } else { + unset($this->CurrentFont); + } + + $this->currentTemplateId = null; + + return $templateId; + } + + /** + * Get the next template id. + * + * @return int + */ + protected function getNextTemplateId() + { + return $this->templateId++; + } + + /* overwritten FPDF methods: */ + + /** + * @inheritdoc + */ + public function AddPage($orientation = '', $size = '', $rotation = 0) + { + if ($this->currentTemplateId !== null) { + throw new \BadMethodCallException('Pages cannot be added when writing to a template.'); + } + parent::AddPage($orientation, $size, $rotation); + } + + /** + * @inheritdoc + */ + public function Link($x, $y, $w, $h, $link) + { + if ($this->currentTemplateId !== null) { + throw new \BadMethodCallException('Links cannot be set when writing to a template.'); + } + parent::Link($x, $y, $w, $h, $link); + } + + /** + * @inheritdoc + */ + public function SetLink($link, $y = 0, $page = -1) + { + if ($this->currentTemplateId !== null) { + throw new \BadMethodCallException('Links cannot be set when writing to a template.'); + } + return parent::SetLink($link, $y, $page); + } + + /** + * @inheritdoc + */ + public function SetDrawColor($r, $g = null, $b = null) + { + parent::SetDrawColor($r, $g, $b); + if ($this->page === 0 && $this->currentTemplateId !== null) { + $this->_out($this->DrawColor); + } + } + + /** + * @inheritdoc + */ + public function SetFillColor($r, $g = null, $b = null) + { + parent::SetFillColor($r, $g, $b); + if ($this->page === 0 && $this->currentTemplateId !== null) { + $this->_out($this->FillColor); + } + } + + /** + * @inheritdoc + */ + public function SetLineWidth($width) + { + parent::SetLineWidth($width); + if ($this->page === 0 && $this->currentTemplateId !== null) { + $this->_out(\sprintf('%.2F w', $width * $this->k)); + } + } + + /** + * @inheritdoc + */ + public function SetFont($family, $style = '', $size = 0) + { + parent::SetFont($family, $style, $size); + if ($this->page === 0 && $this->currentTemplateId !== null) { + $this->_out(\sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); + } + } + + /** + * @inheritdoc + */ + public function SetFontSize($size) + { + parent::SetFontSize($size); + if ($this->page === 0 && $this->currentTemplateId !== null) { + $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); + } + } + + /** + * @inheritdoc + */ + protected function _putimages() + { + parent::_putimages(); + + foreach ($this->templates as $key => $template) { + $this->_newobj(); + $this->templates[$key]['objectNumber'] = $this->n; + + $this->_put('<</Type /XObject /Subtype /Form /FormType 1'); + $this->_put(\sprintf('/BBox[0 0 %.2F %.2F]', $template['width'] * $this->k, $template['height'] * $this->k)); + $this->_put('/Resources 2 0 R'); // default resources dictionary of FPDF + + if ($this->compress) { + $buffer = \gzcompress($template['buffer']); + $this->_put('/Filter/FlateDecode'); + } else { + $buffer = $template['buffer']; + } + + $this->_put('/Length ' . \strlen($buffer)); + + if ($template['groupXObject']) { + $this->_put('/Group <</Type/Group/S/Transparency>>'); + } + + $this->_put('>>'); + $this->_putstream($buffer); + $this->_put('endobj'); + } + } + + /** + * @inheritdoc + */ + protected function _putxobjectdict() + { + foreach ($this->templates as $key => $template) { + $this->_put('/' . $template['id'] . ' ' . $template['objectNumber'] . ' 0 R'); + } + + parent::_putxobjectdict(); + } + + /** + * @inheritdoc + */ + public function _out($s) + { + if ($this->currentTemplateId !== null) { + $this->templates[$this->currentTemplateId]['buffer'] .= $s . "\n"; + } else { + parent::_out($s); + } + } +} \ No newline at end of file diff --git a/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php b/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php new file mode 100644 index 0000000000..e2ee634670 --- /dev/null +++ b/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php @@ -0,0 +1,260 @@ +<?php + +namespace setasign\Fpdi\Tcpdf; + +use setasign\Fpdi\FpdiTrait; +use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException; +use setasign\Fpdi\PdfParser\Filter\AsciiHex; +use setasign\Fpdi\PdfParser\PdfParserException; +use setasign\Fpdi\PdfParser\Type\PdfHexString; +use setasign\Fpdi\PdfParser\Type\PdfIndirectObject; +use setasign\Fpdi\PdfParser\Type\PdfNull; +use setasign\Fpdi\PdfParser\Type\PdfNumeric; +use setasign\Fpdi\PdfParser\Type\PdfStream; +use setasign\Fpdi\PdfParser\Type\PdfString; +use setasign\Fpdi\PdfParser\Type\PdfType; +use setasign\Fpdi\PdfParser\Type\PdfTypeException; + +/** + * Class Fpdi + * + * This class let you import pages of existing PDF documents into a reusable structure for TCPDF. + * + * @package setasign\Fpdi + */ +class Fpdi extends \TCPDF +{ + use FpdiTrait { + writePdfType as fpdiWritePdfType; + useImportedPage as fpdiUseImportedPage; + } + + /** + * FPDI version + * + * @string + */ + const VERSION = '2.1.1'; + + /** + * A counter for template ids. + * + * @var int + */ + protected $templateId = 0; + + /** + * The currently used object number. + * + * @var int + */ + protected $currentObjectNumber; + + /** + * Get the next template id. + * + * @return int + */ + protected function getNextTemplateId() + { + return $this->templateId++; + } + + /** + * Draws an imported page onto the page or another template. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $tpl The template id + * @param float|int|array $x The abscissa of upper-left corner. Alternatively you could use an assoc array + * with the keys "x", "y", "width", "height", "adjustPageSize". + * @param float|int $y The ordinate of upper-left corner. + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @param bool $adjustPageSize + * @return array The size + * @see FpdiTrait::getTemplateSize() + */ + public function useTemplate($tpl, $x = 0, $y = 0, $width = null, $height = null, $adjustPageSize = false) + { + return $this->useImportedPage($tpl, $x, $y, $width, $height, $adjustPageSize); + } + + /** + * Draws an imported page onto the page. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $pageId The page id + * @param float|int|array $x The abscissa of upper-left corner. Alternatively you could use an assoc array + * with the keys "x", "y", "width", "height", "adjustPageSize". + * @param float|int $y The ordinate of upper-left corner. + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @param bool $adjustPageSize + * @return array The size. + * @see Fpdi::getTemplateSize() + */ + public function useImportedPage($pageId, $x = 0, $y = 0, $width = null, $height = null, $adjustPageSize = false) + { + $size = $this->fpdiUseImportedPage($pageId, $x, $y, $width, $height, $adjustPageSize); + if ($this->inxobj) { + $importedPage = $this->importedPages[$pageId]; + $this->xobjects[$this->xobjid]['importedPages'][$importedPage['id']] = $pageId; + } + + return $size; + } + + /** + * Get the size of an imported page. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $tpl The template id + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @return array|bool An array with following keys: width, height, 0 (=width), 1 (=height), orientation (L or P) + */ + public function getTemplateSize($tpl, $width = null, $height = null) + { + return $this->getImportedPageSize($tpl, $width, $height); + } + + /** + * @inheritdoc + */ + protected function _getxobjectdict() + { + $out = parent::_getxobjectdict(); + + foreach ($this->importedPages as $key => $pageData) { + $out .= '/' . $pageData['id'] . ' ' . $pageData['objectNumber'] . ' 0 R '; + } + + return $out; + } + + /** + * @inheritdoc + * @throws CrossReferenceException + * @throws PdfParserException + */ + protected function _putxobjects() + { + foreach ($this->importedPages as $key => $pageData) { + $this->currentObjectNumber = $this->_newobj(); + $this->importedPages[$key]['objectNumber'] = $this->currentObjectNumber; + $this->currentReaderId = $pageData['readerId']; + $this->writePdfType($pageData['stream']); + $this->_put('endobj'); + } + + foreach (\array_keys($this->readers) as $readerId) { + $parser = $this->getPdfReader($readerId)->getParser(); + $this->currentReaderId = $readerId; + + while (($objectNumber = \array_pop($this->objectsToCopy[$readerId])) !== null) { + try { + $object = $parser->getIndirectObject($objectNumber); + + } catch (CrossReferenceException $e) { + if ($e->getCode() === CrossReferenceException::OBJECT_NOT_FOUND) { + $object = PdfIndirectObject::create($objectNumber, 0, new PdfNull()); + } else { + throw $e; + } + } + + $this->writePdfType($object); + } + } + + // let's prepare resources for imported pages in templates + foreach ($this->xobjects as $xObjectId => $data) { + if (!isset($data['importedPages'])) { + continue; + } + + foreach ($data['importedPages'] as $id => $pageKey) { + $page = $this->importedPages[$pageKey]; + $this->xobjects[$xObjectId]['xobjects'][$id] = ['n' => $page['objectNumber']]; + } + } + + + parent::_putxobjects(); + $this->currentObjectNumber = null; + } + + /** + * Append content to the buffer of TCPDF. + * + * @param string $s + * @param bool $newLine + */ + protected function _put($s, $newLine = true) + { + if ($newLine) { + $this->setBuffer($s . "\n"); + } else { + $this->setBuffer($s); + } + } + + /** + * Begin a new object and return the object number. + * + * @param int|string $objid Object ID (leave empty to get a new ID). + * @return int object number + */ + protected function _newobj($objid = '') + { + $this->_out($this->_getobj($objid)); + return $this->n; + } + + /** + * Writes a PdfType object to the resulting buffer. + * + * @param PdfType $value + * @throws PdfTypeException + */ + protected function writePdfType(PdfType $value) + { + if (!$this->encrypted) { + $this->fpdiWritePdfType($value); + return; + } + + if ($value instanceof PdfString) { + $string = PdfString::unescape($value->value); + $string = $this->_encrypt_data($this->currentObjectNumber, $string); + $value->value = \TCPDF_STATIC::_escape($string); + + } elseif ($value instanceof PdfHexString) { + $filter = new AsciiHex(); + $string = $filter->decode($value->value); + $string = $this->_encrypt_data($this->currentObjectNumber, $string); + $value->value = $filter->encode($string, true); + + } elseif ($value instanceof PdfStream) { + $stream = $value->getStream(); + $stream = $this->_encrypt_data($this->currentObjectNumber, $stream); + $dictionary = $value->value; + $dictionary->value['Length'] = PdfNumeric::create(\strlen($stream)); + $value = PdfStream::create($dictionary, $stream); + + } elseif ($value instanceof PdfIndirectObject) { + /** + * @var $value PdfIndirectObject + */ + $this->currentObjectNumber = $this->objectMap[$this->currentReaderId][$value->objectNumber]; + } + + $this->fpdiWritePdfType($value); + } +} \ No newline at end of file diff --git a/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php b/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php new file mode 100644 index 0000000000..0b527a783f --- /dev/null +++ b/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php @@ -0,0 +1,99 @@ +<?php +/** + * This file is part of FPDI + * + * @package setasign\Fpdi + * @copyright Copyright (c) 2018 Setasign - Jan Slabon (https://www.setasign.com) + * @license http://opensource.org/licenses/mit-license The MIT License + */ + +namespace setasign\Fpdi\Tfpdf; + +use setasign\Fpdi\FpdfTplTrait; + +/** + * Class FpdfTpl + * + * We need to change some access levels and implement the setPageFormat() method to bring back compatibility to tFPDF. + * + * @package setasign\Fpdi\Tfpdf + */ +class FpdfTpl extends \tFPDF +{ + use FpdfTplTrait { + _putimages as _protectedPutimages; + _putxobjectdict as _protectedPutxobjectdict; + } + + /** + * Make the method public as in tFPDF. + */ + public function _putimages() + { + $this->_protectedPutimages(); + } + + /** + * Make the method public as in tFPDF. + */ + public function _putxobjectdict() + { + $this->_protectedPutxobjectdict(); + } + + /** + * Set the page format of the current page. + * + * @param array $size An array with two values defining the size. + * @param string $orientation "L" for landscape, "P" for portrait. + * @throws \BadMethodCallException + */ + public function setPageFormat($size, $orientation) + { + if ($this->currentTemplateId !== null) { + throw new \BadMethodCallException('The page format cannot be changed when writing to a template.'); + } + + if (!\in_array($orientation, ['P', 'L'], true)) { + throw new \InvalidArgumentException(\sprintf( + 'Invalid page orientation "%s"! Only "P" and "L" are allowed!', + $orientation + )); + } + + $size = $this->_getpagesize($size); + + if ($orientation != $this->CurOrientation + || $size[0] != $this->CurPageSize[0] + || $size[1] != $this->CurPageSize[1] + ) { + // New size or orientation + if ($orientation === 'P') { + $this->w = $size[0]; + $this->h = $size[1]; + } else { + $this->w = $size[1]; + $this->h = $size[0]; + } + $this->wPt = $this->w * $this->k; + $this->hPt = $this->h * $this->k; + $this->PageBreakTrigger = $this->h - $this->bMargin; + $this->CurOrientation = $orientation; + $this->CurPageSize = $size; + + $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); + } + } + + /** + * @inheritdoc + */ + protected function _put($s, $newLine = true) + { + if ($newLine) { + $this->buffer .= $s . "\n"; + } else { + $this->buffer .= $s; + } + } +} \ No newline at end of file diff --git a/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php b/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php new file mode 100644 index 0000000000..3fc4b22f3d --- /dev/null +++ b/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php @@ -0,0 +1,158 @@ +<?php +/** + * This file is part of FPDI + * + * @package setasign\Fpdi + * @copyright Copyright (c) 2018 Setasign - Jan Slabon (https://www.setasign.com) + * @license http://opensource.org/licenses/mit-license The MIT License + */ + +namespace setasign\Fpdi\Tfpdf; + +use setasign\Fpdi\FpdiTrait; +use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException; +use setasign\Fpdi\PdfParser\PdfParserException; +use setasign\Fpdi\PdfParser\Type\PdfIndirectObject; +use setasign\Fpdi\PdfParser\Type\PdfNull; + +/** + * Class Fpdi + * + * This class let you import pages of existing PDF documents into a reusable structure for tFPDF. + * + * @package setasign\Fpdi + */ +class Fpdi extends FpdfTpl +{ + use FpdiTrait; + + /** + * FPDI version + * + * @string + */ + const VERSION = '2.1.1'; + + /** + * Draws an imported page or a template onto the page or another template. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $tpl The template id + * @param float|int|array $x The abscissa of upper-left corner. Alternatively you could use an assoc array + * with the keys "x", "y", "width", "height", "adjustPageSize". + * @param float|int $y The ordinate of upper-left corner. + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @param bool $adjustPageSize + * @return array The size + * @see Fpdi::getTemplateSize() + */ + public function useTemplate($tpl, $x = 0, $y = 0, $width = null, $height = null, $adjustPageSize = false) + { + if (isset($this->importedPages[$tpl])) { + $size = $this->useImportedPage($tpl, $x, $y, $width, $height, $adjustPageSize); + if ($this->currentTemplateId !== null) { + $this->templates[$this->currentTemplateId]['resources']['templates']['importedPages'][$tpl] = $tpl; + } + return $size; + } + + return parent::useTemplate($tpl, $x, $y, $width, $height, $adjustPageSize); + } + + /** + * Get the size of an imported page or template. + * + * Omit one of the size parameters (width, height) to calculate the other one automatically in view to the aspect + * ratio. + * + * @param mixed $tpl The template id + * @param float|int|null $width The width. + * @param float|int|null $height The height. + * @return array|bool An array with following keys: width, height, 0 (=width), 1 (=height), orientation (L or P) + */ + public function getTemplateSize($tpl, $width = null, $height = null) + { + $size = parent::getTemplateSize($tpl, $width, $height); + if ($size === false) { + return $this->getImportedPageSize($tpl, $width, $height); + } + + return $size; + } + + /** + * @inheritdoc + * @throws CrossReferenceException + * @throws PdfParserException + */ + public function _putimages() + { + $this->currentReaderId = null; + parent::_putimages(); + + foreach ($this->importedPages as $key => $pageData) { + $this->_newobj(); + $this->importedPages[$key]['objectNumber'] = $this->n; + $this->currentReaderId = $pageData['readerId']; + $this->writePdfType($pageData['stream']); + $this->_put('endobj'); + } + + foreach (\array_keys($this->readers) as $readerId) { + $parser = $this->getPdfReader($readerId)->getParser(); + $this->currentReaderId = $readerId; + + while (($objectNumber = \array_pop($this->objectsToCopy[$readerId])) !== null) { + try { + $object = $parser->getIndirectObject($objectNumber); + + } catch (CrossReferenceException $e) { + if ($e->getCode() === CrossReferenceException::OBJECT_NOT_FOUND) { + $object = PdfIndirectObject::create($objectNumber, 0, new PdfNull()); + } else { + throw $e; + } + } + + $this->writePdfType($object); + } + } + + $this->currentReaderId = null; + } + + /** + * @inheritdoc + */ + public function _putxobjectdict() + { + foreach ($this->importedPages as $key => $pageData) { + $this->_put('/' . $pageData['id'] . ' ' . $pageData['objectNumber'] . ' 0 R'); + } + + parent::_putxobjectdict(); + } + + /** + * @inheritdoc + */ + public function _newobj($n = null) + { + // Begin a new object + if($n === null) + $n = ++$this->n; + $this->offsets[$n] = $this->_getoffset(); + $this->_put($n.' 0 obj'); + } + + /** + * @inheritdoc + */ + protected function _getoffset() + { + return strlen($this->buffer); + } +} \ No newline at end of file diff --git a/vendor/slim/slim/Slim/Http/StatusCode.php b/vendor/slim/slim/Slim/Http/StatusCode.php new file mode 100644 index 0000000000..301bdd932f --- /dev/null +++ b/vendor/slim/slim/Slim/Http/StatusCode.php @@ -0,0 +1,81 @@ +<?php +/** + * Slim Framework (https://slimframework.com) + * + * @link https://github.com/slimphp/Slim + * @copyright Copyright (c) 2011-2017 Josh Lockhart + * @license https://github.com/slimphp/Slim/blob/3.x/LICENSE.md (MIT License) + */ +namespace Slim\Http; + +class StatusCode +{ + const HTTP_CONTINUE = 100; + const HTTP_SWITCHING_PROTOCOLS = 101; + const HTTP_PROCESSING = 102; + + const HTTP_OK = 200; + const HTTP_CREATED = 201; + const HTTP_ACCEPTED = 202; + const HTTP_NONAUTHORITATIVE_INFORMATION = 203; + const HTTP_NO_CONTENT = 204; + const HTTP_RESET_CONTENT = 205; + const HTTP_PARTIAL_CONTENT = 206; + const HTTP_MULTI_STATUS = 207; + const HTTP_ALREADY_REPORTED = 208; + const HTTP_IM_USED = 226; + + const HTTP_MULTIPLE_CHOICES = 300; + const HTTP_MOVED_PERMANENTLY = 301; + const HTTP_FOUND = 302; + const HTTP_SEE_OTHER = 303; + const HTTP_NOT_MODIFIED = 304; + const HTTP_USE_PROXY = 305; + const HTTP_UNUSED= 306; + const HTTP_TEMPORARY_REDIRECT = 307; + const HTTP_PERMANENT_REDIRECT = 308; + + const HTTP_BAD_REQUEST = 400; + const HTTP_UNAUTHORIZED = 401; + const HTTP_PAYMENT_REQUIRED = 402; + const HTTP_FORBIDDEN = 403; + const HTTP_NOT_FOUND = 404; + const HTTP_METHOD_NOT_ALLOWED = 405; + const HTTP_NOT_ACCEPTABLE = 406; + const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; + const HTTP_REQUEST_TIMEOUT = 408; + const HTTP_CONFLICT = 409; + const HTTP_GONE = 410; + const HTTP_LENGTH_REQUIRED = 411; + const HTTP_PRECONDITION_FAILED = 412; + const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; + const HTTP_REQUEST_URI_TOO_LONG = 414; + const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; + const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; + const HTTP_EXPECTATION_FAILED = 417; + const HTTP_IM_A_TEAPOT = 418; + const HTTP_MISDIRECTED_REQUEST = 421; + const HTTP_UNPROCESSABLE_ENTITY = 422; + const HTTP_LOCKED = 423; + const HTTP_FAILED_DEPENDENCY = 424; + const HTTP_UPGRADE_REQUIRED = 426; + const HTTP_PRECONDITION_REQUIRED = 428; + const HTTP_TOO_MANY_REQUESTS = 429; + const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; + const HTTP_CONNECTION_CLOSED_WITHOUT_RESPONSE = 444; + const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; + const HTTP_CLIENT_CLOSED_REQUEST = 499; + + const HTTP_INTERNAL_SERVER_ERROR = 500; + const HTTP_NOT_IMPLEMENTED = 501; + const HTTP_BAD_GATEWAY = 502; + const HTTP_SERVICE_UNAVAILABLE = 503; + const HTTP_GATEWAY_TIMEOUT = 504; + const HTTP_VERSION_NOT_SUPPORTED = 505; + const HTTP_VARIANT_ALSO_NEGOTIATES = 506; + const HTTP_INSUFFICIENT_STORAGE = 507; + const HTTP_LOOP_DETECTED = 508; + const HTTP_NOT_EXTENDED = 510; + const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; + const HTTP_NETWORK_CONNECTION_TIMEOUT_ERROR = 599; +} diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100644 index 0000000000..2a8f6e73b9 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ +<?php + +// from Case_Ignorable in https://unicode.org/Public/UNIDATA/DerivedCoreProperties.txt + +return '/(?<![\x{0027}\x{002E}\x{003A}\x{005E}\x{0060}\x{00A8}\x{00AD}\x{00AF}\x{00B4}\x{00B7}\x{00B8}\x{02B0}-\x{02C1}\x{02C2}-\x{02C5}\x{02C6}-\x{02D1}\x{02D2}-\x{02DF}\x{02E0}-\x{02E4}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EE}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037A}\x{0384}-\x{0385}\x{0387}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0559}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{05F4}\x{0600}-\x{0605}\x{0610}-\x{061A}\x{061C}\x{0640}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DD}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07FA}\x{07FD}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0971}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E46}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EB9}\x{0EBB}-\x{0EBC}\x{0EC6}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{10FC}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17D7}\x{17DD}\x{180B}-\x{180D}\x{180E}\x{1843}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AA7}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1C78}-\x{1C7D}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1D2C}-\x{1D6A}\x{1D78}\x{1D9B}-\x{1DBF}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{200B}-\x{200F}\x{2018}\x{2019}\x{2024}\x{2027}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{2066}-\x{206F}\x{2071}\x{207F}\x{2090}-\x{209C}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2C7C}-\x{2C7D}\x{2CEF}-\x{2CF1}\x{2D6F}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E2F}\x{3005}\x{302A}-\x{302D}\x{3031}-\x{3035}\x{303B}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{309D}-\x{309E}\x{30FC}-\x{30FE}\x{A015}\x{A4F8}-\x{A4FD}\x{A60C}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A67F}\x{A69C}-\x{A69D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A770}\x{A788}\x{A789}-\x{A78A}\x{A7F8}-\x{A7F9}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}\x{A9CF}\x{A9E5}\x{A9E6}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA70}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AADD}\x{AAEC}-\x{AAED}\x{AAF3}-\x{AAF4}\x{AAF6}\x{AB5B}\x{AB5C}-\x{AB5F}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FBB2}-\x{FBC1}\x{FE00}-\x{FE0F}\x{FE13}\x{FE20}-\x{FE2F}\x{FE52}\x{FE55}\x{FEFF}\x{FF07}\x{FF0E}\x{FF1A}\x{FF3E}\x{FF40}\x{FF70}\x{FF9E}-\x{FF9F}\x{FFE3}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110BD}\x{110CD}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16B40}-\x{16B43}\x{16F8F}-\x{16F92}\x{16F93}-\x{16F9F}\x{16FE0}-\x{16FE1}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1F3FB}-\x{1F3FF}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}])(\pL)(\pL*+)/u'; -- GitLab