src/Executor/Executor.php
protected static function shouldIncludeNode(ExecutionContext $exeContext, $directives)
    {
        $skip = Directive::skipDirective();
        $include = Directive::includeDirective();

        foreach ($directives as $directive) {
            if ($directive->get('name')->get('value') === $skip->getName()) {
                $values = Values::getArgumentValues($skip->getArguments(), $directive->get('arguments'), $exeContext->variables);
                return empty($values['if']);
            }

            if ($directive->get('name')->get('value') === $include->getName()) {
                $values = Values::getArgumentValues($skip->getArguments(), $directive->get('arguments'), $exeContext->variables);
                return !empty($values['if']);
            }
        }

        return TRUE;
    }
protected static function shouldIncludeNode(ExecutionContext $exeContext, $directives)
    {
        $skip = Directive::skipDirective();
        $include = Directive::includeDirective();

        foreach ($directives as $directive) {
            if ($directive->get('name')->get('value') === $skip->getName()) {
                $values = Values::getArgumentValues($skip->getArguments(), $directive->get('arguments'), $exeContext->variables);
                return empty($values['if']);
            }

            if ($directive->get('name')->get('value') === $include->getName()) {
                $values = Values::getArgumentValues($skip->getArguments(), $directive->get('arguments'), $exeContext->variables);
                return !empty($values['if']);
            }
        }

        return TRUE;
    }
protected static function shouldIncludeNode ( ExecutionContext $ exeContext , $ directives ) { $ skip = Directive :: skipDirective ( ) ; $ include = Directive :: includeDirective ( ) ; foreach ( $ directives as $ directive ) { if ( $ directive -> get ( 'name' ) -> get ( 'value' ) === $ skip -> getName ( ) ) { $ values = Values :: getArgumentValues ( $ skip -> getArguments ( ) , $ directive -> get ( 'arguments' ) , $ exeContext -> variables ) ; return empty ( $ values [ 'if' ] ) ; } if ( $ directive -> get ( 'name' ) -> get ( 'value' ) === $ include -> getName ( ) ) { $ values = Values :: getArgumentValues ( $ skip -> getArguments ( ) , $ directive -> get ( 'arguments' ) , $ exeContext -> variables ) ; return ! empty ( $ values [ 'if' ] ) ; } } return TRUE ; }
Determines if a field should be included based on @if and @unless directives.
Determines if a field should be included based on