mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-23 07:33:58 -06:00
Refactor CustomSlugFilter for simplicity
This commit is contained in:
parent
3a149c9edc
commit
99c1a59dd4
@ -25,10 +25,9 @@ class CustomSlugFilter implements FilterInterface
|
||||
}
|
||||
|
||||
$value = $this->options->isLooselyMode() ? strtolower($value) : $value;
|
||||
if ($this->options->multiSegmentSlugsEnabled) {
|
||||
return trim(str_replace(' ', '-', $value), '/');
|
||||
}
|
||||
|
||||
return str_replace([' ', '/'], '-', $value);
|
||||
return (match ($this->options->multiSegmentSlugsEnabled) {
|
||||
true => trim(str_replace(' ', '-', $value), '/'),
|
||||
false => str_replace([' ', '/'], '-', $value),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user