1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Add return types to closures (#9)

This commit is contained in:
Alexander Schranz 2022-02-21 13:37:49 +01:00 committed by GitHub
parent 7b1fc4b2c8
commit 1321bfca36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 171 additions and 150 deletions

View file

@ -94,14 +94,14 @@ class Application extends BaseApplication
if (!$shutdownRegistered) {
if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
pcntl_async_signals(true);
pcntl_signal(SIGINT, function ($sig) {
pcntl_signal(SIGINT, function ($sig): void {
exit(130);
});
}
$shutdownRegistered = true;
register_shutdown_function(function () {
register_shutdown_function(function (): void {
$lastError = error_get_last();
if ($lastError && $lastError['message'] &&
@ -291,7 +291,7 @@ class Application extends BaseApplication
}
// Check system temp folder for usability as it can cause weird runtime issues otherwise
Silencer::call(function () use ($io) {
Silencer::call(function () use ($io): void {
$tempfile = sys_get_temp_dir() . '/temp-' . md5(microtime());
if (!(file_put_contents($tempfile, __FILE__) && (file_get_contents($tempfile) == __FILE__) && unlink($tempfile) && !file_exists($tempfile))) {
$io->writeError(sprintf('<error>PHP temp directory (%s) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini</error>', sys_get_temp_dir()));