Code Duplication    Length = 16-16 lines in 2 locations

src/Observers/UrlRewriteObserver.php 2 locations

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