Mercurial > hg > isophonics-drupal-site
diff vendor/webmozart/assert/README.md @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
line wrap: on
line diff
--- a/vendor/webmozart/assert/README.md Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/webmozart/assert/README.md Fri Feb 23 15:52:07 2018 +0000 @@ -1,7 +1,7 @@ Webmozart Assert ================ -[](https://travis-ci.org/webmozart/assert) +[](https://travis-ci.org/webmozart/assert) [](https://ci.appveyor.com/project/webmozart/assert/branch/master) [](https://packagist.org/packages/webmozart/assert) [](https://packagist.org/packages/webmozart/assert) @@ -89,23 +89,28 @@ ### Type Assertions -Method | Description ------------------------------------------------ | -------------------------------------------------- -`string($value, $message = '')` | Check that a value is a string -`stringNotEmpty($value, $message = '')` | Check that a value is a non-empty string -`integer($value, $message = '')` | Check that a value is an integer -`integerish($value, $message = '')` | Check that a value casts to an integer -`float($value, $message = '')` | Check that a value is a float -`numeric($value, $message = '')` | Check that a value is numeric -`boolean($value, $message = '')` | Check that a value is a boolean -`scalar($value, $message = '')` | Check that a value is a scalar -`object($value, $message = '')` | Check that a value is an object -`resource($value, $type = null, $message = '')` | Check that a value is a resource -`isCallable($value, $message = '')` | Check that a value is a callable -`isArray($value, $message = '')` | Check that a value is an array -`isTraversable($value, $message = '')` | Check that a value is an array or a `\Traversable` -`isInstanceOf($value, $class, $message = '')` | Check that a value is an `instanceof` a class -`notInstanceOf($value, $class, $message = '')` | Check that a value is not an `instanceof` a class +Method | Description +-------------------------------------------------------- | -------------------------------------------------- +`string($value, $message = '')` | Check that a value is a string +`stringNotEmpty($value, $message = '')` | Check that a value is a non-empty string +`integer($value, $message = '')` | Check that a value is an integer +`integerish($value, $message = '')` | Check that a value casts to an integer +`float($value, $message = '')` | Check that a value is a float +`numeric($value, $message = '')` | Check that a value is numeric +`natural($value, $message= ''')` | Check that a value is a non-negative integer +`boolean($value, $message = '')` | Check that a value is a boolean +`scalar($value, $message = '')` | Check that a value is a scalar +`object($value, $message = '')` | Check that a value is an object +`resource($value, $type = null, $message = '')` | Check that a value is a resource +`isCallable($value, $message = '')` | Check that a value is a callable +`isArray($value, $message = '')` | Check that a value is an array +`isTraversable($value, $message = '')` (deprecated) | Check that a value is an array or a `\Traversable` +`isIterable($value, $message = '')` | Check that a value is an array or a `\Traversable` +`isCountable($value, $message = '')` | Check that a value is an array or a `\Countable` +`isInstanceOf($value, $class, $message = '')` | Check that a value is an `instanceof` a class +`isInstanceOfAny($value, array $classes, $message = '')` | Check that a value is an `instanceof` a at least one class on the array of classes +`notInstanceOf($value, $class, $message = '')` | Check that a value is not an `instanceof` a class +`isArrayAccessible($value, $message = '')` | Check that a value can be accessed as an array ### Comparison Assertions @@ -134,8 +139,9 @@ any of the following assertions. Method | Description ---------------------------------------------------- | -------------------------------------------------- +--------------------------------------------------- | ----------------------------------------------------------------- `contains($value, $subString, $message = '')` | Check that a string contains a substring +`notContains($value, $subString, $message = '')` | Check that a string does not contains a substring `startsWith($value, $prefix, $message = '')` | Check that a string has a prefix `startsWithLetter($value, $message = '')` | Check that a string starts with a letter `endsWith($value, $suffix, $message = '')` | Check that a string has a suffix @@ -150,6 +156,7 @@ `maxLength($value, $max, $message = '')` | Check that a string has at most a certain number of characters `lengthBetween($value, $min, $max, $message = '')` | Check that a string has a length in the given range `uuid($value, $message = '')` | Check that a string is a valid UUID +`notWhitespaceOnly($value, $message = '')` | Check that a string contains at least one non-whitespace character ### File Assertions @@ -175,11 +182,14 @@ ### Array Assertions -Method | Description -------------------------------------------- | -------------------------------------------------- -`keyExists($array, $key, $message = '')` | Check that a key exists in an array -`keyNotExists($array, $key, $message = '')` | Check that a key does not exist in an array -`count($array, $number, $message = '')` | Check that an array contains a specific number of elements +Method | Description +-------------------------------------------------- | ------------------------------------------------------------------ +`keyExists($array, $key, $message = '')` | Check that a key exists in an array +`keyNotExists($array, $key, $message = '')` | Check that a key does not exist in an array +`count($array, $number, $message = '')` | Check that an array contains a specific number of elements +`minCount($array, $min, $message = '')` | Check that an array contains at least a certain number of elements +`maxCount($array, $max, $message = '')` | Check that an array contains at most a certain number of elements +`countBetween($array, $min, $max, $message = '')` | Check that an array has a count in the given range ### Function Assertions @@ -235,7 +245,7 @@ [Composer]: https://getcomposer.org [Bernhard Schussek]: http://webmozarts.com [The Community Contributors]: https://github.com/webmozart/assert/graphs/contributors -[issue tracker]: https://github.com/webmozart/assert +[issue tracker]: https://github.com/webmozart/assert/issues [Git repository]: https://github.com/webmozart/assert [@webmozart]: https://twitter.com/webmozart [MIT license]: LICENSE