Moved hardcoded class alias to a namespaced constant

This commit is contained in:
Alejandro Celaya
2020-03-22 17:42:56 +01:00
parent 9ad0561cac
commit 4539ab2dcf
4 changed files with 12 additions and 6 deletions

View File

@@ -19,6 +19,8 @@ use Symfony\Component\Console as SymfonyCli;
use Symfony\Component\Lock\LockFactory;
use Symfony\Component\Process\PhpExecutableFinder;
use const Shlinkio\Shlink\Core\LOCAL_LOCK_FACTORY;
return [
'dependencies' => [
@@ -52,7 +54,7 @@ return [
],
ConfigAbstractFactory::class => [
GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, 'Shlinkio\Shlink\LocalLockFactory'],
GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, LOCAL_LOCK_FACTORY],
Command\ShortUrl\GenerateShortUrlCommand::class => [
Service\UrlShortener::class,

View File

@@ -12,6 +12,7 @@ use function sprintf;
const DEFAULT_SHORT_CODES_LENGTH = 5;
const MIN_SHORT_CODES_LENGTH = 4;
const LOCAL_LOCK_FACTORY = 'Shlinkio\Shlink\LocalLockFactory';
function generateRandomShortCode(int $length): string
{