Commit Graph

33039 Commits

Author SHA1 Message Date
Fabien Potencier
4cc0ab3e99 bug #41014 [Routing] allow extending Route attribute (robmro27)
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
2021-05-01 16:20:47 +02:00
robmro27
d733b78f88 [Routing] allow extending Route attribute 2021-05-01 16:20:43 +02:00
Christian Flothmann
83fd6ed8fb Merge branch '5.2' into 5.x
* 5.2:
  run tests against doctrine/persistence 2.2 again
  [Security] Do not try to rehash null-passwords
  Small phpdoc imporvement
2021-05-01 16:00:17 +02:00
Christian Flothmann
001aeb8bcb Merge branch '4.4' into 5.2
* 4.4:
  Small phpdoc imporvement
2021-05-01 15:46:24 +02:00
Fabien Potencier
0489ffcaed feature #39913 [OptionsResolver] Add prototype definition support for nested options (yceruto)
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
2021-05-01 10:55:42 +02:00
Fran Moreno
bd638a0fd8 Remove spaces between arguments
Blank spaces between the arguments of the GithubActionReporter
messages make them appear always on line 1.
2021-05-01 02:53:07 +02:00
Thijs-jan Veldhuizen
a2a944e668 [Security] Do not try to rehash null-passwords 2021-04-30 19:39:44 +02:00
Fabien Potencier
8679945b43 minor #40973 [HttpFoundation] Small phpdoc improvement (flack)
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
2021-04-30 14:05:50 +02:00
Alexander M. Turek
8ff0a3e6f2 Merge branch '5.2' into 5.x
* 5.2:
  [Security/Core] fix checking for bcrypt
  [HttpFoundation] Fixes for PHP 8.1 deprecations
  [Mime] DataPart: remove confusing fix-me comment
  expose references detected in inline notation structures
2021-04-29 22:52:27 +02:00
Alexander M. Turek
92b6458f60 Merge branch '4.4' into 5.2
* 4.4:
  [Security/Core] fix checking for bcrypt
  [HttpFoundation] Fixes for PHP 8.1 deprecations
  [Mime] DataPart: remove confusing fix-me comment
  expose references detected in inline notation structures
2021-04-29 22:47:09 +02:00
Robin Chalas
68a97d6e9a bug #40920 [PasswordHasher] accept hashing passwords with nul bytes or longer than 72 bytes when using bcrypt (nicolas-grekas)
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
2021-04-29 22:41:46 +02:00
Nicolas Grekas
a5d3b89472 [PasswordHasher] accept hashing passwords with nul bytes or longer than 72 bytes when using bcrypt 2021-04-29 20:11:32 +02:00
Nicolas Grekas
f01ea99254 [Security/Core] fix checking for bcrypt 2021-04-29 20:10:21 +02:00
Fabien Potencier
694c052e3c bug #40986 [Console] Negatable option are null by default (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Console] Negatable option are null by default

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

given the command
```php
class TestCommand extends Command
{
    protected static $defaultName = 'test';

    protected function configure()
    {
        $this->addOption('ansi', null, InputOption::VALUE_NEGATABLE, 'Force/disable ANSI output');
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        dump($input->getOption('ansi'));

        return Command::SUCCESS;
    }
}
```

 call | result
--- | ---
`bin/console test --no-ansi` | `false`
`bin/console test --ansi` | `true`
`bin/console test` | `null`

Commits
-------

22cb37cc85 [console] Negatable option are null by default
2021-04-29 16:17:51 +02:00
Jérémy Derussé
22cb37cc85
[console] Negatable option are null by default 2021-04-29 15:43:07 +02:00
flack
a53f256b4b Small phpdoc imporvement 2021-04-29 15:01:54 +02:00
Fabien Potencier
061ac77773 bug #40923 [Yaml] expose references detected in inline notation structures (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] expose references detected in inline notation structures

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40823
| License       | MIT
| Doc PR        |

Commits
-------

6d7d3fb520 expose references detected in inline notation structures
2021-04-29 14:36:56 +02:00
Fabien Potencier
32534fbad2 bug #40966 [Messenger] fix manual amqp setup when autosetup disabled (Tobion)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Messenger] fix manual amqp setup when autosetup disabled

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix https://github.com/symfony/symfony/pull/39608#discussion_r621590663
| License       | MIT
| Doc PR        |

Commits
-------

