Commit Graph

47066 Commits

Author SHA1 Message Date
Alexander M. Turek e3e1558a0b Enable APCu for the php 8 build. 2020-05-23 23:26:28 +02:00
Alexander M. Turek 98e5105bd3 [Process] Fix failing test on php 8. 2020-05-23 21:47:49 +02:00
Nicolas Grekas d8bb5b2df5 Merge branch '3.4' into 4.4
* 3.4:
  [HttpKernel] fix test
2020-05-23 19:38:31 +02:00
Nicolas Grekas 5ebcd26f06 [HttpKernel] fix test 2020-05-23 19:37:50 +02:00
Nicolas Grekas 7b871133e9 Merge branch '3.4' into 4.4
* 3.4:
  Make PHP 8 green on Travis
2020-05-23 19:20:05 +02:00
Nicolas Grekas d6902039c4 minor #36930 Make PHP 8 green on Travis (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Make PHP 8 green on Travis

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

See #36872 for preparatory work and remaining steps.

Commits
-------

571d46cf01 Make PHP 8 green on Travis
2020-05-23 19:17:25 +02:00
Nicolas Grekas 571d46cf01 Make PHP 8 green on Travis 2020-05-23 19:05:51 +02:00
Nicolas Grekas 9de714c3d4 minor #36928 [PropertyAccessor] Added missing property path on php 8 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyAccessor] Added missing property path on php 8

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

This PR adds the property path to the exception message to fix failing tests on php 8.

Commits
-------

6a73bcdb8e [PropertyAccessor] Added missing property path on php 8.
2020-05-23 18:30:14 +02:00
Nicolas Grekas 098d84afd7 minor #36927 [Cache][Lock][Messenger] Don't execute tests with DBAL 2.x on php 8 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][Lock][Messenger] Don't execute tests with DBAL 2.x on php 8

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

Follow-up to #36895: If we autoload the `PDOConnection` from DBAL 2.x during a test on php8, our test suite goes 💥

What this PR does:
* Some more Cache tests are skipped if DBAL 2 is installed on php 8.
* The Lock and Messenger components are tested against DBAL 3.

Commits
-------

7dc3f9cb42 Don't execute tests with DBAL 2.x on php 8.
2020-05-23 18:27:24 +02:00
Nicolas Grekas 6e0593f210 Merge branch '3.4' into 4.4
* 3.4:
  Revert "[Cache] allow DBAL v3"
2020-05-23 18:26:58 +02:00
Nicolas Grekas 896b69c907 Revert "[Cache] allow DBAL v3"
This reverts commit d12b3b6a72.
2020-05-23 18:25:19 +02:00
Alexander M. Turek 6a73bcdb8e [PropertyAccessor] Added missing property path on php 8. 2020-05-23 17:44:24 +02:00
Alexander M. Turek 7dc3f9cb42 Don't execute tests with DBAL 2.x on php 8. 2020-05-23 17:32:20 +02:00
Nicolas Grekas a14d8f9da4 minor #36924 [travis] skip extensions that dont compile on nightly (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[travis] skip extensions that dont compile on nightly

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

Commits
-------

c26044b0b1 [travis] skip extensions that dont compile on nightly
2020-05-23 15:53:53 +02:00
Nicolas Grekas c26044b0b1 [travis] skip extensions that dont compile on nightly 2020-05-23 15:47:19 +02:00
Nicolas Grekas c8c7d4c458 [Cache] $lifetime cannot be null 2020-05-23 15:02:18 +02:00
Nicolas Grekas 236a2145fc Merge branch '3.4' into 4.4
* 3.4:
  [Serializer] minor cleanup
2020-05-23 14:50:36 +02:00
Nicolas Grekas 1a21a7582e bug #36921 [OptionsResolver][Serializer] Remove calls to deprecated ReflectionParameter::getClass() (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver][Serializer] Remove calls to deprecated ReflectionParameter::getClass()

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

Following #36891, this PR removes the remaining calls to `ReflectionParameter::getClass()` from the 4.4 branch.

Commits
-------

1575d853f1 Remove calls to deprecated ReflectionParameter::getClass().
2020-05-23 14:48:29 +02:00
Nicolas Grekas ca695e55e8 [Serializer] minor cleanup 2020-05-23 14:46:57 +02:00
Nicolas Grekas ae49c3c649 fix merge 2020-05-23 14:37:04 +02:00
Nicolas Grekas 6f07b19b03 Merge branch '3.4' into 4.4
* 3.4:
  Run PHP 8 as 7.4.99
  [VarDumper] fix PHP 8 support
  Add php 8 to travis.
  [Cache] Accessing undefined constants raises an Error in php8
2020-05-23 14:24:27 +02:00
Nicolas Grekas 232725243b Run PHP 8 as 7.4.99 2020-05-23 14:14:15 +02:00
Alexander M. Turek 1575d853f1 Remove calls to deprecated ReflectionParameter::getClass(). 2020-05-23 14:09:32 +02:00
Nicolas Grekas c4ac3c19c6 bug #36920 [VarDumper] fix PHP 8 support (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix PHP 8 support

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

