Skip to content

Commit 16d5633

Browse files
committed
Add PHPCS ignore comments for unused parameters
Added PHPCS ignore comments to methods in class-adapter.php to suppress unused parameter warnings, and removed related exclusions from phpcs.xml. Also updated README.md contributors list.
1 parent 58444f7 commit 16d5633

3 files changed

Lines changed: 7 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Microsub
22

3-
- Contributors: pfefferle
3+
- Contributors: pfefferle, indieweb
44
- Donate link: https://notiz.blog/donate/
55
- Tags: microsub, indieweb, reader, feeds, rss
66
- Requires at least: 6.5

includes/class-adapter.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ public function get_name() {
145145
* @param string $url The URL to check.
146146
* @return bool True if this adapter can handle the URL.
147147
*/
148-
public function can_handle_url( $url ) {
148+
public function can_handle_url( $url ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
149149
return true;
150-
// Default: can handle any URL.
151150
}
152151

153152
/**
@@ -159,9 +158,8 @@ public function can_handle_url( $url ) {
159158
* @param string $url The feed URL to check.
160159
* @return bool True if this adapter owns the feed.
161160
*/
162-
public function owns_feed( $url ) {
161+
public function owns_feed( $url ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
163162
return false;
164-
// Default: doesn't own any feeds.
165163
}
166164

167165
// =========================================================================
@@ -253,7 +251,7 @@ abstract public function unfollow( $result, $channel, $url, $user_id );
253251
* @param int $user_id The user ID.
254252
* @return array|null Created channel data, or null if not supported.
255253
*/
256-
public function create_channel( $result, $name, $user_id ) {
254+
public function create_channel( $result, $name, $user_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
257255
return $result;
258256
}
259257

@@ -266,7 +264,7 @@ public function create_channel( $result, $name, $user_id ) {
266264
* @param int $user_id The user ID.
267265
* @return array|null Updated channel data, or null if not supported.
268266
*/
269-
public function update_channel( $result, $uid, $name, $user_id ) {
267+
public function update_channel( $result, $uid, $name, $user_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
270268
return $result;
271269
}
272270

@@ -278,7 +276,7 @@ public function update_channel( $result, $uid, $name, $user_id ) {
278276
* @param int $user_id The user ID.
279277
* @return bool|null True on success, false on failure, null if not supported.
280278
*/
281-
public function delete_channel( $result, $uid, $user_id ) {
279+
public function delete_channel( $result, $uid, $user_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
282280
return $result;
283281
}
284282

@@ -290,7 +288,7 @@ public function delete_channel( $result, $uid, $user_id ) {
290288
* @param int $user_id The user ID.
291289
* @return array|null Reordered channels, or null if not supported.
292290
*/
293-
public function order_channels( $result, $channels, $user_id ) {
291+
public function order_channels( $result, $channels, $user_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
294292
return $result;
295293
}
296294

phpcs.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
<exclude-pattern>*/includes/adapters/*</exclude-pattern>
2727
<exclude-pattern>*/tests/*</exclude-pattern>
2828
</rule>
29-
<!-- Base adapter class defines interface signatures; default implementations don't use params -->
30-
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed">
31-
<exclude-pattern>*/includes/class-adapter.php</exclude-pattern>
32-
</rule>
33-
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
34-
<exclude-pattern>*/includes/class-adapter.php</exclude-pattern>
35-
</rule>
3629
<rule ref="Generic.Formatting.MultipleStatementAlignment">
3730
<exclude-pattern>*/tests/*</exclude-pattern>
3831
</rule>

0 commit comments

Comments
 (0)