1
0
Fork 0
mirror of https://github.com/mlocati/docker-php-extension-installer synced 2025-05-09 00:22:40 +00:00

Lint PHP files

This commit is contained in:
Michele Locati 2019-12-27 14:56:03 +01:00
parent 9159b0aac5
commit d159643f2b
No known key found for this signature in database
GPG key ID: 98B7CE2E7234E28B
8 changed files with 437 additions and 39 deletions

View file

@ -2,9 +2,9 @@
$rc = 0;
$numTestedExtensions = 0;
$nameMap = array(
$nameMap = [
'opcache' => 'Zend OPcache',
);
];
$testsDir = __DIR__ . '/tests';
function runTest($testFile)
{
@ -25,12 +25,12 @@ for ($index = 1, $count = isset($argv) ? count($argv) : 0; $index < $count; $ind
if (!extension_loaded($extension)) {
fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension));
} else {
$testFile = "${testsDir}/${extension}.php";
$testFile = "{$testsDir}/{$extension}.php";
if (is_file($testFile)) {
try {
if (runTest($testFile) === true) {
fprintf(STDOUT, sprintf("Extension tested successfully: %s\n", $extension));
$rcThis = 0;
$rcThis = 0;
} else {
fprintf(STDERR, sprintf("Extension test failed: %s\n", $extension));
}