Skip to content

Commit e9abdf7

Browse files
author
Ben Thomson
committed
Parenthesise some double ternary conditions in Asset Combiner.
Improve compatibility with PHP 7.4, where "Unparenthesized `a ? b : c ?: d` is deprecated" Fixes #4790.
1 parent 18398a8 commit e9abdf7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 6
1515
matrix:
16-
phpVersions: ['7.1', '7.2', '7.3']
16+
phpVersions: ['7.1', '7.2', '7.3', '7.4']
1717
fail-fast: false
1818
name: PHP ${{ matrix.phpVersions }}
1919
steps:

modules/system/classes/CombineAssets.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ protected function prepareCombiner(array $assets, $rewritePath = null)
428428
$filesSalt = null;
429429
foreach ($assets as $asset) {
430430
$filters = $this->getFilters(File::extension($asset)) ?: [];
431-
$path = file_exists($asset) ? $asset : File::symbolizePath($asset, null) ?: $this->localPath . $asset;
431+
$path = file_exists($asset) ? $asset : (File::symbolizePath($asset, null) ?: $this->localPath . $asset);
432432
$files[] = new FileAsset($path, $filters, public_path());
433433
$filesSalt .= $this->localPath . $asset;
434434
}
@@ -482,7 +482,7 @@ protected function getDeepHashFromAssets($assets)
482482
$key = '';
483483

484484
$assetFiles = array_map(function ($file) {
485-
return file_exists($file) ? $file : File::symbolizePath($file, null) ?: $this->localPath . $file;
485+
return file_exists($file) ? $file : (File::symbolizePath($file, null) ?: $this->localPath . $file);
486486
}, $assets);
487487

488488
foreach ($assetFiles as $file) {

0 commit comments

Comments
 (0)