Commit 84237dd8 by Klimov Paul

E_NOTICE at "yii\console\controllers\AssetController::loadBundleDependency()" has been fixed.

parent 57e54741
...@@ -203,9 +203,6 @@ class AssetController extends Controller ...@@ -203,9 +203,6 @@ class AssetController extends Controller
$assetManager = $this->getAssetManager(); $assetManager = $this->getAssetManager();
foreach ($bundle->depends as $dependencyName) { foreach ($bundle->depends as $dependencyName) {
if (!array_key_exists($dependencyName, $result)) { if (!array_key_exists($dependencyName, $result)) {
if ($result[$dependencyName] === false) {
throw new Exception("A circular dependency is detected for target '{$dependencyName}'.");
}
$dependencyBundle = $assetManager->getBundle($dependencyName); $dependencyBundle = $assetManager->getBundle($dependencyName);
if ($dependencyBundle === null) { if ($dependencyBundle === null) {
throw new Exception("Unable to load dependency bundle '{$dependencyName}' for bundle '{$name}'."); throw new Exception("Unable to load dependency bundle '{$dependencyName}' for bundle '{$name}'.");
...@@ -214,6 +211,10 @@ class AssetController extends Controller ...@@ -214,6 +211,10 @@ class AssetController extends Controller
$this->loadBundleDependency($dependencyName, $dependencyBundle, $result); $this->loadBundleDependency($dependencyName, $dependencyBundle, $result);
$result[$dependencyName] = $dependencyBundle; $result[$dependencyName] = $dependencyBundle;
} }
} else {
if ($result[$dependencyName] === false) {
throw new Exception("A circular dependency is detected for target '{$dependencyName}'.");
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment