@return NodeInterface

@throws \RuntimeException
11564
public function getParentNode()
    {
        if (!$this->parentNode) {
            throw new \RuntimeException(sprintf(
                'Trying to retrieve parent node when no parent node has been set. An event ' .
                'listener should have set the node when persisting document "%s"',
                DocumentHelper::getDebugTitle($this->document)
            ));
        }

        return $this->parentNode;
    }
728038
protected function createNode(NodeInterface $parent)
    {
        $nodeType = $this->getNodeType();
        $name = $this->getName() ?: $this->nodeService->generateUniqueNodeName($parent->getPath());

        $node = $parent->createNode($name, $nodeType);

        $this->applyNodeCreationHandlers($node);

        $this->finish($node);
        // NOTE: we need to run "finish" before "addNodeCreatedFeedback" to ensure the new node already exists when the last feedback is processed
        $this->addNodeCreatedFeedback($node);

        return $node;
    }
458207
public function addChildNode(NodeInterface $childNode){
        $this->childNodes[] = $childNode;
        $childNode->setParentNode($this);
        return $this;
    }
684382
public function getBody()
    {
        if ($this->isAbstract() === true) {
            throw new RuntimeException('Can not get body of an abstract method');
        }

        $fileName = $this->getDeclaringClass()->getFileName();
        if ($fileName === false) {
            throw new RuntimeException('Can not get body of a method belonging to an internal class.');
        }

        $lines = file($fileName, FILE_IGNORE_NEW_LINES);
        $lines = array_slice($lines, $this->getStartLine() - 1, ($this->getEndLine() - $this->getStartLine() + 1),
            true);
        $lines = implode("\n", $lines);

        $firstBracketPos = strpos($lines, '{');
        $lastBracketPost = strrpos($lines, '}');
        $body = substr($lines, $firstBracketPos + 1, $lastBracketPost - $firstBracketPos - 1);

        return trim(rtrim($body), "\n\r");
    }
1113552
public function setChildren(array $children): NodeInterface
    {
        foreach ($this->getChildren() as $node) {
            $this->removeChild($node->getId());
        }

        foreach ($children as $child) {
            $this->addChild($child);
        }

        return $this;
    }
1027747
protected function lexDefinition(): NodeInterface
    {
        if ($this->peek(TokenKindEnum::NAME)) {
            $token = $this->lexer->getToken();

            switch ($token->getValue()) {
                case KeywordEnum::QUERY:
                case KeywordEnum::MUTATION:
                case KeywordEnum::SUBSCRIPTION:
                case KeywordEnum::FRAGMENT:
                    return $this->lexExecutableDefinition();
                case KeywordEnum::SCHEMA:
                case KeywordEnum::SCALAR:
                case KeywordEnum::TYPE:
                case KeywordEnum::INTERFACE:
                case KeywordEnum::UNION:
                case KeywordEnum::ENUM:
                case KeywordEnum::INPUT:
                case KeywordEnum::DIRECTIVE:
                    return $this->lexTypeSystemDefinition();
                case KeywordEnum::EXTEND:
                    return $this->lexTypeSystemExtension();

            }
        } elseif ($this->peek(TokenKindEnum::BRACE_L)) {
            return $this->lexExecutableDefinition();
        } elseif ($this->peekDescription()) {
            return $this->lexTypeSystemDefinition();
        }

        throw $this->unexpected();
    }
1179313
public function getControlHandler() {
		if ($this->_controlHandler === null) {
			if ($this->hasLocator() && $this->getLocator()->has($this->_controlHandlerServiceId)) {
				$this->_controlHandler = $this->getLocator()->get($this->_controlHandlerServiceId);
				
				if (! $this->_controlHandler instanceof ControlHandlerInterface) {
					throw new RuntimeException('Pagination control handler must implement "ControlHandlerInterface"');
				}
			} else {
				$this->_controlHandler = new Sliding();
			}
		}
		
		return $this->_controlHandler;
	}
1304036
private function resolveContainer(): ContainerInterface
    {
        if ($this->container === null) {
            $container = $this->containerFactory->build($this);

            if (!$container instanceof ContainerInterface) {
                throw new \RuntimeException(
                    "Invalid factory result, expected ContainerInterface"
                );
            }

            $this->container = $container;
        }

        return $this->container;
    }
172224
public function create() : LoggerInterface
    {
        $loggerType = $this->config['type'] ?? 'null';
        switch ($loggerType) {
            case 'file':
                return new Logger($this->config['path'], $this->config['level']);
            case 'null':
                return new NullLogger;
            default:
                throw new \RuntimeException('Invalid logger type');
        }
    }
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;
    }
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
	}
173506
public function removeNode(NodeInterface $node): NodeInterface
    {
        unset($this->_nodes[$node->getId()]);

        if ($this->getParent()) {
            $this->getParent()->removeNode($node);
        }

        return $this;
    }
160075
public function getData()
    {
        if ($this->config->getInheritData()) {
            if (!$this->parent) {
                throw new RuntimeException('The block is configured to inherit its parent\'s data, but does not have a parent.');
            }

            return $this->parent->getData();
        }

        if (!$this->defaultDataSet) {
            $this->setData($this->config->getData());
        }

        return $this->modelData;
    }
