bug #38507 [Bug] Fix RateLimiter framework configuration (bobvandevijver)

This PR was merged into the 5.x branch.

Discussion
----------

[Bug] Fix RateLimiter framework configuration

| Q             | A
| ------------- | ---
| Branch?       | 5.x for features <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |  - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | -

Small mistake in the rate limiter configuration, instead of unsetting the `storage_service` option the never existing `storage` option was unset, resulting into an application error when trying to use a Limiter in your application.

The exception was:
```
Uncaught PHP Exception: The option "storage_service" does not exist. Defined options are: "id", "interval", "limit", "rate", "strategy"."
```

This was introduced in #38204, so a highlight for @wouterj to check this :)

Commits
-------

b360320890 [Bug] Fix RateLimiter framework configuration
This commit is contained in:
Fabien Potencier 2020-10-11 07:57:58 +02:00
commit d1f2fafcaa

View File

@ -2269,7 +2269,7 @@ class FrameworkExtension extends Extension
} }
$limiter->replaceArgument(1, new Reference($storageId)); $limiter->replaceArgument(1, new Reference($storageId));
unset($limiterConfig['storage']); unset($limiterConfig['storage_service']);
unset($limiterConfig['cache_pool']); unset($limiterConfig['cache_pool']);
$limiterConfig['id'] = $name; $limiterConfig['id'] = $name;