Skip to content

Commit

Permalink
Updated references to short code and replaced them to short URL where…
Browse files Browse the repository at this point in the history
… appropriate
  • Loading branch information
acelaya committed Sep 16, 2018
1 parent 92858ae commit 1eff980
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 58 deletions.
12 changes: 6 additions & 6 deletions module/CLI/config/cli.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
24 changes: 12 additions & 12 deletions module/CLI/config/dependencies.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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',
],
Expand Down
2 changes: 1 addition & 1 deletion module/CLI/src/Command/Config/GenerateCharsetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Shlinkio\Shlink\CLI\Command\Shortcode;
namespace Shlinkio\Shlink\CLI\Command\ShortUrl;

use Shlinkio\Shlink\Core\Exception;
use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface;
Expand All @@ -13,10 +13,10 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Zend\I18n\Translator\TranslatorInterface;

class DeleteShortCodeCommand extends Command
class DeleteShortUrlCommand extends Command
{
public const NAME = 'short-code:delete';
private const ALIASES = [];
public const NAME = 'short-url:delete';
private const ALIASES = ['short-code:delete'];

/**
* @var DeleteShortUrlServiceInterface
Expand Down Expand Up @@ -45,7 +45,7 @@ protected function configure(): void
->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',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Shlinkio\Shlink\CLI\Command\Shortcode;
namespace Shlinkio\Shlink\CLI\Command\ShortUrl;

use Shlinkio\Shlink\Common\Exception\PreviewGenerationException;
use Shlinkio\Shlink\Common\Service\PreviewGeneratorInterface;
Expand All @@ -14,8 +14,8 @@

class GeneratePreviewCommand extends Command
{
public const NAME = 'short-code:process-previews';
private const ALIASES = ['shortcode:process-previews'];
public const NAME = 'short-url:process-previews';
private const ALIASES = ['shortcode:process-previews', 'short-code:process-previews'];

/**
* @var PreviewGeneratorInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Shlinkio\Shlink\CLI\Command\Shortcode;
namespace Shlinkio\Shlink\CLI\Command\ShortUrl;

use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException;
Expand All @@ -16,12 +16,12 @@
use Zend\Diactoros\Uri;
use Zend\I18n\Translator\TranslatorInterface;

class GenerateShortcodeCommand extends Command
class GenerateShortUrlCommand extends Command
{
use ShortUrlBuilderTrait;

public const NAME = 'short-code:generate';
private const ALIASES = ['shortcode:generate'];
public const NAME = 'short-url:generate';
private const ALIASES = ['shortcode:generate', 'short-code:generate'];

/**
* @var UrlShortenerInterface
Expand Down Expand Up @@ -53,7 +53,7 @@ protected function configure(): void
->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(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Shlinkio\Shlink\CLI\Command\Shortcode;
namespace Shlinkio\Shlink\CLI\Command\ShortUrl;

use Shlinkio\Shlink\Common\Util\DateRange;
use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface;
Expand All @@ -15,8 +15,8 @@

class GetVisitsCommand extends Command
{
public const NAME = 'short-code:visits';
private const ALIASES = ['shortcode:visits'];
public const NAME = 'short-url:visits';
private const ALIASES = ['shortcode:visits', 'short-code:visits'];

/**
* @var VisitsTrackerInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Shlinkio\Shlink\CLI\Command\Shortcode;
namespace Shlinkio\Shlink\CLI\Command\ShortUrl;

use Shlinkio\Shlink\Common\Paginator\Adapter\PaginableRepositoryAdapter;
use Shlinkio\Shlink\Common\Paginator\Util\PaginatorUtilsTrait;
Expand All @@ -14,12 +14,12 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Zend\I18n\Translator\TranslatorInterface;

class ListShortcodesCommand extends Command
class ListShortUrlsCommand extends Command
{
use PaginatorUtilsTrait;

public const NAME = 'short-code:list';
private const ALIASES = ['shortcode:list'];
public const NAME = 'short-url:list';
private const ALIASES = ['shortcode:list', 'short-code:list'];

/**
* @var ShortUrlServiceInterface
Expand Down Expand Up @@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void

if ($this->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') . ' <options=bold>%s</>?', $page),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Shlinkio\Shlink\CLI\Command\Shortcode;
namespace Shlinkio\Shlink\CLI\Command\ShortUrl;

use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
Expand All @@ -15,8 +15,8 @@

class ResolveUrlCommand extends Command
{
public const NAME = 'short-code:parse';
private const ALIASES = ['shortcode:parse'];
public const NAME = 'short-url:parse';
private const ALIASES = ['shortcode:parse', 'short-code:parse'];

/**
* @var UrlShortenerInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Shortcode\DeleteShortCodeCommand;
use Shlinkio\Shlink\CLI\Command\ShortUrl\DeleteShortUrlCommand;
use Shlinkio\Shlink\Core\Exception;
use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface;
use Symfony\Component\Console\Application;
Expand All @@ -28,7 +28,7 @@ public function setUp()
{
$this->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);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Shortcode\GeneratePreviewCommand;
use Shlinkio\Shlink\CLI\Command\ShortUrl\GeneratePreviewCommand;
use Shlinkio\Shlink\Common\Exception\PreviewGenerationException;
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Shortcode\GenerateShortcodeCommand;
use Shlinkio\Shlink\CLI\Command\ShortUrl\GenerateShortUrlCommand;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
use Shlinkio\Shlink\Core\Service\UrlShortener;
Expand All @@ -28,7 +28,7 @@ class GenerateShortcodeCommandTest extends TestCase
public function setUp()
{
$this->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',
]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Shortcode\GetVisitsCommand;
use Shlinkio\Shlink\CLI\Command\ShortUrl\GetVisitsCommand;
use Shlinkio\Shlink\Common\Util\DateRange;
use Shlinkio\Shlink\Core\Entity\Visit;
use Shlinkio\Shlink\Core\Entity\VisitLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Shortcode\ListShortcodesCommand;
use Shlinkio\Shlink\CLI\Command\ShortUrl\ListShortUrlsCommand;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
use Symfony\Component\Console\Application;
Expand All @@ -30,7 +30,7 @@ public function setUp()
{
$this->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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);

namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl;

use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Shortcode\ResolveUrlCommand;
use Shlinkio\Shlink\CLI\Command\ShortUrl\ResolveUrlCommand;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
Expand Down

0 comments on commit 1eff980

Please sign in to comment.