diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index ef29d4aad..13708693a 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -735,8 +735,10 @@ EXT_CHECKS; \$issues = array(); ${requiredPhp}${requiredExtensions} if (\$issues) { - echo 'Composer detected issues in your platform:' . "\\n\\n" . implode("\\n", \$issues) . "\\n\\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', \$issues), + E_USER_ERROR + ); } PLATFORM_CHECK; diff --git a/tests/Composer/Test/Autoload/Fixtures/platform/no_extensions_required.php b/tests/Composer/Test/Autoload/Fixtures/platform/no_extensions_required.php index de185cfca..188c0fae4 100644 --- a/tests/Composer/Test/Autoload/Fixtures/platform/no_extensions_required.php +++ b/tests/Composer/Test/Autoload/Fixtures/platform/no_extensions_required.php @@ -9,6 +9,8 @@ if (!(PHP_VERSION_ID >= 70200)) { } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues) . "\n\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', $issues), + E_USER_ERROR + ); } diff --git a/tests/Composer/Test/Autoload/Fixtures/platform/no_php_required.php b/tests/Composer/Test/Autoload/Fixtures/platform/no_php_required.php index c0fcf897f..ee7d8cacd 100644 --- a/tests/Composer/Test/Autoload/Fixtures/platform/no_php_required.php +++ b/tests/Composer/Test/Autoload/Fixtures/platform/no_php_required.php @@ -13,6 +13,8 @@ if ($missingExtensions) { } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues) . "\n\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', $issues), + E_USER_ERROR + ); } diff --git a/tests/Composer/Test/Autoload/Fixtures/platform/no_php_upper_bound.php b/tests/Composer/Test/Autoload/Fixtures/platform/no_php_upper_bound.php index de185cfca..188c0fae4 100644 --- a/tests/Composer/Test/Autoload/Fixtures/platform/no_php_upper_bound.php +++ b/tests/Composer/Test/Autoload/Fixtures/platform/no_php_upper_bound.php @@ -9,6 +9,8 @@ if (!(PHP_VERSION_ID >= 70200)) { } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues) . "\n\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', $issues), + E_USER_ERROR + ); } diff --git a/tests/Composer/Test/Autoload/Fixtures/platform/replaced_provided_exts.php b/tests/Composer/Test/Autoload/Fixtures/platform/replaced_provided_exts.php index 5d94c0d22..c530dc59d 100644 --- a/tests/Composer/Test/Autoload/Fixtures/platform/replaced_provided_exts.php +++ b/tests/Composer/Test/Autoload/Fixtures/platform/replaced_provided_exts.php @@ -12,6 +12,8 @@ if ($missingExtensions) { } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues) . "\n\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', $issues), + E_USER_ERROR + ); } diff --git a/tests/Composer/Test/Autoload/Fixtures/platform/specific_php_release.php b/tests/Composer/Test/Autoload/Fixtures/platform/specific_php_release.php index ac1d729f9..5a2d6dfed 100644 --- a/tests/Composer/Test/Autoload/Fixtures/platform/specific_php_release.php +++ b/tests/Composer/Test/Autoload/Fixtures/platform/specific_php_release.php @@ -9,6 +9,8 @@ if (!(PHP_VERSION_ID >= 70208)) { } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues) . "\n\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', $issues), + E_USER_ERROR + ); } diff --git a/tests/Composer/Test/Autoload/Fixtures/platform/typical.php b/tests/Composer/Test/Autoload/Fixtures/platform/typical.php index 3f4e1ac78..ba33b7aeb 100644 --- a/tests/Composer/Test/Autoload/Fixtures/platform/typical.php +++ b/tests/Composer/Test/Autoload/Fixtures/platform/typical.php @@ -17,6 +17,8 @@ if ($missingExtensions) { } if ($issues) { - echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues) . "\n\n"; - exit(104); + trigger_error( + 'Composer detected issues in your platform: ' . implode(', ', $issues), + E_USER_ERROR + ); }