diff --git a/module/CLI/config/cli.config.php b/module/CLI/config/cli.config.php index eb27be7f3..501cb668d 100644 --- a/module/CLI/config/cli.config.php +++ b/module/CLI/config/cli.config.php @@ -9,12 +9,12 @@ 'cli' => [ 'locale' => Common\env('CLI_LOCALE', 'en'), 'commands' => [ - Command\Shortcode\GenerateShortcodeCommand::NAME => Command\Shortcode\GenerateShortcodeCommand::class, - Command\Shortcode\ResolveUrlCommand::NAME => Command\Shortcode\ResolveUrlCommand::class, - Command\Shortcode\ListShortcodesCommand::NAME => Command\Shortcode\ListShortcodesCommand::class, - Command\Shortcode\GetVisitsCommand::NAME => Command\Shortcode\GetVisitsCommand::class, - Command\Shortcode\GeneratePreviewCommand::NAME => Command\Shortcode\GeneratePreviewCommand::class, - Command\Shortcode\DeleteShortCodeCommand::NAME => Command\Shortcode\DeleteShortCodeCommand::class, + Command\ShortUrl\GenerateShortUrlCommand::NAME => Command\ShortUrl\GenerateShortUrlCommand::class, + Command\ShortUrl\ResolveUrlCommand::NAME => Command\ShortUrl\ResolveUrlCommand::class, + Command\ShortUrl\ListShortUrlsCommand::NAME => Command\ShortUrl\ListShortUrlsCommand::class, + Command\ShortUrl\GetVisitsCommand::NAME => Command\ShortUrl\GetVisitsCommand::class, + Command\ShortUrl\GeneratePreviewCommand::NAME => Command\ShortUrl\GeneratePreviewCommand::class, + Command\ShortUrl\DeleteShortUrlCommand::NAME => Command\ShortUrl\DeleteShortUrlCommand::class, Command\Visit\ProcessVisitsCommand::NAME => Command\Visit\ProcessVisitsCommand::class, diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index 065c720ce..f6f441c67 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -17,12 +17,12 @@ 'factories' => [ Application::class => ApplicationFactory::class, - Command\Shortcode\GenerateShortcodeCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\ResolveUrlCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\ListShortcodesCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\GetVisitsCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\GeneratePreviewCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\DeleteShortCodeCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GenerateShortUrlCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\ResolveUrlCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\ListShortUrlsCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GetVisitsCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GeneratePreviewCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\DeleteShortUrlCommand::class => ConfigAbstractFactory::class, Command\Visit\ProcessVisitsCommand::class => ConfigAbstractFactory::class, @@ -41,24 +41,24 @@ ], ConfigAbstractFactory::class => [ - Command\Shortcode\GenerateShortcodeCommand::class => [ + Command\ShortUrl\GenerateShortUrlCommand::class => [ Service\UrlShortener::class, 'translator', 'config.url_shortener.domain', ], - Command\Shortcode\ResolveUrlCommand::class => [Service\UrlShortener::class, 'translator'], - Command\Shortcode\ListShortcodesCommand::class => [ + Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class, 'translator'], + Command\ShortUrl\ListShortUrlsCommand::class => [ Service\ShortUrlService::class, 'translator', 'config.url_shortener.domain', ], - Command\Shortcode\GetVisitsCommand::class => [Service\VisitsTracker::class, 'translator'], - Command\Shortcode\GeneratePreviewCommand::class => [ + Command\ShortUrl\GetVisitsCommand::class => [Service\VisitsTracker::class, 'translator'], + Command\ShortUrl\GeneratePreviewCommand::class => [ Service\ShortUrlService::class, PreviewGenerator::class, 'translator', ], - Command\Shortcode\DeleteShortCodeCommand::class => [ + Command\ShortUrl\DeleteShortUrlCommand::class => [ Service\ShortUrl\DeleteShortUrlService::class, 'translator', ], diff --git a/module/CLI/src/Command/Config/GenerateCharsetCommand.php b/module/CLI/src/Command/Config/GenerateCharsetCommand.php index caa64c28c..c7287f7f4 100644 --- a/module/CLI/src/Command/Config/GenerateCharsetCommand.php +++ b/module/CLI/src/Command/Config/GenerateCharsetCommand.php @@ -28,7 +28,7 @@ public function __construct(TranslatorInterface $translator) public function configure() { $this->setName(self::NAME) - ->setDescription(sprintf($this->translator->translate( + ->setDescription(\sprintf($this->translator->translate( 'Generates a character set sample just by shuffling the default one, "%s". ' . 'Then it can be set in the SHORTCODE_CHARS environment variable' ), UrlShortener::DEFAULT_CHARS)); diff --git a/module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php similarity index 92% rename from module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php rename to module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php index f02750a1b..50fed1c4a 100644 --- a/module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php +++ b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php @@ -1,7 +1,7 @@ addArgument( 'shortCode', InputArgument::REQUIRED, - $this->translator->translate('The short code to be deleted') + $this->translator->translate('The short code for the short URL to be deleted') ) ->addOption( 'ignore-threshold', diff --git a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php similarity index 93% rename from module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php rename to module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php index e777b3312..3b41eb447 100644 --- a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php +++ b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php @@ -1,7 +1,7 @@ setName(self::NAME) ->setAliases(self::ALIASES) ->setDescription( - $this->translator->translate('Generates a short code for provided URL and returns the short URL') + $this->translator->translate('Generates a short URL for provided long URL and returns it') ) ->addArgument('longUrl', InputArgument::REQUIRED, $this->translator->translate('The long URL to parse')) ->addOption( diff --git a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php similarity index 95% rename from module/CLI/src/Command/Shortcode/GetVisitsCommand.php rename to module/CLI/src/Command/ShortUrl/GetVisitsCommand.php index b27b6962d..373b9169f 100644 --- a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php +++ b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php @@ -1,7 +1,7 @@ isLastPage($result)) { $continue = false; - $io->success($this->translator->translate('Short codes properly listed')); + $io->success($this->translator->translate('Short URLs properly listed')); } else { $continue = $io->confirm( \sprintf($this->translator->translate('Continue with page') . ' %s?', $page), diff --git a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php similarity index 94% rename from module/CLI/src/Command/Shortcode/ResolveUrlCommand.php rename to module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php index b4a8394f6..57f50a79a 100644 --- a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php @@ -1,7 +1,7 @@ service = $this->prophesize(DeleteShortUrlServiceInterface::class); - $command = new DeleteShortCodeCommand($this->service->reveal(), Translator::factory([])); + $command = new DeleteShortUrlCommand($this->service->reveal(), Translator::factory([])); $app = new Application(); $app->add($command); diff --git a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php rename to module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php index ee63a378d..de62f193f 100644 --- a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php @@ -1,12 +1,12 @@ urlShortener = $this->prophesize(UrlShortener::class); - $command = new GenerateShortcodeCommand($this->urlShortener->reveal(), Translator::factory([]), [ + $command = new GenerateShortUrlCommand($this->urlShortener->reveal(), Translator::factory([]), [ 'schema' => 'http', 'hostname' => 'foo.com', ]); diff --git a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php rename to module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php index 4035de78c..54ce2f6f4 100644 --- a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php @@ -1,12 +1,12 @@ shortUrlService = $this->prophesize(ShortUrlServiceInterface::class); $app = new Application(); - $command = new ListShortcodesCommand($this->shortUrlService->reveal(), Translator::factory([]), []); + $command = new ListShortUrlsCommand($this->shortUrlService->reveal(), Translator::factory([]), []); $app->add($command); $this->commandTester = new CommandTester($command); } diff --git a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php rename to module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php index dfa2e4838..b5e7aff22 100644 --- a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php @@ -1,11 +1,11 @@