From 4c00764146cf3a883bea896e6def132646a6d8a7 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 30 Jul 2021 18:40:26 +0200 Subject: [PATCH] Removed hardcoded dependency --- composer.json | 1 - module/Core/src/Model/ShortUrlIdentifier.php | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f71ffde0..1dbe2aa8 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,6 @@ "endroid/qr-code": "^4.0", "geoip2/geoip2": "^2.9", "guzzlehttp/guzzle": "^7.0", - "guzzlehttp/psr7": "^1.7", "happyr/doctrine-specification": "^2.0", "jaybizzle/crawler-detect": "^1.2", "laminas/laminas-config": "^3.3", diff --git a/module/Core/src/Model/ShortUrlIdentifier.php b/module/Core/src/Model/ShortUrlIdentifier.php index e0d6c9b4..815a5313 100644 --- a/module/Core/src/Model/ShortUrlIdentifier.php +++ b/module/Core/src/Model/ShortUrlIdentifier.php @@ -32,7 +32,11 @@ final class ShortUrlIdentifier public static function fromCli(InputInterface $input): self { + // Using getArguments and getOptions instead of getArgument(...) and getOption(...) because + // the later throw an exception if requested options are not defined + /** @var string $shortCode */ $shortCode = $input->getArguments()['shortCode'] ?? ''; + /** @var string|null $domain */ $domain = $input->getOptions()['domain'] ?? null; return new self($shortCode, $domain);