mirror of
https://github.com/mrclay/minify.git
synced 2025-08-19 12:21:20 +02:00
Apply php-cs-fixer fixers
- braces - function_declaration - lowercase_keywords - method_argument_space - no_spaces_inside_parenthesis - no_trailing_whitespace - no_trailing_whitespace_in_comment - single_blank_line_at_eof
This commit is contained in:
@@ -10,7 +10,8 @@ namespace Minify\StaticService;
|
||||
* @param string $type "css" or "js"
|
||||
* @return string
|
||||
*/
|
||||
function build_uri($static_uri, $query, $type) {
|
||||
function build_uri($static_uri, $query, $type)
|
||||
{
|
||||
$static_uri = rtrim($static_uri, '/');
|
||||
$query = ltrim($query, '?');
|
||||
|
||||
@@ -30,7 +31,8 @@ function build_uri($static_uri, $query, $type) {
|
||||
* @param bool $auto_create Automatically create the directory if missing?
|
||||
* @return null|string null if missing or can't create
|
||||
*/
|
||||
function get_cache_time($auto_create = true) {
|
||||
function get_cache_time($auto_create = true)
|
||||
{
|
||||
foreach (scandir(__DIR__) as $entry) {
|
||||
if (ctype_digit($entry)) {
|
||||
return $entry;
|
||||
@@ -50,14 +52,16 @@ function get_cache_time($auto_create = true) {
|
||||
return $time;
|
||||
}
|
||||
|
||||
function flush_cache() {
|
||||
function flush_cache()
|
||||
{
|
||||
$time = get_cache_time(false);
|
||||
if ($time) {
|
||||
remove_tree(__DIR__ . "/$time");
|
||||
}
|
||||
}
|
||||
|
||||
function remove_tree($dir) {
|
||||
function remove_tree($dir)
|
||||
{
|
||||
$files = array_diff(scandir($dir), array('.', '..'));
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
Reference in New Issue
Block a user