protected function validation(\DOMNode $node, $value)
    {
        $boolean =
            Text::fullTrim($value) !== '' &&
            !in_array($node->parentNode->localName, ['script', 'style', 'noscript', 'code']) &&
            !is_numeric(Text::fullTrim($value)) &&
            !preg_match('/^\d+%$/', Text::fullTrim($value)) &&
            !Text::contains(Text::fullTrim($value), '[vc_') &&
            !Text::contains(Text::fullTrim($value), '<?php');

        if ($node instanceof \DOMText) {
            $boolean = $boolean && strpos($value, Parser::ATTRIBUTE_NO_TRANSLATE) === false;
        }

        return $boolean;
    }
protected function validation(\DOMNode $node, $value)
    {
        $boolean =
            Text::fullTrim($value) !== '' &&
            !in_array($node->parentNode->localName, ['script', 'style', 'noscript', 'code']) &&
            !is_numeric(Text::fullTrim($value)) &&
            !preg_match('/^\d+%$/', Text::fullTrim($value)) &&
            !Text::contains(Text::fullTrim($value), '[vc_') &&
            !Text::contains(Text::fullTrim($value), '<?php');

        if ($node instanceof \DOMText) {
            $boolean = $boolean && strpos($value, Parser::ATTRIBUTE_NO_TRANSLATE) === false;
        }

        return $boolean;
    }
protected function validation ( \ DOMNode $ node , $ value ) { $ boolean = Text :: fullTrim ( $ value ) !== '' && ! in_array ( $ node -> parentNode -> localName , [ 'script' , 'style' , 'noscript' , 'code' ] ) && ! is_numeric ( Text :: fullTrim ( $ value ) ) && ! preg_match ( '/^\d+%$/' , Text :: fullTrim ( $ value ) ) && ! Text :: contains ( Text :: fullTrim ( $ value ) , '[vc_' ) && ! Text :: contains ( Text :: fullTrim ( $ value ) , '<?php' ) ; if ( $ node instanceof \ DOMText ) { $ boolean = $ boolean && strpos ( $ value , Parser :: ATTRIBUTE_NO_TRANSLATE ) === false ; } return $ boolean ; }
Some default checks for our value depending on node type

@param \DOMNode $node
@param string $value
@return bool
Some default checks for our value depending on node type