604517
private function getSiblingNode(NodeInterface $node, $previous = false)
    {
        $parentNode = $node->getParent();
        $children = $parentNode->getNodes();
        $previousNode = null;

        while ($child = current($children)) {
            if ($child->getPath() === $node->getPath()) {
                return $previous ? $previousNode : next($children);
            }

            $previousNode = $child;
            next($children);
        }

        throw new \RuntimeException(
            sprintf(
                'Could not find node with path "%s" as a child of "%s". This should not happen',
                $node->getPath(),
                $parentNode->getPath()
            )
        );
    }
336992
public function getEntityService()
    {
        if (null === $this->entityService) {
            $entityServiceClass = $this->getEntityServiceClass();
            if (!class_exists($entityServiceClass)) {
                throw new \RuntimeException("Classe $entityServiceClass inexistente!");
            }
            $this->entityService = new $entityServiceClass();
            $this->entityService->setServiceLocator($this->getServiceLocator());
        }

        return $this->entityService;
    }
911673
public function getRoot() : Node {
        $node = $this;
        while ($node->parent !== null) {
            $node = $node->parent;
        }
        return $node;
    }
689837
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder('sentry');
        /** @var ArrayNodeDefinition $rootNode */
        $rootNode = \method_exists(TreeBuilder::class, 'getRootNode')
            ? $treeBuilder->getRootNode()
            : $treeBuilder->root('sentry');

        // Basic Sentry configuration
        $rootNode->children()
            ->scalarNode('dsn')
            ->defaultNull()
            ->beforeNormalization()
            ->ifString()
            ->then($this->getTrimClosure());

        // Options array (to be passed to Sentry\Options constructor) -- please keep alphabetical order!
        $optionsNode = $rootNode->children()
            ->arrayNode('options')
            ->addDefaultsIfNotSet();

        $defaultValues = new Options();
        $optionsChildNodes = $optionsNode->children();

        $optionsChildNodes->booleanNode('attach_stacktrace');
        $optionsChildNodes->variableNode('before_breadcrumb')
            ->validate()
            ->ifTrue($this->isNotAValidCallback())
            ->thenInvalid('Expecting callable or service reference, got %s');
        $optionsChildNodes->variableNode('before_send')
            ->validate()
            ->ifTrue($this->isNotAValidCallback())
            ->thenInvalid('Expecting callable or service reference, got %s');
        if (PrettyVersions::getVersion('sentry/sentry')->getPrettyVersion() !== '2.0.0') {
            $optionsChildNodes->booleanNode('capture_silenced_errors');
        }
        $optionsChildNodes->integerNode('context_lines')
            ->min(0)
            ->max(99);
        $optionsChildNodes->booleanNode('default_integrations');
        $optionsChildNodes->booleanNode('enable_compression');
        $optionsChildNodes->scalarNode('environment')
            ->defaultValue('%kernel.environment%')
            ->cannotBeEmpty();
        $optionsChildNodes->scalarNode('error_types');
        $optionsChildNodes->arrayNode('in_app_exclude')
            ->defaultValue([
                '%kernel.cache_dir%',
                $this->getProjectRoot() . '/vendor',
            ])
            ->prototype('scalar');
        $optionsChildNodes->arrayNode('excluded_exceptions')
            ->defaultValue($defaultValues->getExcludedExceptions())
            ->prototype('scalar');
        $optionsChildNodes->scalarNode('http_proxy');
        $optionsChildNodes->arrayNode('integrations')
            ->prototype('scalar')
            ->validate()
            ->ifTrue(function ($value): bool {
                if (! is_string($value)) {
                    return true;
                }

                return '@' !== substr($value, 0, 1);
            })
            ->thenInvalid('Expecting service reference, got %s');
        $optionsChildNodes->scalarNode('logger');
        $optionsChildNodes->integerNode('max_breadcrumbs')
            ->min(1);
        $optionsChildNodes->integerNode('max_value_length')
            ->min(1);
        $optionsChildNodes->arrayNode('prefixes')
            ->defaultValue($defaultValues->getPrefixes())
            ->prototype('scalar');
        $optionsChildNodes->scalarNode('project_root')
            ->defaultValue($this->getProjectRoot());
        $optionsChildNodes->scalarNode('release');
        $optionsChildNodes->floatNode('sample_rate')
            ->min(0.0)
            ->max(1.0);
        $optionsChildNodes->integerNode('send_attempts')
            ->min(1);
        $optionsChildNodes->booleanNode('send_default_pii');
        $optionsChildNodes->scalarNode('server_name');
        $optionsChildNodes->arrayNode('tags')
            ->normalizeKeys(false)
            ->prototype('scalar');

        // Bundle-specific configuration
        $listenerPriorities = $rootNode->children()
            ->arrayNode('listener_priorities')
            ->addDefaultsIfNotSet()
            ->children();
        $listenerPriorities->scalarNode('request')
            ->defaultValue(1);
        $listenerPriorities->scalarNode('sub_request')
            ->defaultValue(1);
        $listenerPriorities->scalarNode('console')
            ->defaultValue(1);
        $listenerPriorities->scalarNode('request_error')
            ->defaultValue(128);
        $listenerPriorities->scalarNode('console_error')
            ->defaultValue(128);

        return $treeBuilder;
    }