diff --git a/mailpoet/tasks/phpstan/email-editor-phpstan-custom.php b/mailpoet/tasks/phpstan/email-editor-phpstan-custom.php index f98fe78a61..4acad752b5 100644 --- a/mailpoet/tasks/phpstan/email-editor-phpstan-custom.php +++ b/mailpoet/tasks/phpstan/email-editor-phpstan-custom.php @@ -4,9 +4,9 @@ $config = []; $phpVersion = (int)getenv('ANALYSIS_PHP_VERSION') ?: PHP_VERSION_ID; $config['parameters']['phpVersion'] = $phpVersion; -// Load PHP 8 specific config -if ($phpVersion >= 80000) { - $config['includes'][] = 'email-editor-php-8-config.neon'; +// Load PHP 8.2 specific config +if ($phpVersion >= 80200) { + $config['includes'][] = 'email-editor-php-8-config.neon'; } return $config; diff --git a/mailpoet/tasks/phpstan/email-editor-phpstan.neon b/mailpoet/tasks/phpstan/email-editor-phpstan.neon index 6d42ffc2b0..700bf3e98c 100644 --- a/mailpoet/tasks/phpstan/email-editor-phpstan.neon +++ b/mailpoet/tasks/phpstan/email-editor-phpstan.neon @@ -4,8 +4,8 @@ parameters: bootstrapFiles: - ../../vendor/autoload.php - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php - - ../../vendor/codeception/codeception/autoload.php - - ../../vendor/codeception/verify/src/Codeception/Verify/Verify.php + - ../../../tests_env/vendor/codeception/codeception/autoload.php + - ../../../tests_env/vendor/codeception/verify/src/Codeception/Verify/Verify.php scanDirectories: - ../../../packages/php/email-editor/tests/_support - ../../../packages/php/email-editor/tests/integration diff --git a/packages/php/email-editor/tasks/run-phpstan.php b/packages/php/email-editor/tasks/run-phpstan.php index d032c2b3be..7a40e5ad30 100644 --- a/packages/php/email-editor/tasks/run-phpstan.php +++ b/packages/php/email-editor/tasks/run-phpstan.php @@ -47,4 +47,6 @@ $all_commands = implode( ' ', $commands ); echo "[run-phpstan] Running command: $all_commands \n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This file is not used within WordPress environment. -passthru( $all_commands ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_passthru -- This file is not used within WordPress environment. +$result_code = 0; +passthru( $all_commands, $result_code ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_passthru -- This file is not used within WordPress environment. +exit( (int) $result_code ); diff --git a/packages/php/email-editor/tests/unit/Container_Test.php b/packages/php/email-editor/tests/unit/Container_Test.php index 294ec54778..572c150612 100644 --- a/packages/php/email-editor/tests/unit/Container_Test.php +++ b/packages/php/email-editor/tests/unit/Container_Test.php @@ -11,9 +11,9 @@ namespace MailPoet\EmailEditor; use Exception; use PHPUnit\Framework\TestCase; -class Simple_Service {} // phpcs:ignore +class Simple_Service {} // phpcs:ignore -- Ignore Only one object structure is allowed in a file. -class Singleton_Service {} // phpcs:ignore +class Singleton_Service {} // phpcs:ignore -- Ignore Only one object structure is allowed in a file. /** * Unit test for Container class. @@ -68,8 +68,8 @@ class Container_Test extends TestCase { // phpcs:ignore // Attempt to get a non-existing service should throw an exception. $this->expectException( Exception::class ); - $this->expectExceptionMessage( 'Service not found: non_existing_service' ); + $this->expectExceptionMessage( 'Service not found: MailPoet\EmailEditor\Simple_Service' ); - $container->get( 'non_existing_service' ); // @phpstan-ignore-line + $container->get( Simple_Service::class ); } }