Ejemplo n.º 1
0
 private function parseSource(Source $source, Filter $parentFilter = null)
 {
     $filter = new Filter($parentFilter, $source->getName(), $source->getExtensions());
     foreach ($source->getSources() as $subSource) {
         $this->parseSource($subSource, $filter);
     }
     foreach ($source->getPaths() as $path) {
         if (is_dir($path)) {
             $this->parseDirectory($path, $filter, $source->getExpand());
         } elseif (is_file($path)) {
             $filter->addFile($path);
         } else {
             throw new RuntimeException(sprintf('The path "%s" does not exists.', $path));
         }
     }
     return $filter;
 }
Ejemplo n.º 2
0
 private function buildCompileCommandsForSource(ArrayObject $result, Project $project, Configuration $configuration, Source $source)
 {
     foreach ($source->getPaths() as $path) {
         if (is_dir($path)) {
             $this->buildCompileCommandsForDirectory($result, $project, $configuration, $path, $source->getExpand());
         } elseif (is_file($path)) {
             $this->buildCompileCommandForFile($result, $project, $configuration, $path);
         } else {
             throw new RuntimeException('Invalid path provided: ' . $path);
         }
     }
 }