Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
Expand Down
4 changes: 2 additions & 2 deletions src/AssetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ protected function resolveExtends(): void
if (!$parentConfig) {
return $config;
}
$config['files'] = array_merge($parentConfig['files'], $config['files']);
$config['filters'] = array_merge($parentConfig['filters'], $config['filters']);
$config['files'] = array_unique(array_merge($parentConfig['files'], $config['files']));
$config['filters'] = array_unique(array_merge($parentConfig['filters'], $config['filters']));
$config['theme'] = $parentConfig['theme'] || $config['theme'];

return $config;
Expand Down
2 changes: 1 addition & 1 deletion src/AssetProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function run(?string $input = null): string
$descriptorSpec,
$pipes,
null,
$this->_env
$this->_env,
);
if (is_resource($process)) {
fwrite($pipes[0], $input);
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/BuildTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function addArguments(): void
'description' => 'The config file to use.',
'required' => true,
],
]
],
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cli/ClearTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function addArguments(): void
'description' => 'The config file to use.',
'required' => true,
],
]
],
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function cachedCompiler(string $outputDir = '', bool $debug = false): Cac
{
return new CachedCompiler(
$this->cacher($outputDir),
$this->compiler($debug)
$this->compiler($debug),
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Filter/ClosureCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function _query(string $content, array $args = []): string|bool
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_HEADER => 0,
CURLOPT_FOLLOWLOCATION => 0,
]
],
);

$output = curl_exec($ch);
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/CssDependencyTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected function _prependPrefixToFilename(string $name): string
return str_replace(
$ds . $filename,
$ds . $this->optionalDependencyPrefix . $filename,
$name
$name,
);
}
}
2 changes: 1 addition & 1 deletion src/Filter/FilterRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function collection(AssetTarget $target): FilterCollection
[
'target' => $target->name(),
'paths' => $target->paths(),
]
],
);
$filters[] = $copy;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/Hogan.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function _generateScript(string $file, string $filename, string $input
json_encode($input),
json_encode($config),
$id,
$filepath
$filepath,
);
file_put_contents($file, $contents);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/ImportInline.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function input(string $filename, string $content): string
return preg_replace_callback(
$this->_pattern,
[$this, '_replace'],
$content
$content,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Filter/JSqueezeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function output(string $target, string $content): string
$content,
$this->_settings['singleLine'],
$this->_settings['keepImportantComments'],
$this->_settings['specialVarRx']
$this->_settings['specialVarRx'],
);
}
}
2 changes: 1 addition & 1 deletion src/Filter/LessCss.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function _generateScript(string $file, string $content): void
JS;
file_put_contents(
$file,
sprintf($text, str_replace('\/*', '', json_encode($this->_settings['paths'])), json_encode($content))
sprintf($text, str_replace('\/*', '', json_encode($this->_settings['paths'])), json_encode($content)),
);
}
}
2 changes: 1 addition & 1 deletion src/Filter/LessDotPHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function input(string $filename, string $content): string
}
if (!class_exists('\Less_Parser')) {
throw new Exception(
'Cannot not load "\Less_Parser" class. Make sure https://github.com/oyejorge/less.php is installed.'
'Cannot not load "\Less_Parser" class. Make sure https://github.com/oyejorge/less.php is installed.',
);
}
$parser = new Less_Parser();
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/Sprockets.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function input(string $filename, string $content): string
return preg_replace_callback(
$this->_pattern,
[$this, '_replace'],
$content
$content,
);
}

Expand Down
12 changes: 6 additions & 6 deletions tests/TestCase/AssetConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function testLoadUpdatesModifiedTime()
$this->assertEquals(
filemtime($this->_themeConfig),
$config->modifiedTime(),
'Reflects last updated config file'
'Reflects last updated config file',
);
}

Expand Down Expand Up @@ -148,7 +148,7 @@ public function testAddTarget()
'testing.js',
[
'files' => ['one.js', 'two.js'],
]
],
);
$this->assertEquals(['one.js', 'two.js'], $this->config->files('testing.js'));
}
Expand All @@ -161,11 +161,11 @@ public function testAddTargetThemed()
'files' => ['one.js', 'two.js'],
'filters' => ['uglify'],
'theme' => true,
]
],
);
$this->assertEquals(
['one.js', 'two.js'],
$this->config->files('testing-two.js')
$this->config->files('testing-two.js'),
);
$this->assertTrue($this->config->isThemed('testing-two.js'));
}
Expand All @@ -176,14 +176,14 @@ public function testRequires()
'testing.js',
[
'files' => ['one.js', 'two.js'],
]
],
);
$this->config->addTarget(
'child.js',
[
'files' => ['one.js', 'two.js'],
'require' => 'base.js',
]
],
);
$this->assertEquals([], $this->config->requires('testing.js'));
$this->assertEquals(['base.js'], $this->config->requires('child.js'));
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Cli/BuildTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function setUp(): void

$config = AssetConfig::buildFromIniFile(
APP . 'config/integration.ini',
['WEBROOT' => TMP]
['WEBROOT' => TMP],
);
$this->task = new BuildTask($cli, $config);
$this->cli = $cli;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Cli/ClearTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function setUp(): void

