mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Merge branch 'develop' into feature/all-visits-endpoint
This commit is contained in:
@@ -8,7 +8,9 @@ use Laminas\Stdlib\AbstractOptions;
|
||||
|
||||
use function array_key_exists;
|
||||
use function explode;
|
||||
use function Functional\map;
|
||||
use function is_array;
|
||||
use function trim;
|
||||
|
||||
class TrackingOptions extends AbstractOptions
|
||||
{
|
||||
@@ -108,10 +110,10 @@ class TrackingOptions extends AbstractOptions
|
||||
|
||||
protected function setDisableTrackingFrom(string|array|null $disableTrackingFrom): void
|
||||
{
|
||||
if (is_array($disableTrackingFrom)) {
|
||||
$this->disableTrackingFrom = $disableTrackingFrom;
|
||||
} else {
|
||||
$this->disableTrackingFrom = $disableTrackingFrom === null ? [] : explode(',', $disableTrackingFrom);
|
||||
}
|
||||
$this->disableTrackingFrom = match (true) {
|
||||
is_array($disableTrackingFrom) => $disableTrackingFrom,
|
||||
$disableTrackingFrom === null => [],
|
||||
default => map(explode(',', $disableTrackingFrom), static fn (string $value) => trim($value)),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +192,9 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
|
||||
return $this->doShortCodeIsInUse($identifier, $spec, LockMode::PESSIMISTIC_WRITE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LockMode::PESSIMISTIC_WRITE|null $lockMode
|
||||
*/
|
||||
private function doShortCodeIsInUse(ShortUrlIdentifier $identifier, ?Specification $spec, ?int $lockMode): bool
|
||||
{
|
||||
$qb = $this->createFindOneQueryBuilder($identifier, $spec)->select('s.id');
|
||||
|
||||
Reference in New Issue
Block a user