@@ -16,12 +16,12 @@ class Preg
1616 const ARRAY_MSG = '$subject as an array is not supported. You can use \'foreach \' instead. ' ;
1717
1818 /**
19- * @param string $pattern
19+ * @param non-empty- string $pattern
2020 * @param string $subject
2121 * @param array<string|null> $matches Set by method
2222 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
2323 * @param int $offset
24- * @return int
24+ * @return 0|1
2525 */
2626 public static function match ($ pattern , $ subject , &$ matches = null , $ flags = 0 , $ offset = 0 )
2727 {
@@ -40,12 +40,12 @@ public static function match($pattern, $subject, &$matches = null, $flags = 0, $
4040 /**
4141 * Runs preg_match with PREG_OFFSET_CAPTURE
4242 *
43- * @param string $pattern
43+ * @param non-empty- string $pattern
4444 * @param string $subject
4545 * @param array<int|string, array{string|null, int}> $matches Set by method
4646 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
4747 * @param int $offset
48- * @return int
48+ * @return 0|1
4949 *
5050 * @phpstan-param array<int|string, array{string|null, int<-1, max>}> $matches
5151 */
@@ -60,12 +60,12 @@ public static function matchWithOffsets($pattern, $subject, &$matches, $flags =
6060 }
6161
6262 /**
63- * @param string $pattern
63+ * @param non-empty- string $pattern
6464 * @param string $subject
6565 * @param array<int|string, list<string|null>> $matches Set by method
6666 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
6767 * @param int $offset
68- * @return int
68+ * @return 0|positive- int
6969 */
7070 public static function matchAll ($ pattern , $ subject , &$ matches = null , $ flags = 0 , $ offset = 0 )
7171 {
@@ -88,12 +88,12 @@ public static function matchAll($pattern, $subject, &$matches = null, $flags = 0
8888 /**
8989 * Runs preg_match_all with PREG_OFFSET_CAPTURE
9090 *
91- * @param string $pattern
91+ * @param non-empty- string $pattern
9292 * @param string $subject
9393 * @param array<int|string, list<array{string|null, int}>> $matches Set by method
9494 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
9595 * @param int $offset
96- * @return int
96+ * @return 0|positive- int
9797 *
9898 * @phpstan-param array<int|string, list<array{string|null, int<-1, max>}>> $matches
9999 */
@@ -242,7 +242,7 @@ public static function grep($pattern, array $array, $flags = 0)
242242 }
243243
244244 /**
245- * @param string $pattern
245+ * @param non-empty- string $pattern
246246 * @param string $subject
247247 * @param array<string|null> $matches Set by method
248248 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
@@ -255,7 +255,7 @@ public static function isMatch($pattern, $subject, &$matches = null, $flags = 0,
255255 }
256256
257257 /**
258- * @param string $pattern
258+ * @param non-empty- string $pattern
259259 * @param string $subject
260260 * @param array<int|string, list<string|null>> $matches Set by method
261261 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
@@ -270,7 +270,7 @@ public static function isMatchAll($pattern, $subject, &$matches = null, $flags =
270270 /**
271271 * Runs preg_match with PREG_OFFSET_CAPTURE
272272 *
273- * @param string $pattern
273+ * @param non-empty- string $pattern
274274 * @param string $subject
275275 * @param array<int|string, array{string|null, int}> $matches Set by method
276276 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
@@ -287,7 +287,7 @@ public static function isMatchWithOffsets($pattern, $subject, &$matches, $flags
287287 /**
288288 * Runs preg_match_all with PREG_OFFSET_CAPTURE
289289 *
290- * @param string $pattern
290+ * @param non-empty- string $pattern
291291 * @param string $subject
292292 * @param array<int|string, list<array{string|null, int}>> $matches Set by method
293293 * @param int $flags PREG_UNMATCHED_AS_NULL, only available on PHP 7.2+
0 commit comments