Ensure phpstan exit code is passed along to the shell window and address some pr comments
MAILPOET-6318
This commit is contained in:
committed by
Jan Lysý
parent
b1cc53ec5b
commit
ccc3f9ab28
@@ -4,8 +4,8 @@ $config = [];
|
||||
$phpVersion = (int)getenv('ANALYSIS_PHP_VERSION') ?: PHP_VERSION_ID;
|
||||
$config['parameters']['phpVersion'] = $phpVersion;
|
||||
|
||||
// Load PHP 8 specific config
|
||||
if ($phpVersion >= 80000) {
|
||||
// Load PHP 8.2 specific config
|
||||
if ($phpVersion >= 80200) {
|
||||
$config['includes'][] = 'email-editor-php-8-config.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
|
||||
|
@@ -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 );
|
||||
|
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user