Bump scssphp/scssphp from 1.0.3 to 1.4.0

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2020-12-30 14:46:51 +01:00 коммит произвёл Morris Jobke
Родитель 8b656e321b
Коммит c3cb288268
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: FE03C3A163FEDE68
3 изменённых файлов: 20 добавлений и 16 удалений

@ -1 +1 @@
Subproject commit 09596e43fba86a3643879595a8fb6fece4af6a78 Subproject commit 7bbfe82c51aa168683ae6e47e3da7d3e587f6ca4

Просмотреть файл

@ -47,8 +47,7 @@ use OCP\IMemcache;
use OCP\IURLGenerator; use OCP\IURLGenerator;
use ScssPhp\ScssPhp\Compiler; use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\Exception\ParserException; use ScssPhp\ScssPhp\Exception\ParserException;
use ScssPhp\ScssPhp\Formatter\Crunched; use ScssPhp\ScssPhp\OutputStyle;
use ScssPhp\ScssPhp\Formatter\Expanded;
class SCSSCacher { class SCSSCacher {
@ -313,14 +312,12 @@ class SCSSCacher {
]); ]);
// Continue after throw // Continue after throw
$scss->setIgnoreErrors(true);
if ($this->config->getSystemValue('debug')) { if ($this->config->getSystemValue('debug')) {
// Debug mode // Debug mode
$scss->setFormatter(Expanded::class); $scss->setOutputStyle(OutputStyle::EXPANDED);
$scss->setLineNumberStyle(Compiler::LINE_COMMENTS);
} else { } else {
// Compression // Compression
$scss->setFormatter(Crunched::class); $scss->setOutputStyle(OutputStyle::COMPRESSED);
} }
try { try {
@ -391,8 +388,8 @@ class SCSSCacher {
$this->injectedVariables = null; $this->injectedVariables = null;
// do not clear locks // do not clear locks
$this->cacheFactory->createDistributed('SCSS-deps-')->clear(); $this->depsCache->clear();
$this->cacheFactory->createDistributed('SCSS-cached-')->clear(); $this->isCachedCache->clear();
$appDirectory = $this->appData->getDirectoryListing(); $appDirectory = $this->appData->getDirectoryListing();
foreach ($appDirectory as $folder) { foreach ($appDirectory as $folder) {

Просмотреть файл

@ -56,6 +56,8 @@ class SCSSCacherTest extends \Test\TestCase {
/** @var ICache|\PHPUnit\Framework\MockObject\MockObject */ /** @var ICache|\PHPUnit\Framework\MockObject\MockObject */
protected $depsCache; protected $depsCache;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */ /** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $isCachedCache;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $cacheFactory; protected $cacheFactory;
/** @var IconsCacher|\PHPUnit\Framework\MockObject\MockObject */ /** @var IconsCacher|\PHPUnit\Framework\MockObject\MockObject */
protected $iconsCacher; protected $iconsCacher;
@ -88,9 +90,15 @@ class SCSSCacherTest extends \Test\TestCase {
})); }));
$this->cacheFactory = $this->createMock(ICacheFactory::class); $this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->depsCache = $this->createMock(ICache::class); $this->depsCache = $this->createMock(ICache::class);
$this->cacheFactory->expects($this->at(0)) $this->isCachedCache = $this->createMock(ICache::class);
$this->cacheFactory
->method('createDistributed') ->method('createDistributed')
->willReturn($this->depsCache); ->withConsecutive()
->willReturnOnConsecutiveCalls(
$this->depsCache,
$this->isCachedCache,
$this->createMock(ICache::class)
);
$this->themingDefaults = $this->createMock(ThemingDefaults::class); $this->themingDefaults = $this->createMock(ThemingDefaults::class);
$this->themingDefaults->expects($this->any())->method('getScssVariables')->willReturn([]); $this->themingDefaults->expects($this->any())->method('getScssVariables')->willReturn([]);
@ -537,11 +545,10 @@ class SCSSCacherTest extends \Test\TestCase {
->method('getDirectoryListing') ->method('getDirectoryListing')
->willReturn([$file]); ->willReturn([$file]);
$cache = $this->createMock(ICache::class); $this->depsCache->expects($this->once())
$this->cacheFactory->expects($this->exactly(2)) ->method('clear')
->method('createDistributed') ->with('');
->willReturn($cache); $this->isCachedCache->expects($this->once())
$cache->expects($this->exactly(2))
->method('clear') ->method('clear')
->with(''); ->with('');
$this->appData->expects($this->once()) $this->appData->expects($this->once())