This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[Routing] allow extending Route attribute
| Q | A
| ------------- | ---
| Branch? | 5.x <!-- see below -->
| Bug fix? | no
| 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 | <!-- required for new features -->
There is probably missed `\ReflectionAttribute::IS_INSTANCEOF` parameter and because of that Route attribute class could not be extended. This could be used by some popular bundles like `FOSRestBundle` for example. Right
now it's not possible to add attributes support there like it was before (extending Route Annotation).
Commits
-------
d733b78f88 [Routing] allow extending Route attribute
This PR was merged into the 5.3-dev branch.
Discussion
----------
[OptionsResolver] Add prototype definition support for nested options
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#34207
| License | MIT
| Doc PR | symfony/symfony-docs#...
This proposal adds a new method `setPrototype(true)` to the `OptionsResolver` component to mark options definition as array prototype:
```php
$this->resolver
->setDefault('connections', static function (OptionsResolver $resolver) { // nested option
$resolver
->setPrototype(true) // <- the new method
->setRequired('table')
->setDefaults(['user' => 'root', 'password' => null]);
})
;
```
This feature will allow passing options this way:
```php
$this->resolver->resolve([
'connections' => [
'default' => [ // <- the array index "default" is optional and validation free
'table' => 'default',
],
'custom' => [
'user' => 'foo',
'password' => 'pa$$',
'table' => 'symfony',
],
],
])
```
You can add as many items as you want with the advantage of validating each item according to its prototype definition.
The result for this example would be:
```php
[
'connections' => [
'default' => [
'user' => 'root',
'password' => null,
'table' => 'default',
],
'custom' => [
'user' => 'foo',
'password' => 'pa$$',
'table' => 'symfony',
],
],
]
```
This feature is feasible only for nested options so far and the nested option (e.g. "connections") must be of type array of array.
See the test cases for more details about this feature.
Cheers!
Commits
-------
29d41b1970 Add prototype definition support for nested options
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Small phpdoc improvement
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I have been looking for a way to emulate `$_REQUEST` in Symfony, and I always thought the `get` method is useless for that, because it only looks at some custom routing stuff, GET and whatever BODY might be. Only today I actually looked at the source code and found out that it's actually (almost) doing what I was looking for, i.e. check `$_GET`, and then `$_POST`. So I figured it would be good to be a bit more explicit in the phpdoc (analoguous to the phpdoc for `$request->request`, which says "Request body parameters ($_POST).").
Commits
-------
a53f256b4b Small phpdoc imporvement
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PasswordHasher] accept hashing passwords with nul bytes or longer than 72 bytes when using bcrypt
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This limitation of bcrypt creates a risk for migrations. But we can remove it, so here we are.
Commits
-------
a5d3b89472 [PasswordHasher] accept hashing passwords with nul bytes or longer than 72 bytes when using bcrypt
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Config] Remove unused sprintf + coding standards
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
A few things I noticed, redundant `sprintf` and variable and coding standards.
Commits
-------
17479e2bb5 Minor code cleanup
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Translation] [Loco] Remove SCHEME const
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
For consistency, we do it this way in mailer and notifier
cc `@welcoMattic`
Commits
-------
34be4a5120 [Translation] [Loco] Remove SCHEME const
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[Config] [ConfigBuilder] Set FQCN as properties type instead of class name
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40921
| License | MIT
| Doc PR | N/A
Commits
-------
e9aa1c5771 [Config] [ConfigBuilder] Set FQCN as properties type instead of class name
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Translation] Use proven DSN class from Notifier and rename package
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | ---
This class is already in use, no need to introduce it as experimental
cc `@welcoMattic`
Commits
-------
a7979c44de [Translation] Use proven DSN class from Notifier
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Config] Builder: Remove typehints and allow for EnvConfigurator
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes -- maybe
| New feature? | no -- maybe =)
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
When [writing documentation](https://github.com/symfony/symfony-docs/pull/15269#discussion_r617887301) we found that we don't really support environment variables in the leaves. Ie, we expect a boolean but you provide `"%env(ENABLE_FOO)%"`
This PR will also introduce `ParamConfigurator` to allow parameters to be passed as config.
The changes to the generated code:
```diff
/**
+ * `@param` bool|ParamConfigurator $value
* `@default` false
* `@return` $this
*/
- public function enabled(bool $value): self
+ public function enabled($value): self
{
$this->enabled = $value;
return $this;
}
```
Commits
-------
59b79d35a7 [Config] Builder: Remove typehints and allow for EnvConfigurator
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PasswordHasher] fix copy paste typos from UserPasswordEncoderInterface
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
Fix typos introduced when extracting the PasswordHasher component from `UserPasswordEncoderInterface` abeb8e4ca9/src/Symfony/Component/Security/Core/Encoder/UserPasswordEncoderInterface.php (L36)
Discovered in 5.3.0BETA1.
Commits
-------
dfc3584fb7 [PasswordHasher] fix copy paste typos from UserPasswordEncoderInterface
* 5.2:
make fabbot happy
use correct spelling when accessing the SMTP php.ini value
Fix issue 40507: Tabs as separators between tokens
[Cache] phpredis: Added full TLS support for RedisCluster
[DependencyInjection][AliasDeprecatedPublicServicesPass] Noop when the service is private
This PR was merged into the 4.4 branch.
Discussion
----------
[Yaml] make fabbot happy
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
9826c05928 make fabbot happy
This PR was merged into the 4.4 branch.
Discussion
----------
[Yaml] Allow tabs as separators between tokens
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40507
| License | MIT
| Doc PR | None
As described in #40507, the Yaml spec allows tabs as whitespace characters between tokens. However, the Yaml parser crashes on this as it only expects spaces after the colon. https://yaml.org/spec/1.2/spec.html#id2778241
While I'm not a huge fan of it personally, it's an issue when a different linter tells us that a given YAML file with content that we have little control over has valid syntax in an unrelated check, and then our app crashes because it cannot be parsed after all.
Commits
-------
9a130ae93e Fix issue 40507: Tabs as separators between tokens