Code Duplication    Length = 19-19 lines in 2 locations

src/Observers/UrlRewriteObserver.php 2 locations

@@ 358-376 (lines=19) @@
355
     *
356
     * @return string The request path
357
     */
358
    protected function prepareRequestPath(array $row, array $category)
359
    {
360
361
        // load the header information
362
        $headers = $this->getHeaders();
363
364
        // initialize the request path
365
        $requestPath = '';
366
367
        // query whether or not, the category is the root category
368
        if ($this->isRootCategory($category)) {
369
            $requestPath = sprintf('%s.html', $this->getUrlKey());
370
        } else {
371
            $requestPath = sprintf('%s/%s.html', $category[MemberNames::URL_PATH], $this->getUrlKey());
372
        }
373
374
        // return the request path
375
        return $requestPath;
376
    }
377
378
    /**
379
     * Prepare's the target path for a 301 redirect URL rewrite.
@@ 386-404 (lines=19) @@
383
     *
384
     * @return string The target path
385
     */
386
    protected function prepareTargetPathForRedirect(array $row, array $category)
387
    {
388
389
        // load the header information
390
        $headers = $this->getHeaders();
391
392
        // initialize the target path
393
        $targetPath = '';
394
395
        // query whether or not, the category is the root category
396
        if ($this->isRootCategory($category)) {
397
            $targetPath = sprintf('%s.html', $this->getUrlKey());
398
        } else {
399
            $targetPath = sprintf('%s/%s.html', $category[MemberNames::URL_PATH], $this->getUrlKey());
400
        }
401
402
        // return the target path
403
        return $targetPath;
404
    }
405
406
    /**
407
     * Prepare's the URL rewrite's metadata with the passed category values.