/cc @derrabus FYI

Commits
-------

9bc1ab62cf [VarDumper] fix PHP 8 support
2020-05-23 14:06:05 +02:00
Nicolas Grekas 9bc1ab62cf [VarDumper] fix PHP 8 support 2020-05-23 14:00:17 +02:00
Nicolas Grekas 6e368f136f bug #36917 [Cache] Accessing undefined constants raises an Error in php8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Accessing undefined constants raises an Error in php8

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

Calling `constant()` for an undefined constant will raise an `Error` on php 8. This PR adjust the Memcached tests to this new behavior.

Commits
-------

49fd0efb12 [Cache] Accessing undefined constants raises an Error in php8
2020-05-23 13:35:31 +02:00
Nicolas Grekas ee9aa2d568 minor #36919 Add php 8 to travis (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Add php 8 to travis

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

This PR adds an extra php 8 job to travis that is allowed to fail. This will allow us to monitor the remaining work.

* I did not include APCu because loading the extension would clutter our log with warnings. We might fix this by compiling APCu from master though.
* I did not manage to compile `ext-redis` and `ext-mongodb`.
* But hey, `ext-memcached` works!

Commits
-------

08084f370d Add php 8 to travis.
2020-05-23 13:31:06 +02:00
Alexander M. Turek 08084f370d Add php 8 to travis. 2020-05-23 12:01:17 +02:00
Alexander M. Turek 49fd0efb12 [Cache] Accessing undefined constants raises an Error in php8 2020-05-23 11:57:43 +02:00
Nicolas Grekas a205f4e15c Merge branch '3.4' into 4.4
* 3.4:
  [Cache] allow DBAL v3
2020-05-23 11:14:06 +02:00
Nicolas Grekas d12b3b6a72 [Cache] allow DBAL v3 2020-05-23 11:12:58 +02:00
Nicolas Grekas 8de1091347 Merge branch '3.4' into 4.4
* 3.4:
  Skip Doctrine DBAL on php 8 until we have a compatible version.
  [DomCrawler] Catch expected ValueError.
  [Validator] Catch expected ValueError.
  [VarDumper] ReflectionFunction::isDisabled() is deprecated.
  [PropertyAccess] Parse php 8 TypeErrors correctly.
  [Intl] Fix call to ReflectionProperty::getValue() for static properties.
  [HttpKernel] Prevent calling method_exists() with non-string values.
  [Debug] php 8 does not pass $context to error handlers.
  [Config] Removed implicit cast of ReflectionProperty to string.
  [Debug] Undefined variables raise a warning in php 8.
  [Debug] Skip test that would trigger a fatal error on php 8.
  Address deprecation of ReflectionType::getClass().
  Properties $originalName and $mimeType are never null in UploadedFile
2020-05-23 11:11:46 +02:00
Nicolas Grekas f32c2c15d9 minor #36909 [ErrorHandler] Apply php8 fixes from Debug component (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Apply php8 fixes from Debug component

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

The changes of #36898 and #36897 ported to the ErrorHandler component.

Commits
-------

54f18698af [ErrorHandler] Apply php8 fixes from Debug component.
2020-05-23 10:32:54 +02:00
Nicolas Grekas 2799d559f3 minor #36895 Skip Doctrine DBAL on php 8 until we have a compatible version (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Skip Doctrine DBAL on php 8 until we have a compatible version

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

This PR skips all tests on php 8 that would trigger an autoload on DBAL's `PDOConnection`. Those tests would exit with a fatal error because of incompatible method signatures (see doctrine/dbal#3791) and until we can test against a compatible version of DBAL, there's (at least from my point of view) nothing we can do about it. Once this issue is resolved, we can revert this change.

Commits
-------

1090738264 Skip Doctrine DBAL on php 8 until we have a compatible version.
2020-05-23 10:29:15 +02:00
Alexander M. Turek 1090738264 Skip Doctrine DBAL on php 8 until we have a compatible version. 2020-05-23 10:20:35 +02:00
Nicolas Grekas 410b6214ea bug #36891 Address deprecation of ReflectionType::getClass() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Address deprecation of ReflectionType::getClass()

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

Calling `ReflectionType::getClass()` will trigger a deprecation warning on php 8. This PR switches to `getType()` if available.

Commits
-------

53b1677a4e Address deprecation of ReflectionType::getClass().
2020-05-23 09:35:15 +02:00
Nicolas Grekas fb91dc24eb bug #36899 [VarDumper] ReflectionFunction::isDisabled() is deprecated (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] ReflectionFunction::isDisabled() is deprecated

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

See php/php-src#5473. Calling `ReflectionFunction::isDisabled()` is pointless on php 8 and doing so triggers a deprecation warning.

