Skip to content

Commit 26c6f8c

Browse files
swissspidyclaude
andcommitted
Fix PHPStan error in comment delete --all
Narrow the `@var` annotation for the comment ID query result to `list<int<0, max>>`, which is a subtype of the query's declared return type, and align the docblock example's summary line with the actual output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 342b555 commit 26c6f8c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/Comment_Command.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ private function query_comments_in_chunks( $query_args, $need_url ) {
671671
* $ wp comment delete --all --force
672672
* Success: Deleted comment 1337.
673673
* Success: Deleted comment 2341.
674-
* Success: Deleted 2 of 2 comments.
674+
* Success: Deleted 2 comments.
675675
*/
676676
public function delete( $args, $assoc_args ) {
677677
$all = Utils\get_flag_value( $assoc_args, 'all', false );
@@ -1036,11 +1036,13 @@ private function check_optional_args_and_all( $args, $all, $verb = 'delete' ) {
10361036

10371037
/**
10381038
* Gets all available comment IDs.
1039+
*
1040+
* @return list<int<0, max>>
10391041
*/
10401042
private function get_all_comment_ids(): array {
10411043
$query = new WP_Comment_Query();
10421044

1043-
/** @var array $comments */
1045+
/** @var list<int<0, max>> $comments */
10441046
$comments = $query->query(
10451047
array(
10461048
'fields' => 'ids',

0 commit comments

Comments
 (0)