protected function transpileDirectiveNode(Node $node) : string
    {
        $children = $node->getChildren();

        if (count($children) === 0) {
            return '';
        }

        $directiveName = $children[0]->getValue();
        $expression = count($children) === 2 ? $children[1]->getValue() : '';

        if (!isset($this->directiveTranspilers[$directiveName])) {
            throw new RuntimeException(
                sprintf(
                    'No transpiler registered for directive "%s"',
                    $directiveName
                )
            );
        }

        return $this->directiveTranspilers[$directiveName]($expression);
    }
protected function transpileDirectiveNode(Node $node) : string
    {
        $children = $node->getChildren();

        if (count($children) === 0) {
            return '';
        }

        $directiveName = $children[0]->getValue();
        $expression = count($children) === 2 ? $children[1]->getValue() : '';

        if (!isset($this->directiveTranspilers[$directiveName])) {
            throw new RuntimeException(
                sprintf(
                    'No transpiler registered for directive "%s"',
                    $directiveName
                )
            );
        }

        return $this->directiveTranspilers[$directiveName]($expression);
    }
protected function transpileDirectiveNode ( Node $ node ) : string { $ children = $ node -> getChildren ( ) ; if ( count ( $ children ) === 0 ) { return '' ; } $ directiveName = $ children [ 0 ] -> getValue ( ) ; $ expression = count ( $ children ) === 2 ? $ children [ 1 ] -> getValue ( ) : '' ; if ( ! isset ( $ this -> directiveTranspilers [ $ directiveName ] ) ) { throw new RuntimeException ( sprintf ( 'No transpiler registered for directive "%s"' , $ directiveName ) ) ; } return $ this -> directiveTranspilers [ $ directiveName ] ( $ expression ) ; }
Transpiles a directive node

@param Node $node The node to transpile
@return string The transpiled node
@throws RuntimeException Thrown if the directive could not be transpiled
Transpiles a directive node