8000 suggestions from Nicolas! · symfony/symfony@5bb88ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bb88ad

Browse files
committed
suggestions from Nicolas!
1 parent 1784212 commit 5bb88ad

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/Symfony/Component/AssetMapper/AssetMapperCompiler.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,9 @@ public function compile(string $content, MappedAsset $mappedAsset): string
3939
continue;
4040
}
4141

42-
$content = $compiler->compile($content, $mappedAsset, $this->getAssetMapper());
42+
$content = $compiler->compile($content, $mappedAsset, $this->assetMapper ??= ($this->assetMapperFactory)());
4343
}
4444

4545
return $content;
4646
}
47-
48-
private function getAssetMapper(): AssetMapperInterface
49-
{
50-
if (!isset($this->assetMapper)) {
51-
$this->assetMapper = ($this->assetMapperFactory)();
52-
}
53-
54-
return $this->assetMapper;
55-
}
5647
}

src/Symfony/Component/AssetMapper/Factory/MappedAssetFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function createMappedAsset(string $logicalPath, string $sourcePath): ?Map
6666
private function getDigest(MappedAsset $asset): array
6767
{
6868
// check for a pre-digested file
69-
if (1 === preg_match(self::PREDIGESTED_REGEX, $asset->getLogicalPath(), $matches)) {
69+
if (preg_match(self::PREDIGESTED_REGEX, $asset->getLogicalPath(), $matches)) {
7070
return [$matches[1], true];
7171
}
7272

0 commit comments

Comments
 (0)
0