Skip to content

Commit fc3262b

Browse files
authored
Merge pull request #83 from CakeDC/issue/81-2.x
Branch 2.x: 81 - Fix resolveExtends including parent assets many times if any plugin uses AssetCompress
2 parents 44fbadf + db48c01 commit fc3262b

24 files changed

+50
-50
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: echo "::set-output name=date::$(date +'%Y-%m')"
4343

4444
- name: Cache composer dependencies
45-
uses: actions/cache@v1
45+
uses: actions/cache@v4
4646
with:
4747
path: ${{ steps.composer-cache.outputs.dir }}
4848
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}

src/AssetConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ protected function resolveExtends(): void
255255
if (!$parentConfig) {
256256
return $config;
257257
}
258-
$config['files'] = array_merge($parentConfig['files'], $config['files']);
259-
$config['filters'] = array_merge($parentConfig['filters'], $config['filters']);
258+
$config['files'] = array_unique(array_merge($parentConfig['files'], $config['files']));
259+
$config['filters'] = array_unique(array_merge($parentConfig['filters'], $config['filters']));
260260
$config['theme'] = $parentConfig['theme'] || $config['theme'];
261261

262262
return $config;

src/AssetProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function run(?string $input = null): string
105105
$descriptorSpec,
106106
$pipes,
107107
null,
108-
$this->_env
108+
$this->_env,
109109
);
110110
if (is_resource($process)) {
111111
fwrite($pipes[0], $input);

src/Cli/BuildTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function addArguments(): void
6464
'description' => 'The config file to use.',
6565
'required' => true,
6666
],
67-
]
67+
],
6868
);
6969
}
7070

src/Cli/ClearTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function addArguments(): void
4949
'description' => 'The config file to use.',
5050
'required' => true,
5151
],
52-
]
52+
],
5353
);
5454
}
5555

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function cachedCompiler(string $outputDir = '', bool $debug = false): Cac
7777
{
7878
return new CachedCompiler(
7979
$this->cacher($outputDir),
80-
$this->compiler($debug)
80+
$this->compiler($debug),
8181
);
8282
}
8383

src/Filter/ClosureCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function _query(string $content, array $args = []): string|bool
136136
CURLOPT_RETURNTRANSFER => 1,
137137
CURLOPT_HEADER => 0,
138138
CURLOPT_FOLLOWLOCATION => 0,
139-
]
139+
],
140140
);
141141

142142
$output = curl_exec($ch);

src/Filter/CssDependencyTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected function _prependPrefixToFilename(string $name): string
147147
return str_replace(
148148
$ds . $filename,
149149
$ds . $this->optionalDependencyPrefix . $filename,
150-
$name
150+
$name,
151151
);
152152
}
153153
}

src/Filter/FilterRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function collection(AssetTarget $target): FilterCollection
114114
[
115115
'target' => $target->name(),
116116
'paths' => $target->paths(),
117-
]
117+
],
118118
);
119119
$filters[] = $copy;
120120
}

src/Filter/Hogan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function _generateScript(string $file, string $filename, string $input
106106
json_encode($input),
107107
json_encode($config),
108108
$id,
109-
$filepath
109+
$filepath,
110110
);
111111
file_put_contents($file, $contents);
112112
}

0 commit comments

Comments
 (0)