Code Duplication    Length = 8-12 lines in 2 locations

src/Uploadable.php 2 locations

@@ 447-454 (lines=8) @@
444
     * @param string $uploadField
445
     * @return string
446
     */
447
    public function getUploadFileUrl(string $uploadField) : string
448
    {
449
        $Url = $this->getUploadFileFullPath($uploadField);
450
451
        $uploadFieldPath = DirHelper::canonicalize($this->removePublicPath($Url));
452
453
        return $uploadFieldPath == '' ? '' : URL::to($uploadFieldPath);
454
    }
455
456
    /**
457
     * get a path and remove public_path.
@@ 481-492 (lines=12) @@
478
     * @param string $uploadField
479
     * @return string
480
     */
481
    public function getUploadFileBaseUrl(string $uploadField) : string
482
    {
483
        $uploadFieldPath = $this->getUploadFileBasePath($uploadField);
484
485
        $uploadFieldPath = DirHelper::canonicalize(DirHelper::addFinalSlash($this->removePublicPath($uploadFieldPath)));
486
487
        if ($this->isSlashOrEmptyDir($uploadFieldPath)) {
488
            return '';
489
        }
490
491
        return URL::to($uploadFieldPath);
492
    }
493
494
    /**
495
     * Calcolate the new name for ALL uploaded files and set relative upload attributes