private function detectRootPath(): string
    {
        static $rootpath = null;
        if (null === $rootpath) {
            if (\Phar::running() !== '') {
                $rootpath = dirname(\Phar::running(false));
            } elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
                // stubbles/values is inside the vendor dir of the application
                // it is a dependency of
                $rootpath = realpath(__DIR__ . '/../../../../../../');
            } else {
                // local checkout while development
                $rootpath = realpath(__DIR__ . '/../../../');
            }
        }

        return $rootpath;
    }