File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,11 @@ function contains(...$values): bool;
7070 function filter (callable $ callback = null ): Sequence ;
7171
7272 /**
73- * Returns the index of a given value, or false if it could not be found.
73+ * Returns the index of a given value, or null if it could not be found.
7474 *
7575 * @param mixed $value
7676 *
77- * @return int|false
77+ * @return int|null
7878 *
7979 * @psalm-param TValue $value
8080 */
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function count(): int
8080 public function contains (...$ values ): bool
8181 {
8282 foreach ($ values as $ value ) {
83- if ($ this ->find ($ value ) === false ) {
83+ if ($ this ->find ($ value ) === null ) {
8484 return false ;
8585 }
8686 }
@@ -101,7 +101,9 @@ public function filter(callable $callback = null): Sequence
101101 */
102102 public function find ($ value )
103103 {
104- return array_search ($ value , $ this ->array , true );
104+ $ offset = array_search ($ value , $ this ->array , true );
105+
106+ return $ offset === false ? null : $ offset ;
105107 }
106108
107109 /**
You can’t perform that action at this time.
0 commit comments