@@ -20,7 +20,7 @@ class Extract
2020 * @param mixed $chars The number of characters to extract (as an integer)
2121 * Or can be an array of values
2222 *
23- * @return array|string The joined string
23+ * @return array<mixed> |string The joined string
2424 * If an array of values is passed for the $value or $chars arguments, then the returned result
2525 * will also be an array with matching dimensions
2626 */
@@ -50,7 +50,7 @@ public static function left(mixed $value, mixed $chars = 1): array|string
5050 * @param mixed $chars The number of characters to extract (as an integer)
5151 * Or can be an array of values
5252 *
53- * @return array|string The joined string
53+ * @return array<mixed> |string The joined string
5454 * If an array of values is passed for the $value, $start or $chars arguments, then the returned result
5555 * will also be an array with matching dimensions
5656 */
@@ -79,7 +79,7 @@ public static function mid(mixed $value, mixed $start, mixed $chars): array|stri
7979 * @param mixed $chars The number of characters to extract (as an integer)
8080 * Or can be an array of values
8181 *
82- * @return array|string The joined string
82+ * @return array<mixed> |string The joined string
8383 * If an array of values is passed for the $value or $chars arguments, then the returned result
8484 * will also be an array with matching dimensions
8585 */
@@ -104,7 +104,7 @@ public static function right(mixed $value, mixed $chars = 1): array|string
104104 *
105105 * @param mixed $text the text that you're searching
106106 * Or can be an array of values
107- * @param null|array|string $delimiter the text that marks the point before which you want to extract
107+ * @param null|array<string> |string $delimiter the text that marks the point before which you want to extract
108108 * Multiple delimiters can be passed as an array of string values
109109 * @param mixed $instance The instance of the delimiter after which you want to extract the text.
110110 * By default, this is the first instance (1).
@@ -118,11 +118,11 @@ public static function right(mixed $value, mixed $chars = 1): array|string
118118 * 0 - Don't match the delimiter against the end of the text.
119119 * 1 - Match the delimiter against the end of the text.
120120 * Or can be an array of values
121- * @param mixed $ifNotFound value to return if no match is found
121+ * @param array<string>|bool|float|int|string $ifNotFound value to return if no match is found
122122 * The default is a #N/A Error
123123 * Or can be an array of values
124124 *
125- * @return array|string the string extracted from text before the delimiter; or the $ifNotFound value
125+ * @return array<mixed> |string the string extracted from text before the delimiter; or the $ifNotFound value
126126 * If an array of values is passed for any of the arguments, then the returned result
127127 * will also be an array with matching dimensions
128128 */
@@ -168,7 +168,7 @@ public static function before(mixed $text, $delimiter, mixed $instance = 1, mixe
168168 * TEXTAFTER.
169169 *
170170 * @param mixed $text the text that you're searching
171- * @param null|array|string $delimiter the text that marks the point before which you want to extract
171+ * @param null|array<string> |string $delimiter the text that marks the point before which you want to extract
172172 * Multiple delimiters can be passed as an array of string values
173173 * @param mixed $instance The instance of the delimiter after which you want to extract the text.
174174 * By default, this is the first instance (1).
@@ -182,11 +182,11 @@ public static function before(mixed $text, $delimiter, mixed $instance = 1, mixe
182182 * 0 - Don't match the delimiter against the end of the text.
183183 * 1 - Match the delimiter against the end of the text.
184184 * Or can be an array of values
185- * @param mixed $ifNotFound value to return if no match is found
185+ * @param array<string>|scalar $ifNotFound value to return if no match is found
186186 * The default is a #N/A Error
187187 * Or can be an array of values
188188 *
189- * @return array|string the string extracted from text before the delimiter; or the $ifNotFound value
189+ * @return array<mixed> |string the string extracted from text before the delimiter; or the $ifNotFound value
190190 * If an array of values is passed for any of the arguments, then the returned result
191191 * will also be an array with matching dimensions
192192 */
@@ -228,6 +228,12 @@ public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed
228228 return implode ('' , $ split );
229229 }
230230
231+ /**
232+ * @param null|array<string>|string $delimiter
233+ * @param array<string>|scalar $ifNotFound
234+ *
235+ * @return array<string>|string
236+ */
231237 private static function validateTextBeforeAfter (string $ text , null |array |string $ delimiter , int $ instance , int $ matchMode , int $ matchEnd , mixed $ ifNotFound ): array |string
232238 {
233239 $ flags = self ::matchFlags ($ matchMode );
@@ -256,7 +262,7 @@ private static function validateTextBeforeAfter(string $text, null|array|string
256262 }
257263
258264 /**
259- * @param null|array|string $delimiter the text that marks the point before which you want to extract
265+ * @param null|array<string> |string $delimiter the text that marks the point before which you want to extract
260266 * Multiple delimiters can be passed as an array of string values
261267 */
262268 private static function buildDelimiter ($ delimiter ): string
0 commit comments