/** * Get project */ protected function getRepository() { $path = dirname(__FILE__) . '/../../../Fixtures/domain.ca.yml'; return Repository::createByFilePath($path); }
/** * Create a project from a list of paths * * @param string $masterLanguage Master language * @param string[] $availableLanguages Available languages * @param string[] $paths List of paths * * @return self new Project instance */ public static function create($masterLanguage, array $availableLanguages, array $paths) { $finder = new Finder(); $finder->files()->in($paths)->name('*.yml')->name('*.yaml'); $repositories = []; foreach ($finder as $file) { $filepath = $file->getRealpath(); $repositories[] = Repository::createByFilePath($filepath); } $repositoryCollection = RepositoryCollection::create($repositories); return new self($repositoryCollection, $masterLanguage, $availableLanguages, $paths); }