Permalink
Browse files

added exception for formulae with the same output string

  • Loading branch information...
1 parent 0c7158a commit a4a52d7295202728cea5c631f17cc67f82723bea @kriswallsmith committed Feb 6, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/Assetic/Factory/LazyAssetManager.php
@@ -153,10 +153,23 @@ public function load()
}
$this->loading = true;
+ $outputs = array();
foreach ($this->resources as $loader => $resources) {
foreach ($resources as $resource) {
- $this->formulae = array_replace($this->formulae, $this->loaders[$loader]->load($resource));
+ foreach ($this->loaders[$loader]->load($resource) as $name => $formula) {
+ if (isset($formula[2]['output']) && false === strpos($formula[2]['output'], '*')) {
+ $output = $formula[2]['output'];
+
+ if (isset($outputs[$output]) && $outputs[$output] != $name) {
+ throw new \LogicException(sprintf('There are multiple asset formulae with an output string of "%s"', $output));
+ }
+
+ $outputs[$output] = $name;
+ }
+
+ $this->formulae[$name] = $formula;
+ }
}
}

0 comments on commit a4a52d7

Please sign in to comment.