@param string $pathToProjectRoot

@return $this
@throws \RuntimeException
421819
public function setPathToProjectRoot(string $pathToProjectRoot): self
    {
        $this->pathToProjectRoot = $this->getRealPath($pathToProjectRoot);
        $this->setPathToOverridesDirectory($this->pathToProjectRoot . self::OVERRIDES_PATH);

        return $this;
    }
126452
public function copyTemplateAndGetPath(
        string $pathToProjectRoot,
        string $templatePath,
        string $destinationFileName,
        array $subDirectories
    ): string {
        try {
            $path = $this->createSubDirectoriesAndGetPath($pathToProjectRoot, $subDirectories);
            if (false === \ts\stringContains($destinationFileName, '.php')) {
                $destinationFileName = "$destinationFileName.php";
            }
            $filePath = "$path/$destinationFileName";
            $this->filesystem->copy($templatePath, $filePath, true);
            $this->fileCreationTransaction::setPathCreated($filePath);

            return $filePath;
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
889984
public function createFile($path, $data = null)
    {
        if ($this->hasNodeAt($path)) {
            throw new \RuntimeException(sprintf('%s already exists', $path));
        }

        $parent =  $this->directoryAt(dirname($path));

        $parent->addFile($newFile = $this->factory()->getFile(basename($path)));

        $newFile->setData($data);

        return $newFile;

    }
323325
public function setDocumentRoot($path)
    {
        if (file_exists($path)) {
            $this->document_root = realpath($path);
        } elseif (file_exists(DirectoryHelper::slashDirname($this->getRootDirectory()) . $path)) {
            $this->document_root = DirectoryHelper::slashDirname($this->getRootDirectory()) . $path;
        } else {
            throw new \InvalidArgumentException(
                sprintf('Document root path "%s" doesn\'t exist!', $path)
            );
        }
        return $this;
    }
753887
protected function setConnectionRoot()
	{
		$root = $this->getRoot();

		if (!$root) {
			return;
		}

		if (!$this->root = @\ssh2_sftp_realpath($this->sftp, $root)) {
			throw new \RuntimeException('Root is invalid or does not exist: ' . $root);
		}

		$this->root = $root . $this->separator;
	}
792854
public function addTwigPath(string $namespace, string $path): ExtensionInterface
    {
        if ($this->driver) {
            throw new \RuntimeException('Driver has already been created.  Namespaces cannot be added.');
        }
        $this->twigNamespaces[$namespace][] = $path;

        return $this;
    }
1315820
public function set($path, $value)
    {
        // if is readonly
        if ($this->readonly && $this->has($path)) {
            throw new RuntimeException("Config data have been setting readonly. don't allow change.");
        }

        return parent::set($path, $value);
    }
611000
protected static function showOutro($projectRoot = 'n.a.')
    {
        \cli\line();
        \cli\line(\cli\Colors::colorize('%nEnjoy developing with %yDoozr%n'));
        \cli\line('To maintain your app you can now run %k%Uphp app/console%n%N from your project');
        \cli\line('root: %k%U'.$projectRoot.'%n%N');
        \cli\line();
        \cli\line('This will offer you options like:');
        \cli\line('  --webserver=start To run Doozr on PHP\'s internal webserver - instantly.');
    }
232504
public function makeRoot()
    {
        if ($this->getLeftValue() || $this->getRightValue()) {
            throw new PropelException('Cannot turn an existing node into a root node.');
        }

        $this->setLeftValue(1);
        $this->setRightValue(2);
        $this->setLevel(0);

        return $this;
    }
217328
public static function create(
        string $projectRoot, $default = self::ENV_PRODUCTION, array $allowed = []
    ): EnvironmentInterface
    {
        if (! $allowed) {
            $allowed = [
                self::ENV_PRODUCTION,
                self::ENV_STAGING,
                self::ENV_TESTING,
                self::ENV_DEVELOPMENT,
            ];
        }

        $projectRoot = realpath($projectRoot);

        $filename = $projectRoot . '/.environment';
        if (! $projectRoot || ! file_exists($filename)) {
            return new static($default, $projectRoot);
        }

        // get the environment name
        $name = file_get_contents($filename);

        if (! in_array($name, $allowed)) {
            throw new UnknownEnvironmentException(
                'Unknown environment "' . $name . '". Either add to the allowed list or provide one of: '
                . join(', ', $allowed)
            );
        }

        return new static($name, $projectRoot);
    }
693532
protected function startChildProcess(string $pathToFile) : Process
    {
        $pathToConfig = $this->config['config_path'];
        $startupCommand = 'exec php ' . $pathToFile . ' -c ' . $pathToConfig;
        $process = new Process($startupCommand);
        $process->start($this->loop);

        // listen to output from child process:
        $process->stdout->on('data', function ($output) {
            $this->onChildProcessOut($output);
        });

        $process->on('exit', function ($exitCode, $termSignal) {
            $this->onChildProcessExit($exitCode, $termSignal);
        });

        return $process;
    }
1055615
public function setSectionForSubtree($pathString, $sectionId)
    {
        try {
            return $this->innerGateway->setSectionForSubtree($pathString, $sectionId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
364267
public function setProxiesPath(string $proxiesPath)
    {
        if (!\file_exists($proxiesPath) || !\is_dir($proxiesPath) || !\is_writable($proxiesPath)) {
            throw new \RuntimeException(\sprintf('%s directory does not exist or is write protected', $proxiesPath));
        }

        $this->proxiesPath = $proxiesPath;

        return $this;
    }
664479
public function buildTree()
	{
		if( !$this->path )																			//  no Path to read is set
			throw new RuntimeException( 'No path set' );											//  exit
		$tree	= $this->buildRecursive( $this->path );												//  build HTML Tree recursively
		if( $this->id )																				//  an ID for Tree is set
			$tree	= UI_HTML_Tag::create( 'div', $tree, array( 'id' => $this->id ) );				//  wrap Tree in DIV with ID
		return $tree;																				//  return finished HTML Tree
	}
39268
protected function setDocumentRoot(FilePathInterface $documentRoot): void
    {
        if (!$documentRoot->isDirectory()) {
            throw new InvalidFilePathException('Document root "' . $documentRoot . '" is not a directory.');
        }

        if (!$documentRoot->isAbsolute()) {
            throw new InvalidFilePathException('Document root "' . $documentRoot . '" is not an absolute path.');
        }

        $this->documentRoot = $documentRoot;
    }
118059
public function project(Operand\RootPath $path /*, $path2, ... */)
    {
        $this->projection->add(...func_get_args());

        return $this->qb;
    }
339604
public function remove($path)
    {
        list($name, $path) = $this->splitPath($path);

        if (empty($path)) {
            throw new RuntimeException('The root node of config is not writable');
        }

        return $this->load($name)->remove($path);
    }