Example #1
0
 private function connect(DependencyGraph $graph, $sourceName, $destName, $version)
 {
     if ('php' === $destName) {
         return;
     }
     // If the dest package is available, just connect it.
     if ($graph->hasPackage($destName)) {
         $graph->connect($sourceName, $destName, $version);
         return;
     }
     // If the dest package is not available, let's check to see if there is
     // some aggregate package that replaces our dest package, and connect to
     // this package.
     if (null !== ($aggregatePackage = $graph->getAggregatePackageContaining($destName))) {
         $graph->connect($sourceName, $aggregatePackage->getName(), $version);
         return;
     }
 }
 private function connect(DependencyGraph $graph, $sourceName, $destName, $version)
 {
     // If the dest package is available, just connect it.
     if ($graph->hasPackage($destName)) {
         $graph->connect($sourceName, $destName, $version);
         return;
     }
     // If the dest package is not available, let's check to see if there is
     // some aggregate package that replaces our dest package, and connect to
     // this package.
     if (null !== ($aggregatePackage = $graph->getAggregatePackageContaining($destName))) {
         $graph->connect($sourceName, $aggregatePackage->getName(), $version);
         return;
     }
     // If we reach this, we have stumbled upon a package that is only available
     // if the source package is installed with dev dependencies. We still add
     // the connection, but we will not have any data about the dest package.
     $graph->connect($sourceName, $destName, $version);
 }