コード例 #1
0
 /**
  * @expectedException UnexpectedValueException
  */
 public function testSelfDependencyThrowsAnException()
 {
     $sorter = new DependencySorter();
     $sorter->add('foo/bar', array('foo/bar'));
     $sorter->sort();
 }
コード例 #2
0
ファイル: ExtensionBag.php プロジェクト: sohailaammarocs/lfc
 /**
  * Sorts all registered extensions by their dependencies.
  *
  * @return void
  */
 public function sortExtensions()
 {
     $sorter = new DependencySorter();
     foreach ($this->all() as $extension) {
         $sorter->add($extension->getSlug(), $extension->getDependencies());
     }
     $extensions = array();
     foreach ($sorter->sort() as $slug) {
         $extensions[$slug] = $this->items[$slug];
     }
     $this->items = $extensions;
     unset($extensions);
 }