mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Rename loosely mode to loose mode
This commit is contained in:
@@ -22,8 +22,8 @@ final class UrlShortenerOptions
|
||||
) {
|
||||
}
|
||||
|
||||
public function isLooselyMode(): bool
|
||||
public function isLooseMode(): bool
|
||||
{
|
||||
return $this->mode === ShortUrlMode::LOOSELY;
|
||||
return $this->mode === ShortUrlMode::LOOSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,11 @@ namespace Shlinkio\Shlink\Core\ShortUrl\Model;
|
||||
enum ShortUrlMode: string
|
||||
{
|
||||
case STRICT = 'strict';
|
||||
case LOOSELY = 'loosely';
|
||||
case LOOSE = 'loose';
|
||||
|
||||
/** @deprecated */
|
||||
public static function tryDeprecated(string $mode): ?self
|
||||
{
|
||||
return $mode === 'loosely' ? self::LOOSE : self::tryFrom($mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class CustomSlugFilter implements FilterInterface
|
||||
return $value;
|
||||
}
|
||||
|
||||
$value = $this->options->isLooselyMode() ? strtolower($value) : $value;
|
||||
$value = $this->options->isLooseMode() ? strtolower($value) : $value;
|
||||
return (match ($this->options->multiSegmentSlugsEnabled) {
|
||||
true => trim(str_replace(' ', '-', $value), '/'),
|
||||
false => str_replace([' ', '/'], '-', $value),
|
||||
|
||||
Reference in New Issue
Block a user