mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -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;
|
$value = $this->options->isLooselyMode() ? strtolower($value) : $value;
|
||||||
if ($this->options->multiSegmentSlugsEnabled) {
|
return (match ($this->options->multiSegmentSlugsEnabled) {
|
||||||
return trim(str_replace(' ', '-', $value), '/');
|
true => trim(str_replace(' ', '-', $value), '/'),
|
||||||
}
|
false => str_replace([' ', '/'], '-', $value),
|
||||||
|
});
|
||||||
return str_replace([' ', '/'], '-', $value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user