Skip to content

Commit

Permalink
Drop PHP 5.6 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Jul 19, 2023
1 parent 5086b08 commit 5c9c5c4
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions .tests/php/integration/AMainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AMainTest extends HCaptchaWPTestCase {
*
* @throws ReflectionException ReflectionException.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
$hcaptcha_wordpress_plugin = hcaptcha();

$loaded_classes = $this->get_protected_property( $hcaptcha_wordpress_plugin, 'loaded_classes' );
Expand Down Expand Up @@ -676,7 +676,7 @@ static function ( $language ) use ( $filtered_language ) {
* @throws ReflectionException ReflectionException.
* @noinspection BadExpressionStatementJS
*/
public function test_print_footer_scripts( $compat, $language, $custom_themes, $expected_script_src ): void {
public function test_print_footer_scripts( $compat, $language, $custom_themes, $expected_script_src ) {
$hcaptcha_wordpress_plugin = hcaptcha();

$hcaptcha_wordpress_plugin->form_shown = true;
Expand Down Expand Up @@ -867,7 +867,7 @@ public function dp_test_print_footer_scripts() {
/**
* Test print_footer_scripts() in admin.
*/
public function test_print_footer_scripts_in_admin(): void {
public function test_print_footer_scripts_in_admin() {
set_current_screen( 'edit-post' );

self::assertFalse( wp_script_is( 'hcaptcha' ) );
Expand All @@ -885,7 +885,7 @@ public function test_print_footer_scripts_in_admin(): void {
/**
* Test print_footer_scripts() when form NOT shown.
*/
public function test_print_footer_scripts_when_form_NOT_shown(): void {
public function test_print_footer_scripts_when_form_NOT_shown() {
self::assertFalse( wp_script_is( 'hcaptcha' ) );

ob_start();
Expand All @@ -906,7 +906,7 @@ public function test_print_footer_scripts_when_form_NOT_shown(): void {
* @dataProvider dp_test_load_modules
* @throws ReflectionException ReflectionException.
*/
public function test_load_modules( $module ): void {
public function test_load_modules( $module ) {
list( $option_name, $option_value ) = $module[0];

update_option(
Expand Down Expand Up @@ -1307,7 +1307,7 @@ static function ( &$value ) {
/**
* Test load_textdomain().
*/
public function test_load_textdomain(): void {
public function test_load_textdomain() {
$subject = new Main();
$subject->init_hooks();

Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/AutoVerify/AutoVerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AutoVerifyTest extends HCaptchaWPTestCase {
/**
* Tear down test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
unset( $_SERVER['REQUEST_METHOD'], $GLOBALS['current_screen'] );
delete_transient( AutoVerify::TRANSIENT );

Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/BBPress/NewTopicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NewTopicTest extends HCaptchaPluginWPTestCase {
*
* @noinspection PhpUndefinedFunctionInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:ignore WordPress.Security.NonceVerification.Missing
unset( $_POST );
bbpress()->errors = new WP_Error();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/BBPress/ReplyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ReplyTest extends HCaptchaPluginWPTestCase {
*
* @noinspection PhpUndefinedFunctionInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:ignore WordPress.Security.NonceVerification.Missing
unset( $_POST );
bbpress()->errors = new WP_Error();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/BuddyPress/CreateGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CreateGroupTest extends HCaptchaPluginWPTestCase {
/**
* Tear down the test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
global $bp;

unset( $bp->signup );
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/BuddyPress/RegisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RegisterTest extends HCaptchaPluginWPTestCase {
/**
* Tear down the test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
global $bp;

unset( $bp->signup );
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/CF7/CF7Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CF7Test extends HCaptchaPluginWPTestCase {
/**
* Tear down the test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
hcaptcha()->form_shown = false;

wp_deregister_script( 'hcaptcha-script' );
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/Divi/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ContactTest extends HCaptchaWPTestCase {
* @noinspection PhpLanguageLevelInspection
* @noinspection PhpUndefinedClassInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:disable WordPress.Security.NonceVerification.Missing
unset(
$_POST[ $this->cf_nonce_field ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HCaptchaHandlerTest extends HCaptchaWPTestCase {
* @noinspection PhpLanguageLevelInspection
* @noinspection PhpUndefinedClassInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
wp_dequeue_script( 'hcaptcha' );
wp_deregister_script( 'hcaptcha' );

Expand Down
4 changes: 2 additions & 2 deletions .tests/php/integration/HCaptchaPluginWPTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class HCaptchaPluginWPTestCase extends HCaptchaWPTestCase {
/**
* Teardown after class.
*/
public static function tearDownAfterClass(): void {
public static function tearDownAfterClass(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
deactivate_plugins( static::$plugin );

parent::tearDownAfterClass();
Expand All @@ -50,7 +50,7 @@ public static function tearDownAfterClass(): void {
/**
* Setup test.
*/
public function setUp(): void {
public function setUp(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
$plugins_requiring_php = [
'7.2' => [ 'woocommerce/woocommerce.php' ],
'7.1' => [ 'ninja-forms/ninja-forms.php' ],
Expand Down
4 changes: 2 additions & 2 deletions .tests/php/integration/HCaptchaWPTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HCaptchaWPTestCase extends WPTestCase {
/**
* Setup test
*/
public function setUp(): void {
public function setUp(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
FunctionMocker::setUp();
parent::setUp();

Expand All @@ -38,7 +38,7 @@ public function setUp(): void {
/**
* End test
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:ignore WordPress.Security.NonceVerification.Missing
unset( $_POST, $_SERVER['REQUEST_URI'], $_SERVER['HTTP_CLIENT_IP'] );

Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/Includes/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FunctionsTest extends HCaptchaWPTestCase {
/**
* Tear down test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
hcaptcha()->form_shown = false;

parent::tearDown();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/Includes/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RequestTest extends HCaptchaWPTestCase {
* @noinspection PhpLanguageLevelInspection
* @noinspection PhpUndefinedClassInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
unset(
$_SERVER['HTTP_CF_CONNECTING_IP'],
$_SERVER['HTTP_CLIENT_IP'],
Expand Down
4 changes: 2 additions & 2 deletions .tests/php/integration/MainPluginFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MainPluginFileTest extends HCaptchaWPTestCase {
*
* @noinspection HttpUrlsUsage
*/
public function test_main_file_content(): void {
public function test_main_file_content() {
$expected = [
'version' => HCAPTCHA_VERSION,
];
Expand Down Expand Up @@ -69,7 +69,7 @@ public function test_main_file_content(): void {
/**
* Test that readme.txt contains proper stable tag.
*/
public function test_readme_txt(): void {
public function test_readme_txt() {
$expected = [
'stable_tag' => HCAPTCHA_VERSION,
];
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/UM/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LoginTest extends HCaptchaPluginWPTestCase {
* @noinspection PhpLanguageLevelInspection
* @noinspection PhpUndefinedClassInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
UM()->form()->errors = null;

parent::tearDown();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/UM/LostPasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LostPasswordTest extends HCaptchaPluginWPTestCase {
* @noinspection PhpLanguageLevelInspection
* @noinspection PhpUndefinedClassInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
UM()->form()->errors = null;

parent::tearDown();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/UM/RegisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class RegisterTest extends HCaptchaPluginWPTestCase {
* @noinspection PhpLanguageLevelInspection
* @noinspection PhpUndefinedClassInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
UM()->form()->errors = null;

parent::tearDown();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/WC/CheckoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CheckoutTest extends HCaptchaPluginWPTestCase {
/**
* Test tear down.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
if ( function_exists( 'wc_clear_notices' ) ) {
wc_clear_notices();
}
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/WC/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LoginTest extends HCaptchaWPTestCase {
* @noinspection PhpUndefinedClassInspection
* @throws ReflectionException ReflectionException.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
$this->set_protected_property( hcaptcha(), 'loaded_classes', [] );

parent::tearDown();
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/WP/CommentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CommentTest extends HCaptchaWPTestCase {
/**
* Tear down test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:ignore WordPress.Security.NonceVerification.Missing
unset( $GLOBALS['current_screen'] );

Expand Down
2 changes: 1 addition & 1 deletion .tests/php/integration/WP/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LoginTest extends HCaptchaWPTestCase {
/**
* Tear down test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
unset( $_REQUEST['_wp_http_referer'] );

Expand Down
4 changes: 2 additions & 2 deletions .tests/php/integration/WPForo/NewTopicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NewTopicTest extends HCaptchaPluginWPTestCase {
*
* @noinspection PhpUndefinedFunctionInspection
*/
public function setUp(): void {
public function setUp(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
set_current_screen( 'edit-post' );

parent::setUp();
Expand All @@ -49,7 +49,7 @@ public function setUp(): void {
*
* @noinspection PhpUndefinedFunctionInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
WPF()->session_token = '';
WPF()->notice->clear();
WPF()->session_token = '';
Expand Down
4 changes: 2 additions & 2 deletions .tests/php/integration/WPForo/ReplyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ReplyTest extends HCaptchaPluginWPTestCase {
*
* @noinspection PhpUndefinedFunctionInspection
*/
public function setUp(): void {
public function setUp(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
set_current_screen( 'edit-post' );

parent::setUp();
Expand All @@ -48,7 +48,7 @@ public function setUp(): void {
*
* @noinspection PhpUndefinedFunctionInspection
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
WPF()->session_token = '';
WPF()->notice->clear();
WPF()->session_token = '';
Expand Down
2 changes: 1 addition & 1 deletion .tests/php/unit/AutoVerify/AutoVerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AutoVerifyTest extends HCaptchaTestCase {
/**
* Tear down test.
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
unset( $_GET['rest_route'] );

Expand Down
4 changes: 2 additions & 2 deletions .tests/php/unit/HCaptchaTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class HCaptchaTestCase extends TestCase {
/**
* Setup test
*/
public function setUp(): void {
public function setUp(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
FunctionMocker::setUp();
parent::setUp();
WP_Mock::setUp();
Expand All @@ -39,7 +39,7 @@ public function setUp(): void {
/**
* End test
*/
public function tearDown(): void {
public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
WP_Mock::tearDown();
Mockery::close();
parent::tearDown();
Expand Down

0 comments on commit 5c9c5c4

Please sign in to comment.