Code Duplication    Length = 25-25 lines in 2 locations

src/Standards/BestIt/Helper/DocDescriptionHelper.php 2 locations

@@ 214-238 (lines=25) @@
211
     *
212
     * @return int|bool Pointer to the end of the description or false
213
     */
214
    private function getCommentDescriptionEndPointer()
215
    {
216
        $descriptionStartPtr = $this->getCommentDescriptionStartPointer();
217
218
        $commentStartToken = $this->docHelper->getCommentStartToken();
219
        $commentEndPtr = $this->docHelper->getCommentEndPointer();
220
221
        //If no tags found, possible end of search is the starting tag of the doc comment.
222
        if (count($commentStartToken['comment_tags']) === 0) {
223
            return $this->file->findPrevious(
224
                T_DOC_COMMENT_STRING,
225
                $commentEndPtr - 1,
226
                $descriptionStartPtr
227
            );
228
        }
229
230
        //else its the pointer of the first comment tag found.
231
        $firstTagPtr = array_shift($commentStartToken['comment_tags']);
232
233
        return $this->file->findPrevious(
234
            T_DOC_COMMENT_STRING,
235
            $firstTagPtr - 1,
236
            $descriptionStartPtr
237
        );
238
    }
239
240
    /**
241
     * Returns pointer to the start of the long description or false if not found.
@@ 245-269 (lines=25) @@
242
     *
243
     * @return bool|int Pointer to the start of the description or false
244
     */
245
    private function getCommentDescriptionStartPointer()
246
    {
247
        $commentStartToken = $this->docHelper->getCommentStartToken();
248
        $commentEndPtr = $this->docHelper->getCommentEndPointer();
249
250
        $summaryPtr = $this->summaryHelper->getCommentSummaryPointer();
251
252
        //If no tags the possible end of search is the closing tag of the doc comment.
253
        if (count($commentStartToken['comment_tags']) === 0) {
254
            return $this->file->findNext(
255
                T_DOC_COMMENT_STRING,
256
                $summaryPtr + 1,
257
                $commentEndPtr
258
            );
259
        }
260
261
        //else its the pointer of the first comment tag found.
262
        $firstTagPtr = array_shift($commentStartToken['comment_tags']);
263
264
        return $this->file->findNext(
265
            T_DOC_COMMENT_STRING,
266
            $summaryPtr + 1,
267
            $firstTagPtr - 1
268
        );
269
    }
270
271
    /**
272
     * Adds error when description is not found.