From b3466382d51317bb71305c8f24311e7b7f47f49a Mon Sep 17 00:00:00 2001 From: Paulo Freitas Date: Sat, 25 Mar 2017 00:44:53 -0300 Subject: [PATCH] Document Collection::containsStrict() method Documents the feature added by laravel/framework#14657 Also updates the Collection::contains() documentation to outline its behavior and where they differ. --- collections.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/collections.md b/collections.md index f57db8c488..9e05fe34a7 100644 --- a/collections.md +++ b/collections.md @@ -53,6 +53,7 @@ For the remainder of this documentation, we'll discuss each method available on [collapse](#method-collapse) [combine](#method-combine) [contains](#method-contains) +[containsStrict](#method-containsstrict) [count](#method-count) [diff](#method-diff) [diffKeys](#method-diffkeys) @@ -249,6 +250,12 @@ Finally, you may also pass a callback to the `contains` method to perform your o // false +The `contains` method uses "loose" comparisons when checking item values, meaning a string with an integer value will be considered equal to an integer of the same value. Use the `containsStrict` method to filter using "strict" comparisons. + +#### `containsStrict()` {#collection-method} + +This method has the same signature as the `contains` method; however, all values are compared using "strict" comparisons. + #### `count()` {#collection-method}