Code Duplication    Length = 6-8 lines in 2 locations

Parser/Token/ContextualToken.php 2 locations

@@ 37-42 (lines=6) @@
34
        }
35
36
        if (!$context->has($this->name)) {
37
            if (!$this->rule->validator->validate($context)) {
38
                $this->setValid(false);
39
            } else {
40
                $this->_valid       = true;
41
                $this->_end->_valid = false;
42
            }
43
        } else {
44
            if (!$this->rule->validator->validate($context, [ $this->name => Validator::CONTEXT_IN ])) {
45
                $this->setValid(false);
@@ 43-50 (lines=8) @@
40
                $this->_valid       = true;
41
                $this->_end->_valid = false;
42
            }
43
        } else {
44
            if (!$this->rule->validator->validate($context, [ $this->name => Validator::CONTEXT_IN ])) {
45
                $this->setValid(false);
46
            } else {
47
                $this->_valid       = false;
48
                $this->_end->_valid = true;
49
            }
50
        }
51
52
        $this->_end->_start = false;
53
        $this->_end         = false;