Example #1
0
 /**
  * Creates the context.
  *
  * @param string|null                   $homeDir        The path to the
  *                                                      home directory or
  *                                                      `null` if none
  *                                                      exists.
  * @param string                        $rootDir        The path to the
  *                                                      project's root
  *                                                      directory.
  * @param Config                        $config         The configuration.
  * @param RootModuleFile                $rootModuleFile The root module
  *                                                      file.
  * @param ConfigFile|null               $configFile     The configuration
  *                                                      file or `null` if
  *                                                      none exists.
  * @param EventDispatcherInterface|null $dispatcher     The event
  *                                                      dispatcher.
  * @param string                        $env            The environment
  *                                                      that Puli is
  *                                                      running in.
  */
 public function __construct($homeDir, $rootDir, Config $config, RootModuleFile $rootModuleFile, ConfigFile $configFile = null, EventDispatcherInterface $dispatcher = null, $env = Environment::DEV)
 {
     Assert::directory($rootDir, 'The root directory %s is not a directory.');
     Assert::oneOf($env, Environment::all(), 'The environment must be one of: %2$s. Got: %s');
     parent::__construct($homeDir, $config, $configFile, $dispatcher);
     $this->rootDir = Path::canonicalize($rootDir);
     $this->rootModuleFile = $rootModuleFile;
     $this->env = $env;
 }