29e5bde6c0 [Messenger] fix manual amqp setup when autosetup disabled
2021-04-29 14:30:13 +02:00
Oskar Stark
4c0f078c91 [Mailer] Move CHANGELOG entry 2021-04-29 11:19:46 +02:00
Alexander M. Turek
90e419d0de minor #40968 [Config] Remove unused sprintf + coding standards (HypeMC)
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
2021-04-28 23:13:43 +02:00
Alexander M. Turek
a94de9e012 minor #40967 [Translation] [Loco] Remove SCHEME const (OskarStark)
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
2021-04-28 14:03:52 +02:00
HypeMC
17479e2bb5 Minor code cleanup 2021-04-28 09:57:32 +02:00
Oskar Stark
01602ef842 bug #40956 [Config] [ConfigBuilder] Set FQCN as properties type instead of class name (MatTheCat)
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
2021-04-28 09:41:38 +02:00
MatTheCat
e9aa1c5771 [Config] [ConfigBuilder] Set FQCN as properties type instead of class name 2021-04-28 09:41:32 +02:00
Oskar Stark
34be4a5120 [Translation] [Loco] Remove SCHEME const 2021-04-28 08:48:47 +02:00
Tobias Schultze
29e5bde6c0 [Messenger] fix manual amqp setup when autosetup disabled 2021-04-28 00:28:04 +02:00
Jeremiasz Major
10be072b2b
[HttpFoundation] Fixes for PHP 8.1 deprecations 2021-04-27 18:57:06 +02:00
Oskar Stark
e6af3c2572 [Translation] [Loco] Simplify namespace 2021-04-27 17:24:37 +02:00
David Maicher
72493c6acf
[Mime] DataPart: remove confusing fix-me comment 2021-04-27 16:58:50 +02:00
Oskar Stark
c78358fac8 minor #40944 [Translation] Use proven DSN class from Notifier and rename package (OskarStark)
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
2021-04-27 16:39:13 +02:00
Alexander M. Turek
5506f2a115 bug #40950 [Config] Remove double semicolons from autogenerated config classes (HypeMC)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Config] Remove double semicolons from autogenerated config classes

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | N/A

In some cases, the autogenerated config classes contain double semicolons:

![image](https://user-images.githubusercontent.com/2445045/116090262-f4b03200-a6a3-11eb-9cdd-135e9dbac084.png)

Commits
-------

c7163b32c2 [Config] Remove double semicolons from autogenerated config classes
2021-04-27 14:08:31 +02:00
HypeMC
c7163b32c2 [Config] Remove double semicolons from autogenerated config classes 2021-04-27 14:08:11 +02:00
Oskar Stark
a7979c44de [Translation] Use proven DSN class from Notifier
This class is already in use, no need to introduce it as experimental
2021-04-27 11:00:44 +02:00
Alexander M. Turek
88abb39b92 bug #40903 [Config] Builder: Remove typehints and allow for EnvConfigurator (Nyholm)
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
2021-04-26 18:58:52 +02:00
Fabien Potencier
896f4a6eb6 minor #40915 [PasswordHasher] fix copy paste typos from UserPasswordEncoderInterface (mhujer)
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
2021-04-25 08:41:31 +02:00
Nyholm
59b79d35a7
[Config] Builder: Remove typehints and allow for EnvConfigurator 2021-04-24 19:19:31 +02:00
Alexander M. Turek
84a514c4b1 Merge branch '5.2' into 5.x
* 5.2:
  [DependencyInjection] Add missing bool type in procesValue()
  [CI] Make sure to restore default locale
2021-04-24 16:39:57 +02:00
Alexander M. Turek
ef17a59096 Merge branch '4.4' into 5.2
* 4.4:
  [CI] Make sure to restore default locale
2021-04-24 16:39:13 +02:00
Tomas Votruba
e0f8fe837d [DependencyInjection] Add missing bool type in procesValue() 2021-04-24 16:32:26 +02:00
Nyholm
a5afe47ccf [CI] Make sure to restore default locale 2021-04-23 23:06:14 +02:00
Nyholm
d51f7f6a75
[Translation] [CI] Specify terminal width 2021-04-23 19:49:15 +02:00
Alexander M. Turek
a9d582d681 Merge branch '5.2' into 5.x
* 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
2021-04-23 18:57:12 +02:00
Alexander M. Turek
546f3b61ed Merge branch '4.4' into 5.2
* 4.4:
  make fabbot happy
  Fix issue 40507: Tabs as separators between tokens
  [Cache] phpredis: Added full TLS support for RedisCluster
2021-04-23 18:56:33 +02:00
Christian Flothmann
6d7d3fb520 expose references detected in inline notation structures 2021-04-23 14:09:37 +02:00
Christian Flothmann
6c7abd1380 minor #40924 [Yaml] make fabbot happy (xabbuh)
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
2021-04-23 14:08:29 +02:00
Christian Flothmann
9826c05928 make fabbot happy 2021-04-23 13:57:46 +02:00
Christian Flothmann
b6f8ed69ec use correct spelling when accessing the SMTP php.ini value 2021-04-23 13:25:09 +02:00
Christian Flothmann
df6b1ebf78 bug #40514 [Yaml] Allow tabs as separators between tokens (bertramakers)
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
2021-04-23 09:45:19 +02:00
Bert Ramakers
9a130ae93e Fix issue 40507: Tabs as separators between tokens 2021-04-23 09:44:00 +02:00
Jack Thomas
a1e0408d08 [Cache] phpredis: Added full TLS support for RedisCluster 2021-04-23 09:09:57 +02:00