Skip to content

Commit

Permalink
[CMSP-666] Fix linting for latest Pantheon WP Coding Standards (#264)
Browse files Browse the repository at this point in the history
* linting

* ignore separate functions mixed with structure sniff in main plugin file

* bump pantheon wp coding standards to 2.0

* update changelog

* native php sessions

* Update readme.txt
  • Loading branch information
jazzsequence authored Sep 12, 2023
1 parent 82f26e3 commit 49e3b28
Show file tree
Hide file tree
Showing 13 changed files with 327 additions and 185 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ This mu-plugin will load WP Native PHP Sessions before all other plugins, while
## Changelog ##

### 1.3.7-dev ###
* Updates Pantheon WP Coding Standards to 2.0 [[#264](https://github.com/pantheon-systems/wp-native-php-sessions/pull/264)]

### 1.3.6 (June 1, 2023) ###
* Fixes PHP 8.2 deprecated dynamic property error [[#251](https://github.com/pantheon-systems/wp-native-php-sessions/pull/251)] (props @miguelaxcar)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require-dev": {
"pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master",
"pantheon-systems/pantheon-wp-coding-standards": "^1.0",
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^2.0"
},
Expand Down
492 changes: 318 additions & 174 deletions composer.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion inc/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,4 @@ public function action_admin_footer() {
</script>
<?php
}

}
1 change: 0 additions & 1 deletion inc/class-cli-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public function delete( $args, $assoc_args ) {
}
}
}

}

\WP_CLI::add_command( 'pantheon session', '\Pantheon_Sessions\CLI_Command' );
1 change: 0 additions & 1 deletion inc/class-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,4 @@ public function column_default( $item, $column_name ) {
return esc_html( $item->$column_name );
}
}

}
1 change: 0 additions & 1 deletion inc/class-session-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,4 @@ public function gc( $maxlifetime ) {
public function close() {
return true;
}

}
1 change: 0 additions & 1 deletion inc/class-session.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,4 @@ private static function get_session_id_column() {
return 'session_id';
}
}

}
5 changes: 5 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
<exclude-pattern>*/inc/class-cli-command.php</exclude-pattern>
</rule>

<!-- Ignoring the either function declarations or structure declarations sniff for the main plugin file. This probably isn't best practice and the function should probably be defined in a separate file, but the function is just an implementation of the class to get the plugin started. -->
<rule ref="Universal.Files.SeparateFunctionsFromOO.Mixed">
<exclude-pattern>*/pantheon-sessions.php</exclude-pattern>
</rule>
</ruleset>
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ This mu-plugin will load WP Native PHP Sessions before all other plugins, while
== Changelog ==

= 1.3.7-dev =
* Updates Pantheon WP Coding Standards to 2.0 [[#264](https://github.com/pantheon-systems/wp-native-php-sessions/pull/264)]

= 1.3.6 (June 1, 2023) =
* Fixes PHP 8.2 deprecated dynamic property error [[#251](https://github.com/pantheon-systems/wp-native-php-sessions/pull/251)] (props @miguelaxcar)
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ function _manually_load_plugin() {
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );

require $_tests_dir . '/includes/bootstrap.php';

2 changes: 0 additions & 2 deletions tests/phpunit/test-init-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ public function test_database_created() {
$columns
);
}

}

3 changes: 1 addition & 2 deletions tests/phpunit/test-sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package WPNPS
*/

use \Pantheon_Sessions\Session;
use Pantheon_Sessions\Session;

/**
* Tests plugin interactions with sessions.
Expand Down Expand Up @@ -182,5 +182,4 @@ public function tearDown(): void {
$results = $wpdb->query( "DELETE FROM {$wpdb->pantheon_sessions}" );
parent::tearDown();
}

}

0 comments on commit 49e3b28

Please sign in to comment.