Parenthesise some double ternary conditions in Asset Combiner.

Improve compatibility with PHP 7.4, where "Unparenthesized `a ? b : c ?: d` is deprecated"

Fixes #4790.
This commit is contained in:
Ben Thomson 2019-11-28 09:21:03 +08:00
parent 18398a8318
commit e9abdf7783
No known key found for this signature in database
GPG Key ID: B2BAFACC5ED68F87
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ jobs:
strategy:
max-parallel: 6
matrix:
phpVersions: ['7.1', '7.2', '7.3']
phpVersions: ['7.1', '7.2', '7.3', '7.4']
fail-fast: false
name: PHP ${{ matrix.phpVersions }}
steps:

View File

@ -428,7 +428,7 @@ class CombineAssets
$filesSalt = null;
foreach ($assets as $asset) {
$filters = $this->getFilters(File::extension($asset)) ?: [];
$path = file_exists($asset) ? $asset : File::symbolizePath($asset, null) ?: $this->localPath . $asset;
$path = file_exists($asset) ? $asset : (File::symbolizePath($asset, null) ?: $this->localPath . $asset);
$files[] = new FileAsset($path, $filters, public_path());
$filesSalt .= $this->localPath . $asset;
}
@ -482,7 +482,7 @@ class CombineAssets
$key = '';
$assetFiles = array_map(function ($file) {
return file_exists($file) ? $file : File::symbolizePath($file, null) ?: $this->localPath . $file;
return file_exists($file) ? $file : (File::symbolizePath($file, null) ?: $this->localPath . $file);
}, $assets);
foreach ($assetFiles as $file) {