From ad8fd43c491bad9a20daa4725329e0465fc23ecc Mon Sep 17 00:00:00 2001 From: Gytautas Date: Mon, 27 May 2024 11:10:38 +0300 Subject: [PATCH] stan error fix --- .php_cs.dist => .php-cs-fixer.dist.php | 0 subscription/Provider/SubscriptionStartDateProvider.php | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (100%) diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 100% rename from .php_cs.dist rename to .php-cs-fixer.dist.php diff --git a/subscription/Provider/SubscriptionStartDateProvider.php b/subscription/Provider/SubscriptionStartDateProvider.php index 61808c347..25c1c620a 100644 --- a/subscription/Provider/SubscriptionStartDateProvider.php +++ b/subscription/Provider/SubscriptionStartDateProvider.php @@ -20,7 +20,6 @@ use DateTimeZone; use Mollie\Adapter\ConfigurationAdapter; use Mollie\Subscription\Config\Config; -use Mollie\Subscription\DTO\Object\Interval; use Mollie\Subscription\Exception\SubscriptionIntervalException; use Mollie\Subscription\Utility\Clock; @@ -33,18 +32,19 @@ class SubscriptionStartDateProvider /** @var ConfigurationAdapter */ private $configuration; - public function __construct(ConfigurationAdapter $configuration, Clock $clock) + public function __construct(ConfigurationAdapter $configuration) { $this->configuration = $configuration; - $this->clock = $clock; } /** * Returns subscription date time * + * @return string + * * @throws SubscriptionIntervalException */ - public function getSubscriptionStartDate(Combination $combination): string + public function getSubscriptionStartDate(Combination $combination) { $currentTime = new DateTime('now', new DateTimeZone('UTC')); @@ -68,6 +68,7 @@ public function getSubscriptionStartDate(Combination $combination): string // Add the interval to the current time $currentTime->add($interval); + return $currentTime->format('Y-m-d'); }