Code Duplication    Length = 20-22 lines in 2 locations

src/Queries/SectionQuery.php 1 location

@@ 83-102 (lines=20) @@
80
     *
81
     * @return Collection
82
     */
83
    public function getList()
84
    {
85
        if ($this->queryShouldBeStopped) {
86
            return new Collection();
87
        }
88
89
        $sections = [];
90
        $rsSections = $this->bxObject->getList(
91
            $this->sort,
92
            $this->normalizeFilter(),
93
            $this->countElements,
94
            $this->normalizeSelect(),
95
            $this->navigation
96
        );
97
        while ($arSection = $rsSections->Fetch()) {
98
            $this->addItemToResultsUsingKeyBy($sections, new $this->modelName($arSection['ID'], $arSection));
99
        }
100
101
        return new Collection($sections);
102
    }
103
104
    /**
105
     * Get the first section with a given code.

src/Queries/ElementQuery.php 1 location

@@ 148-169 (lines=22) @@
145
     *
146
     * @return Collection
147
     */
148
    private function getListSimple()
149
    {
150
        if ($this->queryShouldBeStopped) {
151
            return new Collection();
152
        }
153
154
        $items = [];
155
156
        $rsItems = $this->bxObject->GetList(
157
            $this->sort,
158
            $this->normalizeFilter(),
159
            $this->groupBy,
160
            $this->navigation,
161
            $this->normalizeSelect()
162
        );
163
    
164
        while ($arItem = $rsItems->Fetch()) {
165
            $this->addItemToResultsUsingKeyBy($items, new $this->modelName($arItem['ID'], $arItem));
166
        }
167
168
        return new Collection($items);
169
    }
170
171
    public function getList()
172
    {