/**
  * Pre process the data of package before the conversion to Package instance.
  *
  * @param array $data
  *
  * @return array
  */
 protected function preProcessAsset(array $data)
 {
     $vcsRepos = array();
     // keep the name of the main identifier for all packages
     $data['name'] = $this->packageName ?: $data['name'];
     $data = $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
     return (array) $data;
 }
예제 #2
0
 /**
  * Pre process the data of package before the conversion to Package instance.
  *
  * @param VcsDriverInterface $driver
  * @param array              $data
  * @param string             $identifier
  *
  * @return array
  */
 protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
 {
     $vcsRepos = array();
     $data = array_merge($data, $this->packageData);
     $data = $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
     $this->dispatchAddVcsEvent($vcsRepos);
     if (!isset($data['dist'])) {
         $data['dist'] = $driver->getDist($identifier);
     }
     if (!isset($data['source'])) {
         $data['source'] = $driver->getSource($identifier);
     }
     return (array) $data;
 }
예제 #3
0
 public function testConverter()
 {
     $this->assertInstanceOf('Fxp\\Composer\\AssetPlugin\\Converter\\PackageConverterInterface', $this->type->getPackageConverter());
     $this->assertInstanceOf('Fxp\\Composer\\AssetPlugin\\Converter\\VersionConverterInterface', $this->type->getVersionConverter());
 }