Commit Graph

50935 Commits

Author SHA1 Message Date
Christian Flothmann
82d9d41d57 [Intl] promote warnings to value errors on PHP 8 2020-09-09 09:45:25 +02:00
Fabien Potencier
799624b6f1 Fix CS 2020-09-09 07:35:36 +02:00
Fabien Potencier
1e52146339 bug #37097 DateTime validator support for trailing data (stefankleff)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

DateTime validator support for trailing data

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

Commits
-------

27f6e28f5b DateTime validator support for trailing data
2020-09-09 07:34:53 +02:00
Stefan Kleff
27f6e28f5b DateTime validator support for trailing data 2020-09-09 07:34:45 +02:00
Fabien Potencier
bb3bc7fc48 minor #38119 Remove some leftover for HHVM support (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Remove some leftover for HHVM support

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| 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        | n/a

Commits
-------

cf9e75614b Remove some leftover for HHVM support
2020-09-09 07:23:40 +02:00
Fabien Potencier
cf9e75614b Remove some leftover for HHVM support 2020-09-09 07:20:36 +02:00
Fabien Potencier
80e5a7fbd8 feature #37559 [PropertyInfo] fix array types with keys (array<string, string>) (digilist)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyInfo] fix array types with keys (array<string, string>)

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

Array types with keys are currently not detected correctly from the PropertyInfo component:

```
@var array<string, string>
@var array<string, array<integer, string>>
```

Those are currently identified as object with class `rray<string, string>`.

This PR tries to fix it.

What I noticed while fixing this, is that union types in arrays are not supported in general at the moment, because the `Type` class supports only one collectionValueType and I do not see how to pass a Union Type there. But I guess that's a different issue and for those types I decided to return null as collection value type for now. (Or better throw on exception?)

Commits
-------

64f7bd7832 [PropertyInfo] fix array types with keys (array<string, string>)
2020-09-09 07:17:12 +02:00
Fabien Potencier
656fc3b82a Simplify code 2020-09-09 07:14:52 +02:00
Fabien Potencier
5ad8c2a630 Merge branch '3.4' into 4.4
* 3.4:
  Fix tests on 5.6
  [Debug] Skip a test that was meant for HHVM.
  [Console] Silence warnings on sapi_windows_cp_set() call
  guard $argv + $token against null, preventing unnecessary exceptions
2020-09-09 07:14:20 +02:00
Fabien Potencier
1df26c20a0 minor #38117 [Debug] Skip a test that was meant for HHVM (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Skip a test that was meant for HHVM

| 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 that fails on php 8. If I read the test correctly, it is meant to run on HHVM, so I assumed it's save to skip it if we're on PHP.

Commits
-------

bf62a4d622 [Debug] Skip a test that was meant for HHVM.
2020-09-09 07:12:18 +02:00
Fabien Potencier
336946a499 Fix tests on 5.6 2020-09-09 07:09:37 +02:00
Fabien Potencier
8a186697dc bug #38116 [Console] Silence warnings on sapi_windows_cp_set() call (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Silence warnings on sapi_windows_cp_set() call

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

Commits
-------

2a57ba5267 [Console] Silence warnings on sapi_windows_cp_set() call
2020-09-09 07:06:23 +02:00
Alexander M. Turek
bf62a4d622 [Debug] Skip a test that was meant for HHVM. 2020-09-09 00:19:14 +02:00
Robin Chalas
2a57ba5267 [Console] Silence warnings on sapi_windows_cp_set() call 2020-09-08 23:46:32 +02:00
Nicolas Grekas
68866fbc9e bug #38114 [Console] guard $argv + $token against null, preventing unnecessary exceptions (bilogic)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Console] guard $argv + $token against null, preventing unnecessary exceptions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| Tickets       | Fix https://github.com/symfony/symfony/issues/38105
| License       | MIT

This issue was causing an unnecessary exception, leading to difficulty in locating the actual offending code as reported by many cases as detailed in #38105

Commits
-------

dbe335d9be guard $argv + $token against null, preventing unnecessary exceptions
2020-09-08 22:57:49 +02:00
bilogic
dbe335d9be guard $argv + $token against null, preventing unnecessary exceptions 2020-09-08 22:57:41 +02:00
Nicolas Grekas
908ca446e9 [MonologBridge] fix tests 2020-09-08 17:01:05 +02:00
Nicolas Grekas
966514c46b Merge branch '5.1'
* 5.1:
  [Debug] fix merge
2020-09-08 16:53:50 +02:00
Nicolas Grekas
11596bc02f Merge branch '4.4' into 5.1
* 4.4:
  [Debug] fix merge
