Code Duplication    Length = 16-16 lines in 2 locations

src/Observers/UrlRewriteObserver.php 2 locations

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