Skip to content

Commit

Permalink
See if this works better
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Nov 30, 2024
1 parent f702c47 commit 605e5a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
*/
function checkRequirements()
{
// TODO: revise when addressing #184.
$exitCode = 8;

// Check the PHP version.
// Note: the PHP_VERSION_ID constant is only available as of PHP 5.2.7, but considering the
// previous PHPCS major (3.x) already has a PHP 5.4 minimum requirement, I consider that acceptable. [JRF]
if (PHP_VERSION_ID < 70200) {
$error = 'ERROR: PHP_CodeSniffer requires PHP version 7.2.0 or greater.'.PHP_EOL;
exit($error);
echo 'ERROR: PHP_CodeSniffer requires PHP version 7.2.0 or greater.'.PHP_EOL;
exit($exitCode);
}

$requiredExtensions = array(
Expand Down Expand Up @@ -63,7 +66,7 @@ function checkRequirements()
}

$error = 'ERROR: PHP_CodeSniffer requires the %s extensions to be enabled. Please enable %s.'.PHP_EOL;
$error = sprintf($error, $required, $missing);
exit($error);
printf($error, $required, $missing);
exit($exitCode);
}
}

0 comments on commit 605e5a9

Please sign in to comment.