From d3ee82659aea6315b2f5093e8ec45291ee0bd379 Mon Sep 17 00:00:00 2001 From: Max Baldanza Date: Tue, 14 May 2024 19:35:50 +0100 Subject: [PATCH] Formatting changes * Remove docblocks that are no longer needed As we have types already added to the code then the docblocks don't add anything and actually make it harder to maintain * Add CS formatting rules Make sure all classes are consistent by having a new line after the opening tag. At the minute there's a mixture of the two. Removed unused imports * Add phpunit cache to gitignore --- .gitignore | 1 + .php-cs-fixer.dist.php | 2 + examples/common.php | 1 + examples/server/index.php | 1 + examples/server/redirect.php | 1 + examples/server/timeout.php | 1 + src/Ganesha.php | 48 ++------ src/Ganesha/Builder.php | 9 +- src/Ganesha/Configuration.php | 10 +- src/Ganesha/Context.php | 6 +- src/Ganesha/Exception/RejectedException.php | 1 + src/Ganesha/Exception/StorageException.php | 1 + src/Ganesha/GaneshaHttpClient.php | 1 + src/Ganesha/GuzzleMiddleware.php | 5 +- .../GuzzleMiddleware/ServiceNameExtractor.php | 8 +- .../ServiceNameExtractorInterface.php | 8 +- .../HttpClient/FailureDetectorInterface.php | 1 + src/Ganesha/HttpClient/HostTrait.php | 1 + .../HttpClient/RestFailureDetector.php | 1 + .../HttpClient/ServiceNameExtractor.php | 1 + .../ServiceNameExtractorInterface.php | 1 + .../HttpClient/TransportFailureDetector.php | 1 + src/Ganesha/Storage.php | 110 +++--------------- src/Ganesha/Storage/Adapter/Apcu.php | 51 ++------ src/Ganesha/Storage/Adapter/ApcuStore.php | 1 + src/Ganesha/Storage/Adapter/Memcached.php | 31 +---- src/Ganesha/Storage/Adapter/MongoDB.php | 51 -------- src/Ganesha/Storage/Adapter/Redis.php | 33 +----- .../Adapter/SlidingTimeWindowInterface.php | 1 + .../Adapter/TumblingTimeWindowInterface.php | 1 + src/Ganesha/Storage/AdapterInterface.php | 55 ++------- src/Ganesha/Storage/StorageKeys.php | 19 +-- src/Ganesha/Storage/StorageKeysInterface.php | 19 +-- src/Ganesha/Strategy/Count.php | 29 +---- src/Ganesha/Strategy/Count/Builder.php | 14 +-- src/Ganesha/Strategy/Rate.php | 40 +------ src/Ganesha/Strategy/Rate/Builder.php | 18 +-- src/Ganesha/StrategyInterface.php | 21 +--- src/Ganesha/Traits/BuildGanesha.php | 2 +- tests/Ackintosh/Ganesha/BuilderTest.php | 1 + tests/Ackintosh/Ganesha/ConfigurationTest.php | 1 + .../ServiceNameExtractorTest.php | 1 + .../Ganesha/GuzzleMiddlewareTest.php | 1 + .../HttpClient/ServiceNameExtractorTest.php | 1 + .../Ganesha/Storage/Adapter/ApcuStoreTest.php | 1 + .../Ganesha/Storage/Adapter/ApcuTest.php | 1 + .../Ganesha/Storage/Adapter/MemcachedTest.php | 1 + .../Ganesha/Storage/Adapter/MongoDBTest.php | 1 - .../PredisRedisClientInterfaceTestDouble.php | 1 + tests/Ackintosh/Ganesha/StorageTest.php | 1 + .../Ganesha/Strategy/Count/BuilderTest.php | 1 + .../Ganesha/Strategy/Rate/BuilderTest.php | 1 + tests/Ackintosh/Ganesha/Strategy/RateTest.php | 1 + .../Ganesha/Traits/BuildGaneshaTest.php | 1 + tests/Ackintosh/GaneshaTest.php | 1 + tests/bootstrap.php | 1 + 56 files changed, 100 insertions(+), 523 deletions(-) diff --git a/.gitignore b/.gitignore index f68a531..862c3bc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ GTAGS .idea /tmp .php-cs-fixer.cache +.phpunit.result.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 1ef5f36..da70b44 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,6 +10,8 @@ return $config->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, + 'blank_line_after_opening_tag' => true, + 'no_unused_imports' => true, ]) ->setFinder($finder) ; diff --git a/examples/common.php b/examples/common.php index 412e662..7f11243 100644 --- a/examples/common.php +++ b/examples/common.php @@ -1,4 +1,5 @@ strategy = $strategy; } /** - * records failure - * - * @param string $service - * @return void + * Records failure */ - public function failure($service): void + public function failure(string $service): void { try { if ($this->strategy->recordFailure($service) === self::STATUS_TRIPPED) { @@ -76,12 +69,9 @@ public function failure($service): void } /** - * records success - * - * @param string $service - * @return void + * Records success */ - public function success($service): void + public function success(string $service): void { try { if ($this->strategy->recordSuccess($service) === self::STATUS_CALMED_DOWN) { @@ -92,11 +82,7 @@ public function success($service): void } } - /** - * @param string $service - * @return bool - */ - public function isAvailable($service): bool + public function isAvailable(string $service): bool { if (self::$disabled) { return true; @@ -112,21 +98,13 @@ public function isAvailable($service): bool } /** - * @param callable $callable * @psalm-param callable(self::EVENT_*, string, string): void $callable - * @return void */ public function subscribe(callable $callable): void { $this->subscribers[] = $callable; } - /** - * @param string $event - * @param string $service - * @param string $message - * @return void - */ private function notify(string $event, string $service, string $message): void { foreach ($this->subscribers as $s) { @@ -135,9 +113,7 @@ private function notify(string $event, string $service, string $message): void } /** - * disable - * - * @return void + * Disable */ public static function disable(): void { @@ -145,9 +121,7 @@ public static function disable(): void } /** - * enable - * - * @return void + * Enable */ public static function enable(): void { @@ -155,9 +129,7 @@ public static function enable(): void } /** - * resets all counts - * - * @return void + * Resets all counts */ public function reset(): void { diff --git a/src/Ganesha/Builder.php b/src/Ganesha/Builder.php index 59e1909..16fa0e3 100644 --- a/src/Ganesha/Builder.php +++ b/src/Ganesha/Builder.php @@ -1,7 +1,6 @@ strategy = $this->determineStrategyContext($strategyClass, $adapter); diff --git a/src/Ganesha/Exception/RejectedException.php b/src/Ganesha/Exception/RejectedException.php index 807d5cd..0397aee 100644 --- a/src/Ganesha/Exception/RejectedException.php +++ b/src/Ganesha/Exception/RejectedException.php @@ -1,4 +1,5 @@ adapter->loadStatus($this->statusKey($service)); } - /** - * @return void - */ public function reset(): void { $this->adapter->reset(); } - /** - * @return bool - */ public function supportTumblingTimeWindow(): bool { return $this->adapter instanceof TumblingTimeWindowInterface; } - /** - * @return bool - */ public function supportSlidingTimeWindow(): bool { return $this->adapter instanceof SlidingTimeWindowInterface; } - /** - * @param string $service - * @return string - */ private function key(string $service): string { if ($this->serviceNameDecorator) { @@ -272,46 +220,26 @@ private function key(string $service): string return $this->prefix($service); } - /** - * @param string $key - * @return string - */ private function prefix(string $key): string { return $this->storageKeys->prefix() . $key; } - /** - * @param string $service - * @return string - */ private function successKey(string $service): string { return $this->key($service) . $this->storageKeys->success(); } - /** - * @param string $service - * @return string - */ private function failureKey(string $service): string { return $this->key($service) . $this->storageKeys->failure(); } - /** - * @param string $service - * @return string - */ private function rejectionKey(string $service): string { return $this->key($service) . $this->storageKeys->rejection(); } - /** - * @param string $service - * @return string - */ private function lastFailureKey(string $service): string { return $this->supportSlidingTimeWindow() @@ -322,10 +250,6 @@ private function lastFailureKey(string $service): string : $this->prefix($service) . $this->storageKeys->lastFailureTime(); } - /** - * @param string $service - * @return string - */ private function statusKey(string $service): string { return $this->prefix($service) . $this->storageKeys->status(); diff --git a/src/Ganesha/Storage/Adapter/Apcu.php b/src/Ganesha/Storage/Adapter/Apcu.php index 494a44b..edffe8d 100644 --- a/src/Ganesha/Storage/Adapter/Apcu.php +++ b/src/Ganesha/Storage/Adapter/Apcu.php @@ -1,4 +1,5 @@ storageKeys = $context->configuration()->storageKeys(); @@ -58,20 +53,11 @@ public function setConfiguration(Configuration $configuration): void // nop } - /** - * @param string $key - * @return int - */ public function load(string $key): int { return (int) $this->apcuStore->fetch($key); } - /** - * @param string $key - * @param int $count - * @return void - */ public function save(string $key, int $count): void { $result = $this->apcuStore->store($key, $count); @@ -81,10 +67,6 @@ public function save(string $key, int $count): void } } - /** - * @param string $key - * @return void - */ public function increment(string $key): void { $this->apcuStore->inc($key, 1, $success); @@ -95,12 +77,9 @@ public function increment(string $key): void } /** - * decrement failure count + * Decrement failure count * * If the operation would decrease the value below 0, the new value must be 0. - * - * @param string $key - * @return void */ public function decrement(string $key): void { @@ -124,11 +103,7 @@ public function decrement(string $key): void } /** - * sets last failure time - * - * @param string $key - * @param int $lastFailureTime - * @return void + * Sets last failure time */ public function saveLastFailureTime(string $key, int $lastFailureTime): void { @@ -140,10 +115,7 @@ public function saveLastFailureTime(string $key, int $lastFailureTime): void } /** - * returns last failure time - * - * @param string $key - * @return int | null + * Returns last failure time */ public function loadLastFailureTime(string $key): ?int { @@ -151,11 +123,7 @@ public function loadLastFailureTime(string $key): ?int } /** - * sets status - * - * @param string $key - * @param int $status - * @return void + * Sets status */ public function saveStatus(string $key, int $status): void { @@ -167,10 +135,7 @@ public function saveStatus(string $key, int $status): void } /** - * returns status - * - * @param string $key - * @return int + * Returns status */ public function loadStatus(string $key): int { @@ -188,9 +153,7 @@ public function loadStatus(string $key): int } /** - * resets all counts - * - * @return void + * Resets all counts */ public function reset(): void { diff --git a/src/Ganesha/Storage/Adapter/ApcuStore.php b/src/Ganesha/Storage/Adapter/ApcuStore.php index c4f565e..8d6a684 100644 --- a/src/Ganesha/Storage/Adapter/ApcuStore.php +++ b/src/Ganesha/Storage/Adapter/ApcuStore.php @@ -1,4 +1,5 @@ memcached = $memcached; } - /** - * @return bool - */ public function supportCountStrategy(): bool { return true; } - /** - * @return bool - */ public function supportRateStrategy(): bool { return true; } /** - * @param Ganesha\Context $context - * @return void * @codeCoverageIgnore */ public function setContext(Ganesha\Context $context): void @@ -66,8 +55,6 @@ public function setConfiguration(Configuration $configuration): void } /** - * @param string $service - * @return int * @throws StorageException */ public function load(string $service): int @@ -78,9 +65,6 @@ public function load(string $service): int } /** - * @param string $service - * @param int $count - * @return void * @throws StorageException */ public function save(string $service, int $count): void @@ -91,8 +75,6 @@ public function save(string $service, int $count): void } /** - * @param string $service - * @return void * @throws StorageException */ public function increment(string $service): void @@ -110,8 +92,6 @@ public function increment(string $service): void } /** - * @param string $service - * @return void * @throws StorageException */ public function decrement(string $service): void @@ -123,8 +103,6 @@ public function decrement(string $service): void } /** - * @param string $service - * @param int $lastFailureTime * @throws StorageException */ public function saveLastFailureTime(string $service, int $lastFailureTime): void @@ -135,8 +113,6 @@ public function saveLastFailureTime(string $service, int $lastFailureTime): void } /** - * @param string $service - * @return int * @throws StorageException */ public function loadLastFailureTime(string $service): int @@ -147,8 +123,6 @@ public function loadLastFailureTime(string $service): int } /** - * @param string $service - * @param int $status * @throws StorageException */ public function saveStatus(string $service, int $status): void @@ -159,8 +133,6 @@ public function saveStatus(string $service, int $status): void } /** - * @param string $service - * @return int * @throws StorageException */ public function loadStatus(string $service): int @@ -225,7 +197,6 @@ public function isGaneshaData(string $key): bool /** * Throws an exception if some error occurs in memcached. * - * @return void * @throws StorageException */ private function throwExceptionIfErrorOccurred(): void diff --git a/src/Ganesha/Storage/Adapter/MongoDB.php b/src/Ganesha/Storage/Adapter/MongoDB.php index 1d1217c..8c8564a 100644 --- a/src/Ganesha/Storage/Adapter/MongoDB.php +++ b/src/Ganesha/Storage/Adapter/MongoDB.php @@ -25,12 +25,6 @@ class MongoDB implements AdapterInterface, TumblingTimeWindowInterface, SlidingT */ private $collectionName; - /** - * MongoDB constructor. - * @param \MongoDB\Driver\Manager $manager - * @param string $dbName - * @param string $collectionName - */ public function __construct(\MongoDB\Driver\Manager $manager, string $dbName, string $collectionName) { $this->manager = $manager; @@ -38,25 +32,17 @@ public function __construct(\MongoDB\Driver\Manager $manager, string $dbName, st $this->collectionName = $collectionName; } - /** - * @return bool - */ public function supportCountStrategy(): bool { return true; } - /** - * @return bool - */ public function supportRateStrategy(): bool { return true; } /** - * @param Ganesha\Context $context - * @return void * @codeCoverageIgnore */ public function setContext(Ganesha\Context $context): void @@ -73,8 +59,6 @@ public function setConfiguration(Configuration $configuration): void } /** - * @param string $service - * @return int * @throws StorageException */ public function load(string $service): int @@ -93,9 +77,6 @@ public function load(string $service): int } /** - * @param string $service - * @param int $count - * @return void * @throws StorageException */ public function save(string $service, int $count): void @@ -104,8 +85,6 @@ public function save(string $service, int $count): void } /** - * @param string $service - * @return void * @throws StorageException */ public function increment(string $service): void @@ -114,8 +93,6 @@ public function increment(string $service): void } /** - * @param string $service - * @return void * @throws StorageException */ public function decrement(string $service): void @@ -124,8 +101,6 @@ public function decrement(string $service): void } /** - * @param string $service - * @param int $lastFailureTime * @throws StorageException */ public function saveLastFailureTime(string $service, int $lastFailureTime): void @@ -134,8 +109,6 @@ public function saveLastFailureTime(string $service, int $lastFailureTime): void } /** - * @param string $service - * @return int * @throws StorageException */ public function loadLastFailureTime(string $service): int @@ -153,8 +126,6 @@ public function loadLastFailureTime(string $service): int } /** - * @param string $service - * @param int $status * @throws StorageException */ public function saveStatus(string $service, int $status): void @@ -163,8 +134,6 @@ public function saveStatus(string $service, int $status): void } /** - * @param string $service - * @return int * @throws StorageException */ public function loadStatus(string $service): int @@ -193,11 +162,6 @@ private function getNamespace(): string return $this->dbName . '.' . $this->collectionName; } - /** - * @param $filter - * @param array $queryOptions - * @return \MongoDB\Driver\Cursor - */ private function read(array $filter, array $queryOptions = []): Cursor { try { @@ -210,31 +174,16 @@ private function read(array $filter, array $queryOptions = []): Cursor } } - /** - * @param $filter - * @param array $deleteOptions - * @return void - */ private function delete(array $filter, array $deleteOptions = []): void { $this->bulkWrite($filter, $options = ['deleteOptions' => $deleteOptions], 'delete'); } - /** - * @param $filter - * @param $newObj - * @param array $updateOptions - */ private function update(array $filter, array $newObj, array $updateOptions = ['multi' => false, 'upsert' => true]): void { $this->bulkWrite($filter, $options = ['newObj' => $newObj, 'updateOptions' => $updateOptions], 'update'); } - /** - * @param $filter - * @param array $options - * @param string $command - */ private function bulkWrite(array $filter, array $options, string $command): void { try { diff --git a/src/Ganesha/Storage/Adapter/Redis.php b/src/Ganesha/Storage/Adapter/Redis.php index b91bde1..0bba62e 100644 --- a/src/Ganesha/Storage/Adapter/Redis.php +++ b/src/Ganesha/Storage/Adapter/Redis.php @@ -31,26 +31,16 @@ public function __construct($redis) $this->redis = $redis; } - /** - * @return bool - */ public function supportCountStrategy(): bool { return false; } - /** - * @return bool - */ public function supportRateStrategy(): bool { return true; } - /** - * @param Ganesha\Context $context - * @return void - */ public function setContext(Ganesha\Context $context): void { $this->configuration = $context->configuration(); @@ -65,9 +55,6 @@ public function setConfiguration(Configuration $configuration): void } /** - * @param string $service - * - * @return int * @throws StorageException */ public function load(string $service): int @@ -83,19 +70,12 @@ public function load(string $service): int return $r; } - /** - * @param string $service - * @param int $count - * @return void - */ public function save(string $service, int $count): void { // Redis adapter does not support Count strategy } /** - * @param string $service - * * @throws StorageException */ public function increment(string $service): void @@ -118,12 +98,9 @@ public function saveLastFailureTime(string $service, int $lastFailureTime): void } /** - * @param $service - * - * @return int|null * @throws StorageException */ - public function loadLastFailureTime(string $service) + public function loadLastFailureTime(string $service): ?int { $lastFailure = $this->redis->zRange($service, -1, -1); @@ -135,9 +112,6 @@ public function loadLastFailureTime(string $service) } /** - * @param string $service - * @param int $status - * * @throws StorageException */ public function saveStatus(string $service, int $status): void @@ -154,9 +128,6 @@ public function saveStatus(string $service, int $status): void } /** - * @param string $service - * - * @return int * @throws StorageException */ public function loadStatus(string $service): int @@ -179,8 +150,6 @@ public function reset(): void } /** - * @param string $service - * * @throws StorageException */ private function removeExpiredElements(string $service): void diff --git a/src/Ganesha/Storage/Adapter/SlidingTimeWindowInterface.php b/src/Ganesha/Storage/Adapter/SlidingTimeWindowInterface.php index 7ad5b8f..d15abad 100644 --- a/src/Ganesha/Storage/Adapter/SlidingTimeWindowInterface.php +++ b/src/Ganesha/Storage/Adapter/SlidingTimeWindowInterface.php @@ -1,4 +1,5 @@ configuration = $configuration; $this->storage = $storage; } - /** - * @param Storage\AdapterInterface $adapter - * @param Configuration $configuration - * @return Count - */ public static function create(Storage\AdapterInterface $adapter, Configuration $configuration): StrategyInterface { return new self( @@ -46,10 +38,6 @@ public static function create(Storage\AdapterInterface $adapter, Configuration $ ); } - /** - * @param string $service - * @return int - */ public function recordFailure(string $service): int { $this->storage->setLastFailureTime($service, time()); @@ -65,10 +53,6 @@ public function recordFailure(string $service): int return Ganesha::STATUS_CALMED_DOWN; } - /** - * @param string $service - * @return int - */ public function recordSuccess(string $service): ?int { $this->storage->decrementFailureCount($service); @@ -84,26 +68,17 @@ public function recordSuccess(string $service): ?int return null; } - /** - * @return void - */ public function reset(): void { $this->storage->reset(); } - /** - * @param string $service - * @return bool - */ public function isAvailable(string $service): bool { return $this->isClosed($service) || $this->isHalfOpen($service); } /** - * @param string $service - * @return bool * @throws StorageException */ private function isClosed(string $service): bool @@ -112,8 +87,6 @@ private function isClosed(string $service): bool } /** - * @param string $service - * @return bool * @throws StorageException */ private function isHalfOpen(string $service): bool diff --git a/src/Ganesha/Strategy/Count/Builder.php b/src/Ganesha/Strategy/Count/Builder.php index 7c62cfb..b26d869 100644 --- a/src/Ganesha/Strategy/Count/Builder.php +++ b/src/Ganesha/Strategy/Count/Builder.php @@ -1,4 +1,5 @@ $failureCountThreshold - * @return $this */ public function failureCountThreshold(int $failureCountThreshold): self { @@ -50,9 +46,7 @@ public function failureCountThreshold(int $failureCountThreshold): self } /** - * @param int $intervalToHalfOpen * @psalm-param int<1, max> $intervalToHalfOpen - * @return $this */ public function intervalToHalfOpen(int $intervalToHalfOpen): self { @@ -60,10 +54,6 @@ public function intervalToHalfOpen(int $intervalToHalfOpen): self return $this; } - /** - * @param Ganesha\Storage\StorageKeysInterface $storageKeys - * @return $this - */ public function storageKeys(Ganesha\Storage\StorageKeysInterface $storageKeys): self { $this->params[Configuration::STORAGE_KEYS] = $storageKeys; diff --git a/src/Ganesha/Strategy/Rate.php b/src/Ganesha/Strategy/Rate.php index b66f96d..4093063 100644 --- a/src/Ganesha/Strategy/Rate.php +++ b/src/Ganesha/Strategy/Rate.php @@ -1,4 +1,5 @@ timeWindow()) : null; @@ -77,10 +72,6 @@ public static function create(Storage\AdapterInterface $adapter, Configuration $ ); } - /** - * @param string $service - * @return int - */ public function recordFailure(string $service): int { $this->storage->setLastFailureTime($service, time()); @@ -96,10 +87,6 @@ public function recordFailure(string $service): int return Ganesha::STATUS_CALMED_DOWN; } - /** - * @param string $service - * @return int - */ public function recordSuccess(string $service): ?int { $this->storage->incrementSuccessCount($service); @@ -115,18 +102,11 @@ public function recordSuccess(string $service): ?int return null; } - /** - * @return void - */ public function reset(): void { $this->storage->reset(); } - /** - * @param string $service - * @return bool - */ public function isAvailable(string $service): bool { if ($this->isClosed($service) || $this->isHalfOpen($service)) { @@ -138,8 +118,6 @@ public function isAvailable(string $service): bool } /** - * @param string $service - * @return bool * @throws StorageException * @throws \LogicException */ @@ -162,10 +140,6 @@ private function isClosed(string $service): bool } } - /** - * @param string $service - * @return bool - */ private function isClosedInCurrentTimeWindow(string $service): bool { $failure = $this->storage->getFailureCount($service); @@ -182,10 +156,6 @@ private function isClosedInCurrentTimeWindow(string $service): bool return $this->isClosedInTimeWindow($failure, $success, $rejection); } - /** - * @param string $service - * @return bool - */ private function isClosedInPreviousTimeWindow(string $service): bool { $failure = $this->storage->getFailureCountByCustomKey(self::keyForPreviousTimeWindow($service, $this->configuration->timeWindow())); @@ -202,12 +172,6 @@ private function isClosedInPreviousTimeWindow(string $service): bool return $this->isClosedInTimeWindow($failure, $success, $rejection); } - /** - * @param int $failure - * @param int $success - * @param int $rejection - * @return bool - */ private function isClosedInTimeWindow(int $failure, int $success, int $rejection): bool { if (($failure + $success + $rejection) < $this->configuration->minimumRequests()) { @@ -222,8 +186,6 @@ private function isClosedInTimeWindow(int $failure, int $success, int $rejection } /** - * @param string $service - * @return bool * @throws StorageException */ private function isHalfOpen(string $service): bool diff --git a/src/Ganesha/Strategy/Rate/Builder.php b/src/Ganesha/Strategy/Rate/Builder.php index 754b5bc..0344223 100644 --- a/src/Ganesha/Strategy/Rate/Builder.php +++ b/src/Ganesha/Strategy/Rate/Builder.php @@ -1,4 +1,5 @@ $failureRateThreshold - * @return $this */ public function failureRateThreshold(int $failureRateThreshold): self { @@ -55,9 +51,7 @@ public function failureRateThreshold(int $failureRateThreshold): self } /** - * @param int $intervalToHalfOpen * @psalm-param int<1, max> $intervalToHalfOpen - * @return $this */ public function intervalToHalfOpen(int $intervalToHalfOpen): self { @@ -65,10 +59,6 @@ public function intervalToHalfOpen(int $intervalToHalfOpen): self return $this; } - /** - * @param StorageKeysInterface $storageKeys - * @return $this - */ public function storageKeys(StorageKeysInterface $storageKeys): self { $this->params[Configuration::STORAGE_KEYS] = $storageKeys; @@ -76,9 +66,7 @@ public function storageKeys(StorageKeysInterface $storageKeys): self } /** - * @param int $minimumRequests * @psalm-param int<1, max> $minimumRequests - * @return $this */ public function minimumRequests(int $minimumRequests): self { @@ -87,9 +75,7 @@ public function minimumRequests(int $minimumRequests): self } /** - * @param int $timeWindow * @psalm-param int<1, max> $timeWindow - * @return $this */ public function timeWindow(int $timeWindow): self { diff --git a/src/Ganesha/StrategyInterface.php b/src/Ganesha/StrategyInterface.php index 69b087f..3a555d1 100644 --- a/src/Ganesha/StrategyInterface.php +++ b/src/Ganesha/StrategyInterface.php @@ -1,37 +1,18 @@