Code Duplication    Length = 5-7 lines in 3 locations

Twig/Node/GimmeListNode.php 3 locations

@@ 113-117 (lines=5) @@
110
            $compiler->write("\$context['".$collectionTypeName."'] = null;\n");
111
            $compiler->write("\$context['_collection_type_filters'] = ")->subcompile($this->getNode('collectionFilters'))->raw("['_collection_type_filters']; unset(\$context['".$collectionTypeName."']['_collection_type_filters']);\n");
112
113
            if ($this->hasNode('withParameters')) {
114
                $compiler->write('$withParameters = array_merge(')->subcompile($this->getNode('withParameters'))->raw(", \$context['_collection_type_filters']);\n");
115
            } else {
116
                $compiler->write("\$withParameters = \$context['_collection_type_filters'];\n");
117
            }
118
        } else {
119
            if ($this->hasNode('withParameters')) {
120
                $compiler->raw('$withParameters = ')->subcompile($this->getNode('withParameters'))->raw(";\n");
@@ 118-124 (lines=7) @@
115
            } else {
116
                $compiler->write("\$withParameters = \$context['_collection_type_filters'];\n");
117
            }
118
        } else {
119
            if ($this->hasNode('withParameters')) {
120
                $compiler->raw('$withParameters = ')->subcompile($this->getNode('withParameters'))->raw(";\n");
121
            } else {
122
                $compiler->raw("\$withParameters = [];\n");
123
            }
124
        }
125
126
        if ($this->hasNode('withoutParameters')) {
127
            $compiler->raw('$withoutParameters = ')->subcompile($this->getNode('withoutParameters'))->raw(";\n");
@@ 126-130 (lines=5) @@
123
            }
124
        }
125
126
        if ($this->hasNode('withoutParameters')) {
127
            $compiler->raw('$withoutParameters = ')->subcompile($this->getNode('withoutParameters'))->raw(";\n");
128
        } else {
129
            $compiler->raw("\$withoutParameters = [];\n");
130
        }
131
132
        $compiler->write('$swpCollectionMetaLoader'.$i." = \$this->env->getExtension('SWP\Component\TemplatesSystem\Twig\Extension\GimmeExtension')->getLoader();\n");
133
        if ($this->hasNode('ignoreContext')) {