1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-18 03:41:35 +02:00

Test fixes

This commit is contained in:
Steve Clay
2024-01-04 00:19:32 -05:00
parent aa3721156e
commit bc1ffdc5fc
17 changed files with 85 additions and 69 deletions

View File

@@ -122,7 +122,7 @@ class App extends Container
$type = $that->typeOf($ctrl);
throw new RuntimeException('$min_factories["controller"] callable must return an implementation'
." of Minify_CacheInterface. Returned $type");
. " of Minify_CacheInterface. Returned $type");
};
$this->docRoot = function (App $app) {
@@ -188,7 +188,7 @@ class App extends Container
$type = $that->typeOf($value);
throw new RuntimeException('If set, $min_errorLogger must be a PSR-3 logger or a Monolog handler.'
." Given $type");
. " Given $type");
};
$this->minify = function (App $app) use ($that) {
@@ -205,7 +205,7 @@ class App extends Container
$type = $that->typeOf($minify);
throw new RuntimeException('$min_factories["minify"] callable must return a Minify object.'
." Returned $type");
. " Returned $type");
};
$this->serveOptions = function (App $app) {
@@ -232,7 +232,7 @@ class App extends Container
}
// check for URI versioning
if ($env->get('v') !== null || preg_match('/&\\d/', $app->env->server('QUERY_STRING'))) {
if ($env->get('v') !== null || preg_match('/&\\d/', $app->env->server('QUERY_STRING') ?? '')) {
$ret['maxAge'] = 31536000;
}

View File

@@ -188,7 +188,7 @@ class Minify_ClosureCompiler
*/
protected function checkTempdir($tempDir)
{
if (!is_dir($tempDir)) {
if ($tempDir === null || !is_dir($tempDir)) {
throw new Minify_ClosureCompiler_Exception('$tempDir(' . $tempDir . ') is not a valid direcotry.');
}
if (!is_writable($tempDir)) {

View File

@@ -156,8 +156,8 @@ class Minify_ScssCssSource extends Minify_Source
$elapsed = round((microtime(true) - $start), 4);
$v = Version::VERSION;
$ts = date('r', $start);
$css = "/* compiled by scssphp $v on $ts (${elapsed}s) */\n\n" . $css;
$ts = date('r', (int) $start);
$css = "/* compiled by scssphp $v on $ts ({$elapsed}s) */\n\n" . $css;
$imports = $scss->getParsedFiles();