diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec708ee..c82e609 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,16 +6,16 @@ on: jobs: run-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - php: [ "8.0", "8.1", "8.2" ] + php: [ "8.0", "8.1", "8.2", "8.3", "8.4" ] composer_flags: [ "", "--prefer-lowest" ] - symfony_version: [ "^5.4", "^6.1" ] + symfony_version: [ "^5.4", "^6.4" ] exclude: - php: "8.0" - symfony_version: "^6.1" + symfony_version: "^6.4" name: PHP ${{ matrix.php }} SF ${{ matrix.symfony_version }} ${{ matrix.composer_flags}} env: PHP: ${{ matrix.os }} @@ -38,8 +38,11 @@ jobs: run: | composer self-update if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi; - if [ "$SYMFONY_VERSION" = "^6.1" ]; then composer remove --dev "friendsofsymfony/oauth-server-bundle" --no-update; fi; + if [ "$SYMFONY_VERSION" = "^6.4" ]; then composer remove --dev "friendsofsymfony/oauth-server-bundle" --no-update; fi; COMPOSER_MEMORY_LIMIT=-1 composer update --prefer-dist --no-interaction $COMPOSER_FLAGS + - name: Static analysis + run: | + ./vendor/bin/phpstan --memory-limit=-1 - name: Run tests run: | SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index c9456f4..dc4a2c5 100755 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -20,13 +20,9 @@ class Configuration implements ConfigurationInterface public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('noxlogic_rate_limit'); - // Keep compatibility with symfony/config < 4.2 - if (\method_exists($treeBuilder, 'getRootNode')) { - $rootNode = $treeBuilder->getRootNode(); - } else { - $rootNode = $treeBuilder->root('noxlogic_rate_limit'); - } - $rootNode + $rootNode = $treeBuilder->getRootNode(); + + $rootNode // @phpstan-ignore method.notFound ->canBeDisabled() ->children() ->enumNode('storage_engine') diff --git a/DependencyInjection/NoxlogicRateLimitExtension.php b/DependencyInjection/NoxlogicRateLimitExtension.php index 8042930..077a399 100755 --- a/DependencyInjection/NoxlogicRateLimitExtension.php +++ b/DependencyInjection/NoxlogicRateLimitExtension.php @@ -17,6 +17,7 @@ class NoxlogicRateLimitExtension extends Extension { /** * {@inheritDoc} + * @param mixed[][] $configs */ public function load(array $configs, ContainerBuilder $container): void { diff --git a/EventListener/HeaderModificationListener.php b/EventListener/HeaderModificationListener.php index 1043eb8..11f3523 100644 --- a/EventListener/HeaderModificationListener.php +++ b/EventListener/HeaderModificationListener.php @@ -3,7 +3,6 @@ namespace Noxlogic\RateLimitBundle\EventListener; use Noxlogic\RateLimitBundle\Service\RateLimitInfo; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; class HeaderModificationListener extends BaseListener @@ -18,7 +17,7 @@ public function __construct($defaultParameters = array()) } /** - * @param FilterResponseEvent|ResponseEvent $event + * @param ResponseEvent $event */ public function onKernelResponse($event) { @@ -44,7 +43,7 @@ public function onKernelResponse($event) $response = $event->getResponse(); $response->headers->set($this->getParameter('header_limit_name'), $rateLimitInfo->getLimit()); - $response->headers->set($this->getParameter('header_remaining_name'), $remaining); + $response->headers->set($this->getParameter('header_remaining_name'), (string) $remaining); $response->headers->set($this->getParameter('header_reset_name'), $rateLimitInfo->getResetTimestamp()); } } diff --git a/Events/CheckedRateLimitEvent.php b/Events/CheckedRateLimitEvent.php index 012b6fa..2737c25 100644 --- a/Events/CheckedRateLimitEvent.php +++ b/Events/CheckedRateLimitEvent.php @@ -12,7 +12,7 @@ class CheckedRateLimitEvent extends Event protected ?RateLimit $rateLimit; - public function __construct(Request $request, RateLimit $rateLimit = null) + public function __construct(Request $request, ?RateLimit $rateLimit = null) { $this->request = $request; $this->rateLimit = $rateLimit; diff --git a/Service/RateLimitService.php b/Service/RateLimitService.php index 1dcf891..eced9f8 100644 --- a/Service/RateLimitService.php +++ b/Service/RateLimitService.php @@ -7,7 +7,7 @@ class RateLimitService { /** - * @var Storage\StorageInterface + * @var ?Storage\StorageInterface */ protected $storage; @@ -20,7 +20,7 @@ public function setStorage(StorageInterface $storage) } /** - * @return StorageInterface + * @return ?StorageInterface */ public function getStorage() { diff --git a/Service/Storage/PhpRedis.php b/Service/Storage/PhpRedis.php index a0910b9..dc1e018 100644 --- a/Service/Storage/PhpRedis.php +++ b/Service/Storage/PhpRedis.php @@ -9,7 +9,7 @@ class PhpRedis implements StorageInterface { /** - * @var \Redis + * @var \Redis|\RedisCluster */ protected $client; diff --git a/Service/Storage/Redis.php b/Service/Storage/Redis.php index 8237b6d..d510f5b 100644 --- a/Service/Storage/Redis.php +++ b/Service/Storage/Redis.php @@ -55,9 +55,9 @@ public function createRate($key, $limit, $period) $reset = time() + $period; - $this->client->hset($key, 'limit', $limit); - $this->client->hset($key, 'calls', 1); - $this->client->hset($key, 'reset', $reset); + $this->client->hset($key, 'limit', (string) $limit); + $this->client->hset($key, 'calls', '1'); + $this->client->hset($key, 'reset', (string) $reset); $this->client->expire($key, $period); $rateLimitInfo = new RateLimitInfo(); diff --git a/Service/Storage/StorageInterface.php b/Service/Storage/StorageInterface.php index 5691c3e..ec93424 100644 --- a/Service/Storage/StorageInterface.php +++ b/Service/Storage/StorageInterface.php @@ -9,16 +9,18 @@ interface StorageInterface /** * Get information about the current rate * - * @param string $key - * @return RateLimitInfo Rate limit information - */ + * @param string $key + * @return RateLimitInfo|bool Rate limit information + * @todo: Replace return type with RateLimitInfo|false when PHP 8.2 is the minimum version + */ public function getRateInfo($key); /** * Limit the rate by one * - * @param string $key - * @return RateLimitInfo Rate limit info + * @param string $key + * @return RateLimitInfo|bool Rate limit info + * @todo: Replace return type with RateLimitInfo|false when PHP 8.2 is the minimum version */ public function limitRate($key); diff --git a/Tests/EventListener/HeaderModificationListenerTest.php b/Tests/EventListener/HeaderModificationListenerTest.php index 945e696..b199523 100644 --- a/Tests/EventListener/HeaderModificationListenerTest.php +++ b/Tests/EventListener/HeaderModificationListenerTest.php @@ -3,13 +3,11 @@ namespace Noxlogic\RateLimitBundle\Tests\EventListener; use Noxlogic\RateLimitBundle\EventListener\HeaderModificationListener; -use Noxlogic\RateLimitBundle\Events\ProxyFilterResponseEvent; use Noxlogic\RateLimitBundle\Service\RateLimitInfo; use Noxlogic\RateLimitBundle\Tests\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\ControllerEvent; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; @@ -136,19 +134,15 @@ public function testListenerWithoutRateInfo() } /** - * @return FilterResponseEvent|ControllerEvent + * @return ResponseEvent */ protected function createEvent() { - $kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->getMock(); + $kernel = $this->getMockBuilder(HttpKernelInterface::class)->getMock(); $request = new Request(); $response = new Response(); - if (class_exists('Symfony\\Component\\HttpKernel\\Event\\ControllerEvent')) { - $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response); - } else { - $event = new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response); - } + $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); return $event; } diff --git a/composer.json b/composer.json index 8a6998e..3a6156e 100644 --- a/composer.json +++ b/composer.json @@ -12,15 +12,16 @@ ], "require": { "php": "^8.0", - "symfony/framework-bundle": "^5.4.2|^6.1" + "symfony/framework-bundle": "^5.4.2|^6.4" }, "require-dev": { "symfony/phpunit-bridge": ">=5.4", "psr/simple-cache": "^1.0|^2.0", "doctrine/cache": "^1.5", "psr/cache": "^1.0|^2.0", - "predis/predis": "^0.8|^1.1|^2.0", - "friendsofsymfony/oauth-server-bundle": "^1.5|^2.0@dev" + "predis/predis": "^1.1|^2.0", + "friendsofsymfony/oauth-server-bundle": "^1.5|^2.0@dev", + "phpstan/phpstan": "^2.1" }, "suggest": { "snc/redis-bundle": "Use Redis as a storage engine.", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..f3cd5f7 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,445 @@ +parameters: + ignoreErrors: + - + message: '#^Method Noxlogic\\RateLimitBundle\\Attribute\\RateLimit\:\:__construct\(\) has parameter \$methods with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Attribute/RateLimit.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Attribute\\RateLimit\:\:getMethods\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Attribute/RateLimit.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Attribute\\RateLimit\:\:setMethods\(\) has parameter \$methods with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Attribute/RateLimit.php + + - + message: '#^Property Noxlogic\\RateLimitBundle\\Attribute\\RateLimit\:\:\$methods type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Attribute/RateLimit.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\DependencyInjection\\NoxlogicRateLimitExtension\:\:loadServices\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: DependencyInjection/NoxlogicRateLimitExtension.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\BaseListener\:\:getParameter\(\) has parameter \$name with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: EventListener/BaseListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\BaseListener\:\:setParameter\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: EventListener/BaseListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\BaseListener\:\:setParameter\(\) has parameter \$name with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: EventListener/BaseListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\BaseListener\:\:setParameter\(\) has parameter \$value with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: EventListener/BaseListener.php + + - + message: '#^Property Noxlogic\\RateLimitBundle\\EventListener\\BaseListener\:\:\$parameters type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: EventListener/BaseListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\HeaderModificationListener\:\:__construct\(\) has parameter \$defaultParameters with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: EventListener/HeaderModificationListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\HeaderModificationListener\:\:onKernelResponse\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: EventListener/HeaderModificationListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\EventListener\\RateLimitAnnotationListener\:\:getRateLimitsFromAttributes\(\) has parameter \$controller with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: EventListener/RateLimitAnnotationListener.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Events\\GenerateKeyEvent\:\:__construct\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Events/GenerateKeyEvent.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Events\\GenerateKeyEvent\:\:__construct\(\) has parameter \$payload with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Events/GenerateKeyEvent.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Events\\GenerateKeyEvent\:\:addToKey\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Events/GenerateKeyEvent.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Events\\GenerateKeyEvent\:\:addToKey\(\) has parameter \$part with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Events/GenerateKeyEvent.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Events\\GenerateKeyEvent\:\:setKey\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Events/GenerateKeyEvent.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitInfo\:\:setCalls\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitInfo.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitInfo\:\:setLimit\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitInfo.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitInfo\:\:setResetTimestamp\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitInfo.php + + - + message: '#^Property Noxlogic\\RateLimitBundle\\Service\\RateLimitInfo\:\:\$calls has no type specified\.$#' + identifier: missingType.property + count: 1 + path: Service/RateLimitInfo.php + + - + message: '#^Property Noxlogic\\RateLimitBundle\\Service\\RateLimitInfo\:\:\$limit has no type specified\.$#' + identifier: missingType.property + count: 1 + path: Service/RateLimitInfo.php + + - + message: '#^Property Noxlogic\\RateLimitBundle\\Service\\RateLimitInfo\:\:\$resetTimestamp has no type specified\.$#' + identifier: missingType.property + count: 1 + path: Service/RateLimitInfo.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:createRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:createRate\(\) has parameter \$limit with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:createRate\(\) has parameter \$period with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:limitRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:limitRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\RateLimitService\:\:setStorage\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/RateLimitService.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\DoctrineCache\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/DoctrineCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\DoctrineCache\:\:createRateInfo\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/DoctrineCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\DoctrineCache\:\:createRateInfo\(\) has parameter \$info with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Service/Storage/DoctrineCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\DoctrineCache\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/DoctrineCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\DoctrineCache\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/DoctrineCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Memcache\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/Memcache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Memcache\:\:createRateInfo\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/Memcache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Memcache\:\:createRateInfo\(\) has parameter \$info with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Service/Storage/Memcache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Memcache\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/Memcache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Memcache\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/Memcache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PhpRedis\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/PhpRedis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PhpRedis\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/PhpRedis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PhpRedis\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/PhpRedis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PhpRedis\:\:sanitizeRedisKey\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/PhpRedis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PsrCache\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/PsrCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PsrCache\:\:createRateInfo\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/PsrCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PsrCache\:\:createRateInfo\(\) has parameter \$info with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Service/Storage/PsrCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PsrCache\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/PsrCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\PsrCache\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/PsrCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Redis\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/Redis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Redis\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/Redis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Redis\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/Redis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\Redis\:\:sanitizeRedisKey\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/Redis.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\SimpleCache\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/SimpleCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\SimpleCache\:\:createRateInfo\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/SimpleCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\SimpleCache\:\:createRateInfo\(\) has parameter \$info with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Service/Storage/SimpleCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\SimpleCache\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/SimpleCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\SimpleCache\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/SimpleCache.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\StorageInterface\:\:createRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/StorageInterface.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\StorageInterface\:\:resetRate\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Service/Storage/StorageInterface.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Service\\Storage\\StorageInterface\:\:resetRate\(\) has parameter \$key with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Service/Storage/StorageInterface.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:__construct\(\) has parameter \$pathLimits with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:getMatchedPath\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:methodMatched\(\) has parameter \$expectedMethods with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:methodMatched\(\) has parameter \$method with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:pathMatched\(\) has parameter \$expectedPath with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:pathMatched\(\) has parameter \$path with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:requestMatched\(\) has parameter \$method with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:requestMatched\(\) has parameter \$path with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Method Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:requestMatched\(\) has parameter \$pathLimit with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: Util/PathLimitProcessor.php + + - + message: '#^Property Noxlogic\\RateLimitBundle\\Util\\PathLimitProcessor\:\:\$pathLimits type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: Util/PathLimitProcessor.php diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 0000000..8704079 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,15 @@ +parameters: + level: 6 + paths: + - Attribute/ + - DependencyInjection/ + - EventListener/ + - Events/ + - Exception/ + - Resources/ + - Service/ + - Util/ + excludePaths: + - EventListener/OauthKeyGenerateListener.php +includes: + - phpstan-baseline.neon