@@ -140,7 +140,6 @@ will return:
140140<a href =" #col " >col</a >
141141<a href =" #collapse " >collapse</a >
142142<a href =" #combine " >combine</a >
143- <a href =" #compare " >compare</a >
144143<a href =" #concat " >concat</a >
145144<a href =" #contains " >contains</a >
146145<a href =" #copy " >copy</a >
@@ -257,6 +256,7 @@ will return:
257256<a href =" #splice " >splice</a >
258257<a href =" #strafter " >strAfter</a >
259258<a href =" #strbefore " >strBefore</a >
259+ <a href =" #strcompare " >strCompare</a >
260260<a href =" #strcontains " >strContains</a >
261261<a href =" #strcontainsall " >strContainsAll</a >
262262<a href =" #strends " >strEnds</a >
@@ -436,7 +436,6 @@ will return:
436436
437437* [ function is_map()] ( #is_map-function ) : Tests if the variable is a map object
438438* [ any()] ( #any ) : Tests if at least one element satisfies the callback function
439- * [ compare()] ( #compare ) : Compares the value against all map elements
440439* [ contains()] ( #contains ) : Tests if an item exists in the map
441440* [ each()] ( #each ) : Applies a callback to each element
442441* [ empty()] ( #empty ) : Tests if map is empty
@@ -459,6 +458,7 @@ will return:
459458* [ implements()] ( #implements ) : Tests if all entries are objects implementing the interface
460459* [ none()] ( #none ) : Tests if none of the elements are part of the map
461460* [ some()] ( #some ) : Tests if at least one element is included
461+ * [ strCompare()] ( #strcompare ) : Compares the value against all map elements
462462* [ strContains()] ( #strcontains ) : Tests if at least one of the passed strings is part of at least one entry
463463* [ strContainsAll()] ( #strcontainsall ) : Tests if all of the entries contains one of the passed strings
464464* [ strEnds()] ( #strends ) : Tests if at least one of the entries ends with one of the passed strings
@@ -1440,53 +1440,6 @@ Map::from( ['name', 'age'] )->combine( ['Tom', 29] );
14401440* [ zip()] ( #zip ) - Merges the values of all arrays at the corresponding index
14411441
14421442
1443- ### compare()
1444-
1445- Compares the value against all map elements.
1446-
1447- ``` php
1448- public function compare( string $value, bool $case = true ) : bool
1449- ```
1450-
1451- * @param ** string** ` $value ` Value to compare map elements to
1452- * @param ** bool** ` $case ` TRUE if comparison is case sensitive, FALSE to ignore upper/lower case
1453- * @return ** bool** TRUE If at least one element matches, FALSE if value is not in map
1454-
1455- All scalar values (bool, float, int and string) are casted to string values before
1456- comparing to the given value. Non-scalar values in the map are ignored.
1457-
1458- ** Examples:**
1459-
1460- ``` php
1461- Map::from( ['foo', 'bar'] )->compare( 'foo' );
1462- // true
1463-
1464- Map::from( ['foo', 'bar'] )->compare( 'Foo', false );
1465- // true (case insensitive)
1466-
1467- Map::from( [123, 12.3] )->compare( '12.3' );
1468- // true
1469-
1470- Map::from( [false, true] )->compare( '1' );
1471- // true
1472-
1473- Map::from( ['foo', 'bar'] )->compare( 'Foo' );
1474- // false (case sensitive)
1475-
1476- Map::from( ['foo', 'bar'] )->compare( 'baz' );
1477- // false
1478-
1479- Map::from( [new \stdClass(), 'bar'] )->compare( 'foo' );
1480- // false
1481- ```
1482-
1483- ** See also:**
1484-
1485- * [ contains()] ( #contains ) - Tests if an item exists in the map
1486- * [ in()] ( #in ) - Tests if element is included
1487- * [ includes()] ( #includes ) - Tests if element is included
1488-
1489-
14901443### concat()
14911444
14921445Pushs all of the given elements onto the map without creating a new map.
@@ -5659,6 +5612,53 @@ Map::from( [0, 0.0, false, []] )->strBefore( '' );
56595612* [ strAfter()] ( #strafter ) - Returns the strings after the passed value
56605613
56615614
5615+ ### strCompare()
5616+
5617+ Compares the value against all map elements.
5618+
5619+ ``` php
5620+ public function strCompare( string $value, bool $case = true ) : bool
5621+ ```
5622+
5623+ * @param ** string** ` $value ` Value to compare map elements to
5624+ * @param ** bool** ` $case ` TRUE if comparison is case sensitive, FALSE to ignore upper/lower case
5625+ * @return ** bool** TRUE If at least one element matches, FALSE if value is not in map
5626+
5627+ All scalar values (bool, float, int and string) are casted to string values before
5628+ comparing to the given value. Non-scalar values in the map are ignored.
5629+
5630+ ** Examples:**
5631+
5632+ ``` php
5633+ Map::from( ['foo', 'bar'] )->strCompare( 'foo' );
5634+ // true
5635+
5636+ Map::from( ['foo', 'bar'] )->strCompare( 'Foo', false );
5637+ // true (case insensitive)
5638+
5639+ Map::from( [123, 12.3] )->strCompare( '12.3' );
5640+ // true
5641+
5642+ Map::from( [false, true] )->strCompare( '1' );
5643+ // true
5644+
5645+ Map::from( ['foo', 'bar'] )->strCompare( 'Foo' );
5646+ // false (case sensitive)
5647+
5648+ Map::from( ['foo', 'bar'] )->strCompare( 'baz' );
5649+ // false
5650+
5651+ Map::from( [new \stdClass(), 'bar'] )->strCompare( 'foo' );
5652+ // false
5653+ ```
5654+
5655+ ** See also:**
5656+
5657+ * [ contains()] ( #contains ) - Tests if an item exists in the map
5658+ * [ in()] ( #in ) - Tests if element is included
5659+ * [ includes()] ( #includes ) - Tests if element is included
5660+
5661+
56625662### strContains()
56635663
56645664Tests if at least one of the passed strings is part of at least one entry.
0 commit comments