Exemple #1
0
 protected function setPackageSource(Interfaces\Package $package, array $config)
 {
     if (!isset($config['source'])) {
         return;
     }
     if (!isset($config['source']['type']) || !isset($config['source']['url']) || !isset($config['source']['reference'])) {
         throw new \UnexpectedValueException(sprintf("Package %s's source key should be specified as {\"type\": ..., \"url\": ..., \"reference\": ...},\n%s given.", $config['name'], json_encode($config['source'])));
     }
     $package->setSourceType($config['source']['type']);
     $package->setSourceUrl($config['source']['url']);
     $package->setSourceReference($config['source']['reference']);
     if (isset($config['source']['mirrors'])) {
         $package->setSourceMirrors($config['source']['mirrors']);
     }
 }