X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fwebmozart%2Fassert%2FREADME.md;h=1c1ede7dd1476876053e6f8359faabae4f65429c;hp=d17686004c2dc2aa203daf9ba743ad7bc618bf87;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/webmozart/assert/README.md b/vendor/webmozart/assert/README.md index d17686004..1c1ede7dd 100644 --- a/vendor/webmozart/assert/README.md +++ b/vendor/webmozart/assert/README.md @@ -1,7 +1,7 @@ Webmozart Assert ================ -[![Build Status](https://travis-ci.org/webmozart/assert.svg?branch=1.2.0)](https://travis-ci.org/webmozart/assert) +[![Build Status](https://travis-ci.org/webmozart/assert.svg?branch=master)](https://travis-ci.org/webmozart/assert) [![Build status](https://ci.appveyor.com/api/projects/status/lyg83bcsisrr94se/branch/master?svg=true)](https://ci.appveyor.com/project/webmozart/assert/branch/master) [![Latest Stable Version](https://poser.pugx.org/webmozart/assert/v/stable.svg)](https://packagist.org/packages/webmozart/assert) [![Total Downloads](https://poser.pugx.org/webmozart/assert/downloads.svg)](https://packagist.org/packages/webmozart/assert) @@ -89,23 +89,28 @@ The [`Assert`] class provides the following assertions: ### 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 @@ You should check that a value is a string with `Assert::string()` before making 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 @@ Method | Description `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 @@ Method | Description ### 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 @@ All contents of this package are licensed under the [MIT license]. [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