Skip to content

Commit 43b2fec

Browse files
Merge pull request #1130 from daniellienert/task-array-documentation
TASK: Add some documentation to array:indexOf Eel helper
2 parents 7ee49ad + 4003c84 commit 43b2fec

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Neos.Eel/Classes/Helper/ArrayHelper.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,15 @@ public function last(array $array)
143143
}
144144

145145
/**
146-
* @param array $array
147-
* @param mixed $searchElement
148-
* @param integer $fromIndex
149-
* @return mixed
146+
* Returns the first index at which a given element can be found in the array,
147+
* or -1 if it is not present
148+
*
149+
* @param array $array The array
150+
* @param mixed $searchElement The element value to find
151+
* @param int $fromIndex Position in the array to start the search.
152+
* @return int
150153
*/
151-
public function indexOf(array $array, $searchElement, $fromIndex = null)
154+
public function indexOf(array $array, $searchElement, $fromIndex = null): int
152155
{
153156
if ($fromIndex !== null) {
154157
$array = array_slice($array, $fromIndex, null, true);

0 commit comments

Comments
 (0)