1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-29 00:29:59 +02:00

Apply php-cs-fixer new rules

This commit is contained in:
Elan Ruusamäe
2019-12-11 17:00:16 +02:00
parent f9d3d54e62
commit eff278193b
88 changed files with 1225 additions and 1213 deletions

View File

@@ -13,11 +13,13 @@ if (!$enabled) {
die('Set $enabled to true to see server info.');
}
function assertTrue($test, $message) {
function assertTrue($test, $message)
{
if (!$test) {
echo "Warning: $message\n";
echo "Warning: ${message}\n";
}
return (bool)$test;
return (bool) $test;
}
header('Content-Type: text/plain');
@@ -26,8 +28,8 @@ $file = __FILE__;
$tmp = sys_get_temp_dir();
echo <<<EOD
Cache directory : $tmp
__FILE__ : $file
Cache directory : ${tmp}
__FILE__ : ${file}
SCRIPT_FILENAME : {$_SERVER['SCRIPT_FILENAME']}
DOCUMENT_ROOT : {$_SERVER['DOCUMENT_ROOT']}
SCRIPT_NAME : {$_SERVER['SCRIPT_NAME']}
@@ -37,21 +39,21 @@ REQUEST_URI : {$_SERVER['REQUEST_URI']}
EOD;
$noSlash = assertTrue(
0 === preg_match('@[\\\\/]$@', $_SERVER['DOCUMENT_ROOT']),
preg_match('@[\\\\/]$@', $_SERVER['DOCUMENT_ROOT']) === 0,
'DOCUMENT_ROOT ends in trailing slash'
);
$isRealPath = assertTrue(
false !== realpath($_SERVER['DOCUMENT_ROOT']),
realpath($_SERVER['DOCUMENT_ROOT']) !== false,
'DOCUMENT_ROOT fails realpath()'
);
$containsThisFile = assertTrue(
0 === strpos(realpath(__FILE__), realpath($_SERVER['DOCUMENT_ROOT'])),
strpos(realpath(__FILE__), realpath($_SERVER['DOCUMENT_ROOT'])) === 0,
'DOCUMENT_ROOT contains this test file'
);
if (! $noSlash || ! $isRealPath || ! $containsThisFile) {
if (!$noSlash || !$isRealPath || !$containsThisFile) {
echo "If you cannot modify DOCUMENT_ROOT, consider setting \$min_documentRoot in config.php\n";
}
@@ -62,7 +64,7 @@ assertTrue(
assertTrue(
realpath(__FILE__) === realpath($_SERVER['DOCUMENT_ROOT'] . '/min/server-info.php'),
"/min/ is not directly inside DOCUMENT_ROOT."
'/min/ is not directly inside DOCUMENT_ROOT.'
);
// TODO: rework this
@@ -150,4 +152,4 @@ if (! $passed) {
. " AddOutputFilterByType.";
}
}
*/
*/