Skip to content

Commit 80c9049

Browse files
committed
Refactored
1 parent 953066b commit 80c9049

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/ResourceManager.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ class ResourceManager
8585
/** @var string Full path to project cache root directory */
8686
public static $cacheRoot;
8787

88-
/** @var array Cached assets */
89-
protected $cache = [];
90-
9188
/** @var array Collection of assets */
9289
protected $assets = [];
9390

@@ -142,21 +139,19 @@ protected function processAsset($dependencies)
142139
*/
143140
public function manage(array $paths)
144141
{
145-
// Get assets list
146-
$assets = $this->fileManager->scan($paths, self::TYPES, self::$excludeFolders);
147-
148142
// Iterate all assets for analyzing
149-
foreach ($assets as $asset) {
143+
foreach ($this->fileManager->scan($paths, self::TYPES, self::$excludeFolders) as $asset) {
150144
// Build path to processed asset
151145
$cachedAsset = $this->getAssetProcessedPath($asset);
152146

153147
// If cached assets was modified or new
154148
if (!$this->isValid($asset, $cachedAsset)) {
155149
// Recursively process asset and possible dependencies
156150
$this->processAsset([$asset => []]);
157-
// Store processed asset
158-
$this->assets[pathinfo($cachedAsset, PATHINFO_EXTENSION)][] = $cachedAsset;
159151
}
152+
153+
// Store processed asset
154+
$this->assets[pathinfo($cachedAsset, PATHINFO_EXTENSION)][] = $cachedAsset;
160155
}
161156

162157
return $this->assets;

0 commit comments

Comments
 (0)