@throws \RuntimeException

@return SiteInterface|bool
168133
public function getSite()
    {
        if (!$this->hasRequest()) {
            return false;
        }

        $siteId = null;

        if ('POST' === $this->getRequest()->getMethod()) {
            $values = $this->getRequest()->get($this->getUniqid());
            $siteId = $values['site'] ?? null;
        }

        $siteId = (null !== $siteId) ? $siteId : $this->getRequest()->get('siteId');

        if ($siteId) {
            $site = $this->siteManager->findOneBy(['id' => $siteId]);

            if (!$site) {
                throw new \RuntimeException('Unable to find the site with id='.$this->getRequest()->get('siteId'));
            }

            return $site;
        }

        return false;
    }
1319739
private function createRunTimeTable(): bool
    {
        $this->setRunTimeTable(new Table('runTime', self::TABLE_SIZE, $this->runTimeStruct));

        return $this->getRunTimeTable()->create();
    }
1100696
private function assertMaintenanceMode()
    {
        /** @var ContainerHelper $helper */
        $helper = $this->getHelper('container');
        $app = $helper->getContainer();
        /** @var \Bolt\Config $config */
        $config = $app['config'];
        if ($config->get('general/maintenance_mode') !== true) {
            throw new RuntimeException('Site is not in maintenance mode!');
        }
    }
493241
protected function cachePool()
    {
        if ($this->cachePool === null) {
            throw new RuntimeException(sprintf(
                'Cache Pool is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->cachePool;
    }
34914
public function getSite()
    {
        $site = $this->owner->getComponent('Site');
        return ($site->ID) ? $site : Multisites::inst()->getCurrentSite();
    }
511228
public function getRuntimeConfigurableWrapper()
    {
        if ($this->wrapper === null) {
            $this->wrapper = new RuntimeConfigurable($this, $this->getTaskName());
        }

        return $this->wrapper;
    }
1121726
public static function Init()
	{
		if( !is_null(self::$_Instance) )
		{
			throw RuntimeException::EnvironmentFactoryAlreadyInitialized();
		}

		self::$_Instance = new static();

		return self::$_Instance;
	}
233821
public function render()
    {
        if (!is_readable($this->template) || !is_file($this->template)) {
            throw new \RuntimeException('Cannot read template ' . $this->template);
        }

        ob_start();
        include $this->template;
        return ob_get_clean();
    }
249319
public function collectionLoader()
    {
        if (!isset($this->collectionLoader)) {
            throw new RuntimeException(sprintf(
                'Collection Loader is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->collectionLoader;
    }
1117603
private function createRootPage(SiteInterface $site): PageInterface
    {
        foreach ($this->router->getRouteCollection()->all() as $name => $route) {
            if ('/' === $route->getPath()) {
                $requirements = $route->getRequirements();
                $name = trim($name);

                return $this->pageManager->create([
                    'routeName' => $name,
                    'name' => $name,
                    'url' => $route->getPath(),
                    'site' => $site,
                    'requestMethod' => $requirements['_method'] ?? 'GET|POST|HEAD|DELETE|PUT',
                    'slug' => '/',
                ]);
            }
        }

        return $this->pageManager->create([
            'routeName' => PageInterface::PAGE_ROUTE_CMS_NAME,
            'name' => 'Homepage',
            'url' => '/',
            'site' => $site,
            'requestMethod' => 'GET|POST|HEAD|DELETE|PUT',
            'slug' => '/',
        ]);
    }
1303820
public function getSiteConfig()
    {
        if (null === $this->siteConfig) {
            $configFile = realpath($this->getInputDir() . '/config.yml');
            $this->siteConfig = Yaml::parse($configFile);
        }
        return $this->siteConfig;
    }
318963
public final function run(): ResponseInterface
    {
        try {
            $this->prepare();
            try {
                $body = "";
                $container = $this->getContainer();
                $controller = $this->getController($container);
                $body = $controller->execute($container);
                unset($container);
                $response = $controller->getResponse();
                unset($controller);
                return $this->send($response, $body);
            } catch (RuntimeException $e) {
                trigger_error("Run warning: " . $e->getMessage(), E_USER_WARNING);
                unset($container);
                return $this->send($controller->getResponse(), $body);
            } catch (RouterException $e) {
                trigger_error("Run notice: " . $e->getMessage(), E_USER_NOTICE);
                return $this->send($this->getResponse()->withStatus(404), $body);
            } catch (DispatcherException $e) {
                trigger_error("Run error: " . $e->getMessage(), E_USER_ERROR);
                return $this->send($this->getResponse()->withStatus(500), $body);
            }
        } catch (RuntimeException $e) {
            throw new RuntimeException("Can't run application: " . $e->getMessage());
        }
    }
129617
public function getNewrelicBrowserTimingFooter(): string
    {
        if ($this->isFooterCalled()) {
            throw new \RuntimeException('Function "ekino_newrelic_browser_timing_footer" has already been called');
        }

        if (false === $this->isHeaderCalled()) {
            $this->prepareInteractor();
        }

        $this->footerCalled = true;

        return $this->interactor->getBrowserTimingFooter();
    }
1111774
public function toProto()
    {
        if ($this->trueFilter === null && $this->falseFilter === null) {
            throw new \RuntimeException(
                sprintf(
                    'In order to utilize a condition filter you must supply a filter through either %s:%s or %s:%s.',
                    self::class,
                    'then()',
                    self::class,
                    'otherwise()'
                )
            );
        }
        $condition = (new Condition)
            ->setPredicateFilter($this->predicateFilter);
        if ($this->trueFilter) {
            $condition->setTrueFilter($this->trueFilter);
        }
        if ($this->falseFilter) {
            $condition->setFalseFilter($this->falseFilter);
        }
        return (new RowFilter)
            ->setCondition($condition);
    }
111871
public function evaluate()
    {
        $node = $this->getNode();
        if ($node instanceof NodeInterface) {
            $contentContext = $node->getContext();
            if ($contentContext instanceof \Neos\Neos\Domain\Service\ContentContext) {
                $site = $contentContext->getCurrentSite();
                $siteConfiguration = $this->siteConfigurationRepository->findOneBySite($site);

                return $siteConfiguration;
            }
        }

        return null;
    }
7674
protected function secondaryMenu()
    {
        if (!isset($this->secondaryMenu)) {
            throw new RuntimeException(sprintf(
                'Secondary Menu Group Factory is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->secondaryMenu;
    }
1039827
public function build()
    {
        if (is_null($this->selectFields)) {
            throw new RuntimeException('The `select()` function must be' .
                ' called prior to this function');
        }

        $awql = $this->buildSelectClause();
        $awql = $this->appendWhereClause($awql);
        $awql = $this->appendOrderByClause($awql);

        if (is_null($this->startIndex) && is_null($this->pageSize)) {
            return new ServiceQuery($awql);
        }
        return new ServiceQuery(
            $awql,
            $this->startIndex,
            $this->pageSize
        );
    }