Skip to content

Commit 40707dc

Browse files
Copilotswissspidy
andcommitted
Fix all phpstan-ignore-line to use @ prefix
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 23a423f commit 40707dc

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/Export_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ private function check_author( $author ) {
423423
}
424424

425425
// phpcs:ignore WordPress.WP.DeprecatedFunctions.get_users_of_blogFound -- Fallback.
426-
$authors = function_exists( 'get_users' ) ? get_users() : get_users_of_blog(); // phpstan-ignore-line
426+
$authors = function_exists( 'get_users' ) ? get_users() : get_users_of_blog(); // @phpstan-ignore-line
427427
if ( empty( $authors ) ) {
428428
WP_CLI::warning( 'Could not find any authors in this blog.' );
429429
return false;

src/WP_Export_Oxymel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function optional( $tag_name, $contents ) {
1010

1111
public function optional_cdata( $tag_name, $contents ) {
1212
if ( $contents ) {
13-
$this->$tag_name->contains->cdata( $contents )->end; // phpstan-ignore-line
13+
$this->$tag_name->contains->cdata( $contents )->end; // @phpstan-ignore-line
1414
}
1515
return $this;
1616
}

src/WP_Export_Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function custom_taxonomies_terms() {
122122
}
123123
$custom_taxonomies = get_taxonomies( [ '_builtin' => false ] );
124124
// phpcs:ignore WordPress.WP.DeprecatedParameters.Get_termsParam2Found -- Deprecated, but we need to support older versions of WordPress.
125-
$custom_terms = (array) get_terms( $custom_taxonomies, [ 'get' => 'all' ] ); // phpstan-ignore-line
125+
$custom_terms = (array) get_terms( $custom_taxonomies, [ 'get' => 'all' ] ); // @phpstan-ignore-line
126126
$custom_terms = $this->process_orphaned_terms( $custom_terms );
127127
$custom_terms = self::topologically_sort_terms( $custom_terms );
128128
return $custom_terms;

src/WP_Export_WXR_Formatter.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function header() {
8585
8686
COMMENT;
8787
return $oxymel
88-
->xml // phpstan-ignore-line
88+
->xml // @phpstan-ignore-line
8989
->comment( $comment )
9090
->raw( $wp_generator_tag )
9191
->open_rss(
@@ -105,7 +105,7 @@ public function header() {
105105
public function site_metadata() {
106106
$oxymel = new Oxymel();
107107
$metadata = $this->export->site_metadata();
108-
return $oxymel // phpstan-ignore-line
108+
return $oxymel // @phpstan-ignore-line
109109
->title( $metadata['name'] )
110110
->link( $metadata['url'] )
111111
->description( $metadata['description'] )
@@ -129,7 +129,7 @@ public function authors() {
129129
->tag( 'wp:author_display_name' )->contains->cdata( $author->display_name )->end
130130
->tag( 'wp:author_first_name' )->contains->cdata( $author->user_firstname )->end
131131
->tag( 'wp:author_last_name' )->contains->cdata( $author->user_lastname )->end
132-
->end; // phpstan-ignore-line
132+
->end; // @phpstan-ignore-line
133133
}
134134
return $oxymel->to_string();
135135
}
@@ -145,7 +145,7 @@ public function categories() {
145145
->tag( 'wp:category_parent', $category->parent_slug )
146146
->optional_cdata( 'wp:cat_name', $category->name )
147147
->optional_cdata( 'wp:category_description', $category->description )
148-
->end; // phpstan-ignore-line
148+
->end; // @phpstan-ignore-line
149149
}
150150
return $oxymel->to_string();
151151
}
@@ -159,7 +159,7 @@ public function tags() {
159159
->tag( 'wp:tag_slug', $tag->slug )
160160
->optional_cdata( 'wp:tag_name', $tag->name )
161161
->optional_cdata( 'wp:tag_description', $tag->description )
162-
->end; // phpstan-ignore-line
162+
->end; // @phpstan-ignore-line
163163
}
164164
return $oxymel->to_string();
165165
}
@@ -186,7 +186,7 @@ public function post( $post ) {
186186
$GLOBALS['post'] = $post;
187187
setup_postdata( $post );
188188

189-
$oxymel->item->contains // phpstan-ignore-line
189+
$oxymel->item->contains // @phpstan-ignore-line
190190
->tag( 'title' )->contains->cdata( apply_filters( 'the_title_export', $post->post_title ) )->end // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- WordPress native hook.
191191
->link( esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) ) ) // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- WordPress native hook.
192192
->pubDate( mysql2date( 'D, d M Y H:i:s +0000', (string) get_post_time( 'Y-m-d H:i:s', true ), false ) )
@@ -211,23 +211,23 @@ public function post( $post ) {
211211
->tag( 'wp:is_sticky', $post->is_sticky )
212212
->optional( 'wp:attachment_url', wp_get_attachment_url( $post->ID ) );
213213
foreach ( $post->terms as $term ) {
214-
$oxymel // phpstan-ignore-line
214+
$oxymel // @phpstan-ignore-line
215215
->category(
216216
[
217217
'domain' => $term->taxonomy,
218218
'nicename' => $term->slug,
219219
]
220-
)->contains->cdata( $term->name )->end; // phpstan-ignore-line
220+
)->contains->cdata( $term->name )->end; // @phpstan-ignore-line
221221
}
222222
foreach ( $post->meta as $meta ) {
223-
$oxymel // phpstan-ignore-line
223+
$oxymel // @phpstan-ignore-line
224224
->tag( 'wp:postmeta' )->contains
225225
->tag( 'wp:meta_key', $meta->meta_key )
226226
->tag( 'wp:meta_value' )->contains->cdata( $meta->meta_value )->end
227-
->end; // phpstan-ignore-line
227+
->end; // @phpstan-ignore-line
228228
}
229229
foreach ( $post->comments as $comment ) {
230-
$oxymel // phpstan-ignore-line
230+
$oxymel // @phpstan-ignore-line
231231
->tag( 'wp:comment' )->contains
232232
->tag( 'wp:comment_id', $comment->comment_ID )
233233
->tag( 'wp:comment_author' )->contains->cdata( $comment->comment_author )->end
@@ -242,16 +242,16 @@ public function post( $post ) {
242242
->tag( 'wp:comment_parent', $comment->comment_parent )
243243
->tag( 'wp:comment_user_id', $comment->user_id )
244244
->oxymel( $this->comment_meta( $comment ) )
245-
->end; // phpstan-ignore-line
245+
->end; // @phpstan-ignore-line
246246
}
247-
$oxymel // phpstan-ignore-line
248-
->end; // phpstan-ignore-line
247+
$oxymel // @phpstan-ignore-line
248+
->end; // @phpstan-ignore-line
249249
return $oxymel->to_string();
250250
}
251251

252252
public function footer() {
253253
$oxymel = new Oxymel();
254-
return $oxymel->close_channel->close_rss->to_string(); // phpstan-ignore-line
254+
return $oxymel->close_channel->close_rss->to_string(); // @phpstan-ignore-line
255255
}
256256

257257
protected function terms( $terms ) {
@@ -266,10 +266,10 @@ protected function terms( $terms ) {
266266
$oxymel
267267
->tag( 'wp:term_parent', $term->parent_slug );
268268
}
269-
$oxymel // phpstan-ignore-line
269+
$oxymel // @phpstan-ignore-line
270270
->optional_cdata( 'wp:term_name', $term->name )
271271
->optional_cdata( 'wp:term_description', $term->description )
272-
->end; // phpstan-ignore-line
272+
->end; // @phpstan-ignore-line
273273
}
274274
return $oxymel->to_string();
275275
}
@@ -282,10 +282,10 @@ protected function comment_meta( $comment ) {
282282
}
283283
$oxymel = new WP_Export_Oxymel();
284284
foreach ( $metas as $meta ) {
285-
$oxymel->tag( 'wp:commentmeta' )->contains // phpstan-ignore-line
285+
$oxymel->tag( 'wp:commentmeta' )->contains // @phpstan-ignore-line
286286
->tag( 'wp:meta_key', $meta->meta_key )
287287
->tag( 'wp:meta_value' )->contains->cdata( $meta->meta_value )->end
288-
->end; // phpstan-ignore-line
288+
->end; // @phpstan-ignore-line
289289
}
290290
return $oxymel;
291291
}

0 commit comments

Comments
 (0)