Someone who is more familiar with that component might want to have a second look on this PR. I'm not really sure if this is the right way to fix the issue.

Commits
-------

1da347e5ba [VarDumper] ReflectionFunction::isDisabled() is deprecated.
2020-05-23 09:34:32 +02:00
Nicolas Grekas 42692d625d bug #36905 [Validator] Catch expected ValueError (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Catch expected ValueError

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

`mb_check_encoding()` raises a `ValueError` on php 8 if an invalid encoding was passed. The validator that was patched here is expected to fail gracefully in that situation. This PR restores that behavior under php 8.

Maybe we can reconsider this behavior for Symfony 5.2. It feels a bit odd to me because we swallow a potential misconfiguration of the validator.

Commits
-------

8f3f67f82a [Validator] Catch expected ValueError.
2020-05-23 09:32:18 +02:00
Nicolas Grekas 5d7b7e9616 bug #36915 [DomCrawler] Catch expected ValueError (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DomCrawler] Catch expected ValueError

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

This is #36906 ported to the 4.4 branch.

Commits
-------

32691e5157 [DomCrawler] Catch expected ValueError.
2020-05-23 09:22:08 +02:00
Nicolas Grekas a25e88b485 bug #36908 [Cache][HttpClient] Made method signatures compatible with their corresponding traits (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][HttpClient] Made method signatures compatible with their corresponding traits

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

Apparently, php 8 is less forgiving about method signature differences between a trait and the class that uses the trait. This PR makes minimal adjustments to get rid of fatal errors triggered by php 8.

Commits
-------

6fda276feb Made method signatures compatible with their corresponding traits.
2020-05-23 09:19:45 +02:00
Nicolas Grekas 475a715ca8 bug #36906 [DomCrawler] Catch expected ValueError (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[DomCrawler] Catch expected ValueError

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

`mb_convert_encoding()` raises a `ValueError` on php 8 if an unknown character set is passed. This causes trouble with the whole test suite because the temporary error handler is not deregistered in that case.

Since the previously raised warning was actively ignored by that error handler, I'm now ignoring the `ValueError` as well. Also, I've wrapped the `restore_error_handler()` call into a `finally` statement to make the whole construct a bit more robust.

Commits
-------

b1db13728b [DomCrawler] Catch expected ValueError.
2020-05-23 09:10:53 +02:00
Alexander M. Turek 32691e5157 [DomCrawler] Catch expected ValueError. 2020-05-23 02:03:06 +02:00
Alexander M. Turek 6fda276feb Made method signatures compatible with their corresponding traits. 2020-05-22 22:05:30 +02:00
Alexander M. Turek 54f18698af [ErrorHandler] Apply php8 fixes from Debug component. 2020-05-22 21:58:53 +02:00
Alexander M. Turek b1db13728b [DomCrawler] Catch expected ValueError. 2020-05-22 21:35:43 +02:00
Alexander M. Turek 8f3f67f82a [Validator] Catch expected ValueError. 2020-05-22 20:52:50 +02:00
Alexander M. Turek 1da347e5ba [VarDumper] ReflectionFunction::isDisabled() is deprecated. 2020-05-22 20:50:36 +02:00
Nicolas Grekas e220e7cc01 bug #36904 [PropertyAccess] Parse php 8 TypeErrors correctly (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess] Parse php 8 TypeErrors correctly

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

The wording of `TypeError` messages has changed in php 8. Since `PropertyAccessor` parses those messages, the logic needed some adjustments.

Commits
-------

7100c3ce1b [PropertyAccess] Parse php 8 TypeErrors correctly.
2020-05-22 20:33:39 +02:00
Nicolas Grekas 4e191688fe minor #36898 [Debug] php 8 does not pass $context to error handlers (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] php 8 does not pass $context to error handlers

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

php 8 will call error handlers without the optional `$context` parameter. Thus, error handlers that make that parameter mandatory will break.

Commits
-------

593897c9e1 [Debug] php 8 does not pass $context to error handlers.
2020-05-22 20:25:20 +02:00
Fabien Potencier 6d7c696742 bug #36839 [BrowserKit] Raw body with custom Content-Type header (azhurb)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[BrowserKit] Raw body with custom Content-Type header

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

Currently, if you try to send POST/PUT request with custom `Content-Type` header and specified body, the real request will contain `text/plain` content type.

Following code
```php
$client->request(
    'POST',
    '/url',
    [],
    [],
    [
        'CONTENT_TYPE' => 'application/json'
    ],
    '{"foo":"bar"}'
);
```
produces next request
```
POST /
Content-Type: text/plain; charset=utf-8

{"foo":"bar"}
```

With this fix, the request will be
```
POST /
Content-Type: application/json

{"foo":"bar"}
```

Commits
-------

d2dd92be77 [BrowserKit] Raw body with custom Content-Type header
2020-05-22 19:28:00 +02:00