public function create($name, array $files): ProjectInterface
    {
        $project = new Project($name);

        foreach ($files as $filePath) {
            $strategy = $this->strategies->findMatching($filePath);
            $file = $strategy->create($filePath, $this->strategies);
            if ($file !== null) {
                $project->addFile($file);
            }
        }

        $this->buildNamespaces($project);

        return $project;
    }
public function create($name, array $files): ProjectInterface
    {
        $project = new Project($name);

        foreach ($files as $filePath) {
            $strategy = $this->strategies->findMatching($filePath);
            $file = $strategy->create($filePath, $this->strategies);
            if ($file !== null) {
                $project->addFile($file);
            }
        }

        $this->buildNamespaces($project);

        return $project;
    }
public function create ( $ name , array $ files ) : ProjectInterface { $ project = new Project ( $ name ) ; foreach ( $ files as $ filePath ) { $ strategy = $ this -> strategies -> findMatching ( $ filePath ) ; $ file = $ strategy -> create ( $ filePath , $ this -> strategies ) ; if ( $ file !== null ) { $ project -> addFile ( $ file ) ; } } $ this -> buildNamespaces ( $ project ) ; return $ project ; }
Creates a project from the set of files.

@param string $name
@param SourceFile[] $files
@throws Exception when no matching strategy was found.
Creates a project from the set of files .