$config = AssetConfig::buildFromIniFile(
APP . 'config/integration.ini',
['WEBROOT' => TMP]
['WEBROOT' => TMP],
);
$this->task = new ClearTask($cli, $config);
$this->cli = $cli;
Expand Down
24 changes: 12 additions & 12 deletions tests/TestCase/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public function testTargetCallbackProvider()

$this->assertEquals(
APP . 'js/classes/base_class.js',
$result[0]->path()
$result[0]->path(),
);
$this->assertEquals(
APP . 'js/classes/nested_class.js',
$result[1]->path()
$result[1]->path(),
);
}

Expand All @@ -109,19 +109,19 @@ public function testTargetCallbackProviderAssetOrdering()

$this->assertEquals(
APP . 'js/library_file.js',
$result[0]->path()
$result[0]->path(),
);
$this->assertEquals(
APP . 'js/classes/base_class.js',
$result[1]->path()
$result[1]->path(),
);
$this->assertEquals(
APP . 'js/classes/nested_class.js',
$result[2]->path()
$result[2]->path(),
);
$this->assertEquals(
APP . 'js/local_script.js',
$result[3]->path()
$result[3]->path(),
);
}

Expand Down Expand Up @@ -186,7 +186,7 @@ public function testTargetWithRequireIntegration()
$this->assertStringContainsString(
'//= require "local_script"',
$contents,
'Sprockets should not be applied to intermediate build files'
'Sprockets should not be applied to intermediate build files',
);
}

Expand All @@ -196,7 +196,7 @@ public function testAssetCollection()
$this->integrationFile,
[
'WEBROOT' => TMP,
]
],
);
$factory = new Factory($config);
$collection = $factory->assetCollection();
Expand Down Expand Up @@ -233,15 +233,15 @@ public function testAssetCreationWithAdditionalPath()
$this->assertCount(3, $files);
$this->assertEquals(
APP . 'js/base.js',
$files[0]->path()
$files[0]->path(),
);
$this->assertEquals(
APP . 'js/library_file.js',
$files[1]->path()
$files[1]->path(),
);
$this->assertEquals(
APP . 'js/classes/base_class.js',
$files[2]->path()
$files[2]->path(),
);
}

Expand All @@ -259,7 +259,7 @@ public function testAssetCollectionGlob()
$this->assertEquals(
[APP . 'js/', APP . 'js/classes/', APP . 'js/secondary/'],
$asset->paths(),
'Should have expanded paths'
'Should have expanded paths',
);

$files = $asset->files();
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Filter/LessCssTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
$this->filter->settings(
[
'paths' => [$this->_cssDir],
]
],
);
}

Expand Down
16 changes: 8 additions & 8 deletions tests/TestCase/Middleware/AssetMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function setUp(): void
$this->middleware = new AssetMiddleware(
$this->config,
sys_get_temp_dir() . DIRECTORY_SEPARATOR,
'/assets/'
'/assets/',
);
}

Expand All @@ -43,7 +43,7 @@ public function testInvokeIncorrectPrefix()
$request = ServerRequestFactory::fromGlobals(
[
'REQUEST_URI' => '/wrong/assets/path',
]
],
);
$response = new Response();
$next = function ($req, $res) {
Expand All @@ -58,7 +58,7 @@ public function testInvokeMissingAssetFile()
$request = ServerRequestFactory::fromGlobals(
[
'REQUEST_URI' => '/assets/nope.js',
]
],
);
$response = new Response();
$next = function ($req, $res) {
Expand All @@ -75,13 +75,13 @@ public function testInvokeFailedBuild()
'invalid.css',
[
'files' => [APP . 'invalid.css'],
]
],
);

$request = ServerRequestFactory::fromGlobals(
[
'REQUEST_URI' => '/assets/invalid.css',
]
],
);
$response = new Response();
$next = function ($req, $res) {
Expand All @@ -99,7 +99,7 @@ public function testInvokeCacheRead()
$request = ServerRequestFactory::fromGlobals(
[
'REQUEST_URI' => '/assets/all.css',
]
],
);
$response = new Response();
$next = function ($req, $res) {
Expand All @@ -119,7 +119,7 @@ public function testInvokeSuccessfulBuild()
$request = ServerRequestFactory::fromGlobals(
[
'REQUEST_URI' => '/assets/all.css',
]
],
);
$response = new Response();
$next = function ($req, $res) {
Expand Down Expand Up @@ -151,7 +151,7 @@ public function testBuildFileContentTypes($uri, $expected)
$request = ServerRequestFactory::fromGlobals(
[
'REQUEST_URI' => $uri,
]
],
);

$response = new Response();
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Output/AssetCacherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function setUp(): void
$this->files,
[],
[],
true
true,
);
$filter = $this->getMockBuilder('MiniAsset\Filter\FilterInterface')->getMock();
$filter->method('getDependencies')
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Output/CachedCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ protected function setUp(): void
[
$this->_testFiles . 'js' . DS,
$this->_testFiles . 'js' . DS . '*',
]
],
);
$this->config->paths(
'css',
null,
[
$this->_testFiles . 'css' . DS,
$this->_testFiles . 'css' . DS . '*',
]
],
);

if (file_exists(TMP . '/all.css')) {
Expand Down
Loading
Loading