2020-09-08 16:52:05 +02:00
Nicolas Grekas
bf9ce8b8b0 [Debug] fix merge 2020-09-08 16:30:03 +02:00
Nicolas Grekas
d96c7a0f40 Merge branch '5.1'
* 5.1:
  [Debug] fix test
  consistently use same types for strict comparisons
  [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
  [VarExporter] unserialize() might throw an Exception on php 8.
  [SecurityHttp] Don't call createMock() with multiple interfaces.
  [ErrorHandler] Parse "x not found" errors correctly on php 8.
  Prevent parsing invalid octal digits as octal numbers
  remove unnecessary check for  existing request
  [DI] fix ContainerBuilder on PHP8
  [Console] Make sure $maxAttempts is an int or null.
  [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
  [Intl] Skip test cases that produce a TypeError on php 8.
  [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  add bosnian (bs) translation
  [Debug] Parse "x not found" errors correctly on php 8.
2020-09-08 16:20:09 +02:00
Nicolas Grekas
62a4559619 Merge branch '4.4' into 5.1
* 4.4:
  [Debug] fix test
  consistently use same types for strict comparisons
  [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
  [VarExporter] unserialize() might throw an Exception on php 8.
  [ErrorHandler] Parse "x not found" errors correctly on php 8.
  Prevent parsing invalid octal digits as octal numbers
  remove unnecessary check for  existing request
  [DI] fix ContainerBuilder on PHP8
  [Console] Make sure $maxAttempts is an int or null.
  [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
  [Intl] Skip test cases that produce a TypeError on php 8.
  [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  add bosnian (bs) translation
  [Debug] Parse "x not found" errors correctly on php 8.
2020-09-08 16:19:54 +02:00
Nicolas Grekas
702916b5a8 minor #38110 [Debug] fix test (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] fix test

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

Commits
-------

16a76739c0 [Debug] fix test
2020-09-08 16:12:36 +02:00
Fabien Potencier
4b2b64a97f feature #37519 [Process] allow setting options esp. "create_new_console" to detach a subprocess (andrei0x309)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Process] allow setting options esp. "create_new_console" to detach a subprocess

Process.php to include support for create_new_console (Windows ONLY)

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      |  no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | #36583 <!-- 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 -->

Based on this issue: https://github.com/symfony/symfony/issues/36583
I created a quick repo [ https://github.com/andrei0x309/tets_sym_proc]( https://github.com/andrei0x309/tets_sym_proc) to illustrate
how this feature can be used, it essentially lets you run something even if your main script has terminated.

It is useful if you want to create something like
`new Process(['php', 'script_with_long_execution_time.php']);`
This was impossible to do on windows until the **create_new_console** flag was added in PHP 7.4.4.
With this feature Process can be used like this:

```
// Start a process and detach form it on Win only
$process = new Process(['php', 'worker.php']);
$process->setOptions(["create_new_console" => true]); // New method I added
$process->disableOutput();
$process->start();
Process Class behavior will never change if the user doesn't use setWinOptions()
```

Commits
-------

e9ab235b66 [Process] allow setting options esp. "create_new_console" to detach a subprocess
2020-09-08 15:25:06 +02:00
Christian Flothmann
16a76739c0 [Debug] fix test 2020-09-08 15:04:06 +02:00
Nicolas Grekas
638f9ecc15 minor #38107 [DependencyInjection] consistently use same types for strict comparisons (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] consistently use same types for strict comparisons

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

Commits
-------

afc11684e0 consistently use same types for strict comparisons
2020-09-08 15:02:55 +02:00
Andrei O
e9ab235b66 [Process] allow setting options esp. "create_new_console" to detach a subprocess 2020-09-08 14:47:24 +02:00
Christian Flothmann
261a939ea6 Merge branch '3.4' into 4.4
* 3.4:
  Prevent parsing invalid octal digits as octal numbers
  [DI] fix ContainerBuilder on PHP8
  [Console] Make sure $maxAttempts is an int or null.
  [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
  [Intl] Skip test cases that produce a TypeError on php 8.
  [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  add bosnian (bs) translation
  [Debug] Parse "x not found" errors correctly on php 8.
2020-09-08 13:16:46 +02:00
Christian Flothmann
afc11684e0 consistently use same types for strict comparisons 2020-09-08 10:26:11 +02:00
Nicolas Grekas
ba61d89ff4 bug #38094 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait (sanmai)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Skip internal classes in CoverageListenerTrait

PHPUnit 9+ is picky about test covering, say, a `\RuntimeException`. Fails with the likes:

    "@covers RuntimeException" is invalid

Judging by the commit e06850c12b this change is required for PHPUnit 9.1 and up. [Here's it being tested.](60c6fb972b/tests/unit/ClassMethodUnitTest.php (L49-L54))

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Follow-up to #38054
| License       | MIT

Commits
-------

a0dedb9aa6 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
2020-09-08 09:26:29 +02:00
Alexey Kopytko
a0dedb9aa6 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait 2020-09-08 09:26:14 +02:00
Nicolas Grekas
f8fddf3917 bug #38101 [VarExporter] unserialize() might throw an Exception on php 8 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarExporter] unserialize() might throw an Exception on php 8

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

VarExporter attempts a deserialization in order to check if a given object can be exported in serialized form. On php 8, the `unserialize` call might throw an exception that needs to be caught and converted to the expected `NotInstantiableTypeException`.

Commits
-------

65112e11bc [VarExporter] unserialize() might throw an Exception on php 8.
2020-09-08 09:04:33 +02:00
Fabien Potencier
12b419e481 bug #38100 [ErrorHandler] Parse "x not found" errors correctly on php 8 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Parse "x not found" errors correctly 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 is #38049 applied to the 4.4 branch.

Commits
-------

d9c9aea7ee [ErrorHandler] Parse "x not found" errors correctly on php 8.
2020-09-08 06:56:58 +02:00
Fabien Potencier
91b6739031 bug #38099 Prevent parsing invalid octal digits as octal numbers (julienfalque)
This PR was merged into the 3.4 branch.

Discussion
----------

Prevent parsing invalid octal digits as octal numbers

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

Values starting with `0` but containing `8` or `9` such as `0123456789` are not valid octal numbers, therefore they should be parsed as regular strings. This is consistent with how other invalid octal values are parsed, e.g. `01234567ab` already gets parsed as the string `"01234567ab"`.

Commits
-------

c7dcd82f03 Prevent parsing invalid octal digits as octal numbers
2020-09-08 06:53:29 +02:00
Robin Chalas
be42ef77a2 minor #38102 [SecurityHttp] Don't call createMock() with multiple interfaces (derrabus)
This PR was merged into the 5.1 branch.

Discussion
----------

[SecurityHttp] Don't call createMock() with multiple interfaces

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

Continuation of #38079 for the 5.1 branch.

Commits
-------

028ec0cf68 [SecurityHttp] Don't call createMock() with multiple interfaces.
2020-09-07 23:27:52 +02:00
Alexander M. Turek
65112e11bc [VarExporter] unserialize() might throw an Exception on php 8. 2020-09-07 23:10:21 +02:00
Alexander M. Turek
028ec0cf68 [SecurityHttp] Don't call createMock() with multiple interfaces. 2020-09-07 21:55:33 +02:00
Alexander M. Turek
d9c9aea7ee [ErrorHandler] Parse "x not found" errors correctly on php 8. 2020-09-07 20:45:32 +02:00
Julien Falque
c7dcd82f03
Prevent parsing invalid octal digits as octal numbers 2020-09-07 20:13:13 +02:00
Fabien Potencier
fff8c001e6 bug #38095 [Mailer] Remove unnecessary check for existing request (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Remove unnecessary check for  existing request

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- 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       | Fix #38035 <!-- 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 -->
<!--
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
-------

3feff72186 remove unnecessary check for  existing request
2020-09-07 17:29:19 +02:00
Jan Schädlich
3feff72186 remove unnecessary check for existing request 2020-09-07 17:24:28 +02:00
Fabien Potencier
3ba965a6cd feature #37704 [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator (IgorTimoshenko)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[MonologBridge] Added SwitchUserTokenProcessor to log the impersonator

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- 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 -->

This pull request adds the ability to log the impersonator user in case of user impersonation feature usage. The current TokenProcessor logs only the current token and there are no ability to simply log the original token, so we need to copy-paste the TokenProcessor and change a few lines to log the original token

Commits
-------

2f8651d4ec [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator
2020-09-07 15:03:25 +02:00
Igor Timoshenko
2f8651d4ec [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator 2020-09-07 15:03:17 +02:00
Markus Fasselt
64f7bd7832 [PropertyInfo] fix array types with keys (array<string, string>) 2020-09-07 14:53:44 +02:00
Fabien Potencier
8e34978e4e bug #38091 [DI] fix ContainerBuilder on PHP8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix ContainerBuilder on PHP8

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

Commits
-------

a3275a7be9 [DI] fix ContainerBuilder on PHP8
2020-09-07 14:09:53 +02:00
Fabien Potencier
38926159e3 Merge branch '5.1'
* 5.1:
  Bump ext-igbinary to 3.1.5 to fix compile error on php 8.
  [HttpClient] with "bindto" with NativeHttpClient
2020-09-07 14:08:32 +02:00
Fabien Potencier
60350341ea Merge branch '4.4' into 5.1
* 4.4:
  Bump ext-igbinary to 3.1.5 to fix compile error on php 8.
  [HttpClient] with "bindto" with NativeHttpClient
2020-09-07 14:08:23 +02:00
Fabien Potencier
2248fa5fbd minor #38090 Bump ext-igbinary to 3.1.5 to fix compile error on php 8 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Bump ext-igbinary to 3.1.5 to fix compile error on php 8

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

Details: http://pecl.php.net/package-changelog.php?package=igbinary

Commits
-------

ddf4fd255e Bump ext-igbinary to 3.1.5 to fix compile error on php 8.
2020-09-07 14:07:53 +02:00
Nicolas Grekas
a3275a7be9 [DI] fix ContainerBuilder on PHP8 2020-09-07 14:07:49 +02:00
Fabien Potencier
b26f11ca0b feature #37545 [DependencyInjection] Add the Required attribute (derrabus)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[DependencyInjection] Add the Required attribute

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

This PR proposes a new attribute `#[Required]` that can be used instead of the `@required` annotation.

Commits
-------

ea262441e7 [DependencyInjection] Add the Required attribute.
2020-09-07 14:06:46 +02:00