-
Notifications
You must be signed in to change notification settings - Fork 158
Correct isList type documentation #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| Changelog | ||
| ========= | ||
|
|
||
| ## 2.1.3 | ||
|
|
||
| ### Fixed | ||
|
|
||
| - Corrected `isList` type documentation | ||
|
|
||
| ## 2.1.2 | ||
|
|
||
| ### Fixed | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1984,9 +1984,11 @@ public static function countBetween(mixed $array, mixed $min, mixed $max, string | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert list $array | ||
| * @psalm-assert list<T> $array | ||
| * | ||
| * @psalm-return list | ||
| * @psalm-return list<T> | ||
| * | ||
| * @template T | ||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
@@ -2004,9 +2006,11 @@ public static function isList(mixed $array, string $message = ''): array | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert non-empty-list $array | ||
| * @psalm-assert non-empty-list<T> $array | ||
| * | ||
| * @psalm-return non-empty-list | ||
| * @psalm-return non-empty-list<T> | ||
| * | ||
| * @template T | ||
|
Comment on lines
+2009
to
+2013
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
|
|
||
| use ArrayAccess; | ||
| use Countable; | ||
| use Throwable; | ||
|
|
||
| /** | ||
| * This trait provides nullOr*, all* and allNullOr* variants of assertion base methods. | ||
|
|
@@ -4781,9 +4782,10 @@ public static function allNullOrCountBetween(mixed $array, mixed $min, mixed $ma | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert list|null $array | ||
| * @psalm-assert list<T>|null $array | ||
| * | ||
| * @return list|null | ||
| * @template T | ||
| * @return list<T>|null | ||
|
Comment on lines
+4785
to
+4788
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
@@ -4797,9 +4799,10 @@ public static function nullOrIsList(mixed $array, string $message = ''): mixed | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert iterable<list> $array | ||
| * @psalm-assert iterable<list<T>> $array | ||
| * | ||
| * @return iterable<list> | ||
| * @template T | ||
| * @return iterable<list<T>> | ||
shadowhand marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
@@ -4817,9 +4820,10 @@ public static function allIsList(mixed $array, string $message = ''): mixed | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert iterable<list|null> $array | ||
| * @psalm-assert iterable<list<T>|null> $array | ||
| * | ||
| * @return iterable<list|null> | ||
| * @template T | ||
| * @return iterable<list<T>|null> | ||
shadowhand marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
@@ -4837,9 +4841,10 @@ public static function allNullOrIsList(mixed $array, string $message = ''): mixe | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert non-empty-list|null $array | ||
| * @psalm-assert non-empty-list<T>|null $array | ||
| * | ||
| * @return non-empty-list|null | ||
| * @template T | ||
| * @return non-empty-list<T>|null | ||
|
Comment on lines
+4844
to
+4847
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
@@ -4853,9 +4858,10 @@ public static function nullOrIsNonEmptyList(mixed $array, string $message = ''): | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert iterable<non-empty-list> $array | ||
| * @psalm-assert iterable<non-empty-list<T>> $array | ||
| * | ||
| * @return iterable<non-empty-list> | ||
| * @template T | ||
| * @return iterable<non-empty-list<T>> | ||
|
Comment on lines
+4861
to
+4864
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
@@ -4873,9 +4879,10 @@ public static function allIsNonEmptyList(mixed $array, string $message = ''): mi | |
| /** | ||
| * @psalm-pure | ||
| * | ||
| * @psalm-assert iterable<non-empty-list|null> $array | ||
| * @psalm-assert iterable<non-empty-list<T>|null> $array | ||
| * | ||
| * @return iterable<non-empty-list|null> | ||
| * @template T | ||
| * @return iterable<non-empty-list<T>|null> | ||
|
Comment on lines
+4882
to
+4885
|
||
| * | ||
| * @throws InvalidArgumentException | ||
| */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @template annotation should be placed at the beginning of the docblock (after @psalm-pure), before @psalm-assert, to maintain consistency with other templated methods in this file. For example, see the isInstanceOf method (line 475), notInstanceOf method (line 503), isAOf method (line 558), isNotA method (line 587), and isMap method (line 2028). The correct order should be: @psalm-pure, @template T, @psalm-assert, @psalm-return.