diff --git a/src/Padawan/Domain/Project.php b/src/Padawan/Domain/Project.php index f03db41..9734d70 100644 --- a/src/Padawan/Domain/Project.php +++ b/src/Padawan/Domain/Project.php @@ -3,17 +3,33 @@ namespace Padawan\Domain; use Padawan\Domain\Project\Index; +use Padawan\Domain\Project\Config; class Project { private $index; private $rootFolder; + private $config; private $plugins = []; public function __construct(Index $index, $rootFolder = "") { $this->index = $index; $this->rootFolder = $rootFolder; + $this->config = Config::default(); + } + + /** + * @return Project + */ + public static function withConfig( + Index $index, + $rootFolder, + Config $config + ) { + $self = new static($index, $rootFolder); + $self->config = $config; + return $self; } public function getRootFolder() { diff --git a/src/Padawan/Domain/Project/Config.php b/src/Padawan/Domain/Project/Config.php new file mode 100644 index 0000000..668fbb2 --- /dev/null +++ b/src/Padawan/Domain/Project/Config.php @@ -0,0 +1,59 @@ +_phpVersion = $phpVersion; + $this->_plugins = $plugins; + $this->_excludedDirs = $excludedDirs; + $this->_cacheDir = $cacheDir; + } + + /** + * @return Config + */ + public static function default() + { + return new static( + "5.6", + [], + [], + ".padawan" + ); + } + + public function phpVersion() + { + return $this->_phpVersion; + } + + public function plugins() + { + return $this->_plugins; + } + + public function excludedDirs() + { + return $this->_excludedDirs; + } + + public function cacheDir() + { + return $this->_cacheDir; + } + + private $_phpVersion; + private $_plugins; + private $_excludedDirs; + private $_cacheDir; +}