/**
  * Create coveralls configuration.
  *
  * @param array  $options Processed configuration.
  * @param string $rootDir Path to project root directory.
  *
  * @return \Satooshi\Bundle\CoverallsV1Bundle\Config\Configuration
  */
 protected function createConfiguration(array $options, $rootDir)
 {
     $configuration = new Configuration();
     $file = new Path();
     $repoToken = $options['repo_token'];
     $repoSecretToken = $options['repo_secret_token'];
     return $configuration->setRepoToken($repoToken !== null ? $repoToken : $repoSecretToken)->setServiceName($options['service_name'])->setSrcDir($this->ensureSrcDir($options['src_dir'], $rootDir, $file))->setCloverXmlPaths($this->ensureCloverXmlPaths($options['coverage_clover'], $rootDir, $file))->setJsonPath($this->ensureJsonPath($options['json_path'], $rootDir, $file))->setExcludeNoStatements($options['exclude_no_stmt']);
 }
Esempio n. 2
0
 protected function createConfiguration(array $options, $rootDir, InputInterface $input = null)
 {
     $configuration = new Configuration();
     $file = new Path();
     $repoToken = $options['repo_token'];
     $repoSecretToken = $options['repo_secret_token'];
     if ($input !== null && $input->hasOption('coverage_clover') && count($input->getOption('coverage_clover')) > 0) {
         $coverage_clover = $input->getOption('coverage_clover');
     } else {
         $coverage_clover = $options['coverage_clover'];
     }
     return $configuration->setRepoToken($repoToken !== null ? $repoToken : $repoSecretToken)->setServiceName($options['service_name'])->setRootDir($rootDir)->setCloverXmlPaths($this->ensureCloverXmlPaths($coverage_clover, $rootDir, $file))->setJsonPath($this->ensureJsonPath($options['json_path'], $rootDir, $file))->setExcludeNoStatements($options['exclude_no_stmt']);
 }