Commit Graph

49010 Commits

Author SHA1 Message Date
Fabien Potencier
6314732d74 feature #36886 [Validator] Make ExpressionLanguageSyntax validator usable with annotation (jderusse)
This PR was submitted for the master branch but it was merged into the 5.1 branch instead.

Discussion
----------

[Validator] Make ExpressionLanguageSyntax validator usable with annotation

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

When using the new on an entity ExpressionLanguageSyntax (basicaly copy/pasted the sample from https://symfony.com/blog/new-in-symfony-5-1-expressionlanguage-validator), I face a first error:

> Constraint validator "" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "Symfony\Component\Validator\Constraints\ExpressionLanguageSyntax".

indeed, the `service` is [need to generate a valide alias](430b884570/src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntax.php (L38-L41))

Which looks weird for a Constraint

This PR makes the ExpressionLanguage dependency optionnal in `ExpressionLanguageSyntaxValidator`, and removes the `service` than is not needed anyore

Commits
-------

a010a87373 Make ExpressionLanguageSyntax validator usable with annotation
2020-05-22 19:13:28 +02:00
Jérémy Derussé
a010a87373 Make ExpressionLanguageSyntax validator usable with annotation 2020-05-22 19:13:22 +02:00
Fabien Potencier
14ffc0231f minor #36902 [Intl] Fix call to ReflectionProperty::getValue() for static properties (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Fix call to ReflectionProperty::getValue() for static properties

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

When we call `ReflectionProperty::getValue()` for a static property, we don't need to pass any arguments. The code that was fixed here raised a `TypeError` on php 8 because the argument has to be an object now.

Commits
-------

d4045897d6 [Intl] Fix call to ReflectionProperty::getValue() for static properties.
2020-05-22 19:06:23 +02:00
Fabien Potencier
77a826c8b7 bug #36896 [Config] Removed implicit cast of ReflectionProperty to string (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Removed implicit cast of ReflectionProperty to string

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

PHP 8 does not allow casting `ReflectionProperty` instances to string anymore.

Commits
-------

8adbadede7 [Config] Removed implicit cast of ReflectionProperty to string.
2020-05-22 19:04:16 +02:00
Fabien Potencier
2e46c63bce bug #35944 [Security/Core] Fix wrong roles comparison (thlbaut)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Core] Fix wrong roles comparison

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

Fix wrong roles comparison.

Commits
-------

7d2ad4b265 Fix wrong roles comparison
2020-05-22 18:51:30 +02:00
Fabien Potencier
b2026966a7 minor #36897 [Debug] Undefined variables raise a warning in php 8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Undefined variables raise a warning in php 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

`ErrorHandlerTest` executes code with undefined variables to test how the error handler handles the triggered errors. In php 8.0, the severity and error message for this class of errors has been changed. I've adjusted the test accordingly.

Commits
-------

1d20b514f2 [Debug] Undefined variables raise a warning in php 8.
2020-05-22 18:47:25 +02:00
Fabien Potencier
4a0d5f1273 minor #36901 [HttpKernel] Prevent calling method_exists() with non-string values (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Prevent calling method_exists() with non-string values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

On php 8, `method_exists()` will raise a `TypeError` if the first argument is neither an object or string. We do have a test case that calls the `ControllerResolver` with integer `1` as `$controller`. This test should work as expected again on php 8.

Commits
-------

1bbfdcbb8d [HttpKernel] Prevent calling method_exists() with non-string values.
2020-05-22 18:43:54 +02:00
Robin Chalas
a7c09acda0 bug #36873 [Messenger] Fixed check for allowed options in AwsSqs configuration (kroshilin)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] Fixed check for allowed options in AwsSqs configuration

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

Before this fix it was unavailable to create Connection with access_key and secret_key in options, because they were added to $clientConfiguration var, and check for extra options was against $configuration var. Which lead to exception.
The idea is to check input options against self::DEFAULT_OPTIONS (which contains all available options)

Commits
-------

fb1967210e [Messenger] Fixed check for allowed options in AwsSqs configuration
2020-05-22 17:48:57 +02:00
Alexander M. Turek
7100c3ce1b [PropertyAccess] Parse php 8 TypeErrors correctly. 2020-05-22 16:26:18 +02:00
Robin Chalas
3815b26077 minor #36903 [Messenger] Add suggestion for Amazon SQS transport and make check more readable (RocKordier)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] Add suggestion for Amazon SQS transport and make check more readable

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

Copy-paste of https://github.com/symfony/symfony/pull/36890

Commits
-------

de7f3fceec [Messenger] Add suggestion for Amazon SQS transport and make check more readable
2020-05-22 15:47:39 +02:00
Eric Hertwig
de7f3fceec [Messenger] Add suggestion for Amazon SQS transport and make check more readable 2020-05-22 15:43:15 +02:00
Alexander M. Turek
d4045897d6 [Intl] Fix call to ReflectionProperty::getValue() for static properties. 2020-05-22 15:42:59 +02:00
Alexander M. Turek
1bbfdcbb8d [HttpKernel] Prevent calling method_exists() with non-string values. 2020-05-22 15:23:31 +02:00
Thibaut Salanon
7d2ad4b265 Fix wrong roles comparison 2020-05-22 14:29:11 +02:00
Alexander M. Turek
593897c9e1 [Debug] php 8 does not pass $context to error handlers. 2020-05-22 13:12:29 +02:00
Alexander M. Turek
8adbadede7 [Config] Removed implicit cast of ReflectionProperty to string. 2020-05-22 12:56:48 +02:00
Alexander M. Turek
1d20b514f2 [Debug] Undefined variables raise a warning in php 8. 2020-05-22 12:23:23 +02:00
Nicolas Grekas
52abcbeec9 minor #36892 [Debug] Skip test that would trigger a fatal error on php 8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Skip test that would trigger a fatal error on php 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

This PR skips a test of `DebugClassLoader`. The test uses incompatible method signatures in class inheritance to provoke a php warning that should be handled by the debug class loader. On php 8 however, this error is not recoverable anymore, so the tested logic will be obsolete there.

Commits
-------

573d0dd493 [Debug] Skip test that would trigger a fatal error on php 8.
2020-05-22 10:14:52 +02:00
Nicolas Grekas
47180fe447 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix setting platform.php
2020-05-21 20:35:07 +02:00
Nicolas Grekas
dd902d939f [PhpUnitBridge] fix setting platform.php 2020-05-21 20:33:26 +02:00
Alexander M. Turek
573d0dd493 [Debug] Skip test that would trigger a fatal error on php 8. 2020-05-21 16:02:48 +02:00
Alexander M. Turek
53b1677a4e Address deprecation of ReflectionType::getClass(). 2020-05-21 15:02:25 +02:00
Nicolas Grekas
4f93cc164a Merge branch '5.0' into 5.1
* 5.0:
  fix merge
2020-05-21 00:29:05 +02:00
Nicolas Grekas
4a365d2cf2 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
2020-05-21 00:28:59 +02:00
Nicolas Grekas
0349890720 fix merge 2020-05-21 00:28:08 +02:00
Nicolas Grekas
819f76a11f Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:11:07 +02:00
Nicolas Grekas
f280829ad8 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:10:58 +02:00
Nicolas Grekas
ef6a85b7ea Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
2020-05-21 00:10:46 +02:00
Nicolas Grekas
5ec5bfb23c [PhpUnitBridge] fix installing on PHP 8 (ter) 2020-05-21 00:09:52 +02:00
Nicolas Grekas
c101259192 [PhpUnitBridge] fix installing on PHP 8 (bis) 2020-05-20 23:58:15 +02:00
Nicolas Grekas
a6ea1da1e6 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix installing on PHP 8
2020-05-20 23:50:56 +02:00
Nicolas Grekas
606715b6ec [PhpUnitBridge] fix installing on PHP 8 2020-05-20 23:49:59 +02:00
Nicolas Grekas
e65cdb685f Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
2020-05-20 19:43:50 +02:00
Nicolas Grekas
b429b15eb5 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
2020-05-20 19:38:26 +02:00
Nicolas Grekas
53d89f71d6 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
2020-05-20 19:31:34 +02:00
Nicolas Grekas
b6151ed6cc [PhpUnitBridge] fix leftover 2020-05-20 19:29:51 +02:00
Fabien Potencier
0438baa22f bug #36882 [PhpUnitBridge] fix installing under PHP >= 8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix installing under PHP >= 8

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

[As experimented on Twig](b952011f95), using `simple-phpunit` is not simple enough when testing with PHP 8.

This PR fixes the issue so that we could remove these lines in Twig.

On 3.4 since supporting new versions of PHP is a bugfix according to our policies.

Commits
-------

5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8
2020-05-20 19:21:57 +02:00
Nicolas Grekas
5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8 2020-05-20 18:13:38 +02:00
Fabien Potencier
8f6afdd9d5 minor #36876 Use ">=" for the "php" requirement (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Use ">=" for the "php" requirement

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

As explained in https://twitter.com/nicolasgrekas/status/1263023258938548225:

Using `"^7.x"` is our composer.json has been a mistake. We should always use `">=7.x"`! 3 reasons:
1. it's either planned obsolescence xor a strong promise to maintain in the long run. None is sustainable.
2. if you actually end up maintaining in the long run (not by promise but by fact), your latest versions will work with PHP 8 by definition.
3. meanwhile, `"^7.x"` prevented all your ecosystem from experimenting with PHP 8, which means they increased the workload on *you* the core maintainer.

Conclusion: always use `">="` for the `"php"` requirement. Hope for the best (it mostly happens) and enable your community to experiment with the next major asap without adding useless impediments.

Commits
-------

f8aa0873cf Use ">=" for the "php" requirement
2020-05-20 11:06:03 +02:00
Nicolas Grekas
f8aa0873cf Use ">=" for the "php" requirement 2020-05-20 10:37:50 +02:00
Nicolas Grekas
17b0597d3e minor #36875 [Intl] bump icu 67.1 (ro0NL)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] bump icu 67.1

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

Commits
-------

920e319051 bump icu 67.1
2020-05-19 19:44:17 +02:00
Roland Franssen
920e319051 bump icu 67.1 2020-05-19 19:12:53 +02:00
Nicolas Grekas
0fd5b95178 bug #36859 [Validator] allow passing a validator to Validation::createCallable() (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[Validator] allow passing a validator to Validation::createCallable()

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

As spotted by @stof in https://github.com/symfony/symfony/pull/31466#issuecomment-630054227

Commits
-------

1357cbf8ed [Validator] allow passing a validator to Validation::createCallable()
2020-05-19 19:03:49 +02:00
Nicolas Grekas
754bba483e minor #36866 [DI][Preload] Remove preload primitive types (Michał Jusięga, michaljusiega)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI][Preload] Remove preload primitive types

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no, but it could be for the future
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

After bump my project to  5.1.x-dev I saw the generated file of `*.preload.php` contains classes that are primitive types like int, string, bool.

```
composer create-project symfony/website-skeleton preload "5.1.x-dev"
cat preload/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
```

```
$ cat test/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
$classes[] = 'int';
$classes[] = 'string';
$classes[] = 'Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator';
$classes[] = 'Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint';
$classes[] = 'Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator';
$classes[] = 'Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer';
$classes[] = 'bool';
$classes[] = 'Symfony\Component\Validator\ContainerConstraintValidatorFactory';
$classes[] = 'Symfony\Component\Validator\Constraints\EmailValidator';
$classes[] = 'Symfony\Component\Validator\Constraints\ExpressionValidator';
$classes[] = 'Symfony\Component\Validator\Constraints\NotCompromisedPasswordValidator';
$classes[] = 'Symfony\\Component\\Form\\Extension\\Validator\\Constraints\\Form';
```

I don't know if it is expected behaviour, but if not - then PR fix it.

~~In addition, classes are sorted for better reading.~~

Commits
-------

4d05dbbfb5 [DI] Remove preload primitive types
2020-05-19 19:02:44 +02:00
Michał Jusięga
4d05dbbfb5 [DI] Remove preload primitive types 2020-05-19 19:02:10 +02:00
Nicolas Grekas
b7ecb1582a Merge branch '5.0' into 5.1
* 5.0:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:57:22 +02:00
Nicolas Grekas
6237e3d569 Merge branch '4.4' into 5.0
* 4.4:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:57:09 +02:00
Nicolas Grekas
2c57ae2b97 Merge branch '3.4' into 4.4
* 3.4:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:54:45 +02:00
Nicolas Grekas
5fc4d1b645 minor #36863 [Validator] Add missing translations of nn locale (themilanfan)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing translations of nn locale

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes/no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30178
| License       | MIT

Added missing translations to validator with locale nn

Commits
-------

040d01e53b [Validator] Add missing translations of nn locale
2020-05-19 18:38:52 +02:00
Giuseppe Campanelli
040d01e53b [Validator] Add missing translations of nn locale 2020-05-19 18:38:46 +02:00