Skip to content

Commit 751fa0f

Browse files
committed
Remove unnecessary PHPCS ignore comments for short ternary
Deleted redundant 'phpcs:ignore Universal.Operators.DisallowShortTernary.Found' comments from multiple files after excluding the rule in phpcs.xml. This cleans up the code and maintains consistency with the project's coding standards configuration.
1 parent 10c96f8 commit 751fa0f

File tree

8 files changed

+0
-14
lines changed

8 files changed

+0
-14
lines changed

build/followers/render.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ function ( $follower ) {
6464
return array(
6565
'handle' => '@' . $username,
6666
'icon' => $actor->get_icon(),
67-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
6867
'name' => $actor->get_name() ?: $username,
69-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
7068
'url' => object_to_uri( $actor->get_url() ) ?: $actor->get_id(),
7169
);
7270
},

includes/collection/class-outbox.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,9 @@ private static function get_object_title( $activity_object ) {
385385
return $post_id ? get_the_title( $post_id ) : '';
386386
}
387387

388-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
389388
$title = $activity_object->get_name() ?: $activity_object->get_content();
390389

391390
if ( ! $title && $activity_object->get_object() instanceof Base_Object ) {
392-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
393391
$title = $activity_object->get_object()->get_name() ?: $activity_object->get_object()->get_content();
394392
}
395393

includes/collection/class-remote-actors.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ private static function prepare_custom_post_type( $actor ) {
527527

528528
return array(
529529
'guid' => \esc_url_raw( $actor->get_id() ),
530-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
531530
'post_title' => \wp_strip_all_tags( \wp_slash( $actor->get_name() ?: $actor->get_preferred_username() ) ),
532531
'post_author' => 0,
533532
'post_type' => self::POST_TYPE,

includes/wp-admin/table/class-blocked-actors.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,8 @@ public function prepare_items() {
231231
$this->items[] = array(
232232
'id' => $blocked_actor_post->ID,
233233
'icon' => object_to_uri( $actor->get_icon() ?? ACTIVITYPUB_PLUGIN_URL . 'assets/img/mp.jpg' ),
234-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
235234
'post_title' => $actor->get_name() ?: $actor->get_preferred_username(),
236235
'username' => $actor->get_preferred_username(),
237-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
238236
'url' => object_to_uri( $actor->get_url() ?: $actor->get_id() ),
239237
'webfinger' => Remote_Actors::get_acct( $blocked_actor_post->ID ),
240238
'identifier' => $actor->get_id(),

includes/wp-admin/table/class-followers.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,8 @@ public function prepare_items() {
283283
$this->items[] = array(
284284
'id' => $follower->ID,
285285
'icon' => object_to_uri( $actor->get_icon() ?? ACTIVITYPUB_PLUGIN_URL . 'assets/img/mp.jpg' ),
286-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
287286
'post_title' => $actor->get_name() ?: $actor->get_preferred_username(),
288287
'username' => $actor->get_preferred_username(),
289-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
290288
'url' => object_to_uri( $actor->get_url() ?: $actor->get_id() ),
291289
'webfinger' => Remote_Actors::get_acct( $follower->ID ),
292290
'identifier' => $actor->get_id(),

includes/wp-admin/table/class-following.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,8 @@ public function prepare_items() {
251251
$this->items[] = array(
252252
'id' => $following->ID,
253253
'icon' => object_to_uri( $actor->get_icon() ?? ACTIVITYPUB_PLUGIN_URL . 'assets/img/mp.jpg' ),
254-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
255254
'post_title' => $actor->get_name() ?: $actor->get_preferred_username(),
256255
'username' => $actor->get_preferred_username(),
257-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
258256
'url' => object_to_uri( $actor->get_url() ?: $actor->get_id() ),
259257
'webfinger' => Remote_Actors::get_acct( $following->ID ),
260258
'status' => Following_Collection::check_status( $this->user_id, $following->ID ),

phpcs.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
</properties>
3333
</rule>
3434

35-
<!-- Allow short ternary operators (Elvis operator) -->
3635
<rule ref="WordPress">
3736
<exclude name="Universal.Operators.DisallowShortTernary" />
3837
</rule>

src/followers/render.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ function ( $follower ) {
6464
return array(
6565
'handle' => '@' . $username,
6666
'icon' => $actor->get_icon(),
67-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
6867
'name' => $actor->get_name() ?: $username,
69-
// phpcs:ignore Universal.Operators.DisallowShortTernary.Found
7068
'url' => object_to_uri( $actor->get_url() ) ?: $actor->get_id(),
7169
);
7270
},

0 commit comments

Comments
 (0)