Commit Graph

48745 Commits

Author SHA1 Message Date
Jérémy Derussé 945c7c590c
minor #39920 [Console] Fix console logger according to PSR-3 (alex-dev)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fix console logger according to PSR-3

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39050, #29138
| License       | MIT

`Symfony\Component\HttpKernel\EventListener\ErrorListener` logs non-HTTP exceptions at `LogLevel::CRITICAL`.
`Symfony\Component\Messenger\Worker` logs unrecoverable exceptions at `LogLevel::CRITICAL`.
`Symfony\Component\Console\EventListener\ErrorListener` logs exceptions at `LogLevel::ERROR`.

As per PSR-3, unexpected and unrecoverable exceptions should be logged at `LogLevel::CRITICAL`.

Commits
-------

69fcd075eb Fix console logger according to PSR-3
2021-01-28 23:01:20 +01:00
Robin Chalas be788ee119 minor #39997 Use createMock() instead of a getter (OskarStark)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Use createMock() instead of a getter

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

Before I go on, are you interested in such change @nicolas-grekas ?

Commits
-------

9629dafa66 Use createMock() instead of a getter
2021-01-28 20:07:58 +01:00
Oskar Stark 9629dafa66 Use createMock() instead of a getter 2021-01-28 20:07:50 +01:00
Nicolas Grekas e2428326e3 bug #40023 [Finder]  use proper keys to not override appended files (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder]  use proper keys to not override appended files

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

Commits
-------

036c8d71fd use proper keys to not override appended files
2021-01-28 17:58:58 +01:00
Nicolas Grekas 27fab22fa6 bug #40019 [ErrorHandler] Fix strpos error when trying to call a method without a name (Deuchnord)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Fix strpos error when trying to call a method without a name

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | None (direct fix)
| License       | MIT
| Doc PR        | None
<!--
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 5.x.
-->

When running the following code:

```php
class Foo
{
    // Some code here
}

$str = ''; // this should not happen, but for some reason, it did.
$foo->{$str}();
```

a fatal error occurs because the method name to execute is empty, but Symfony's error enhancer fails to parse it:

![Error screenshot](https://user-images.githubusercontent.com/7600265/106108704-ec019b80-6148-11eb-82bc-f7801e30fea4.png)

In this PR, I propose a fix with a more clear error to inform the developer about what happened.

Commits
-------

66be87bffc [ErrorHandler] Fix strpos error when trying to call a method without a name
2021-01-28 17:54:55 +01:00
Jérôme Deuchnord 66be87bffc [ErrorHandler] Fix strpos error when trying to call a method without a name 2021-01-28 17:54:48 +01:00
Christian Flothmann 036c8d71fd use proper keys to not override appended files 2021-01-28 15:45:15 +01:00
Nicolas Grekas 8533ea223e bug #40004 [Serializer] Prevent access to private properties without getters (julienfalque)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Prevent access to private properties without getters

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

When upgrading `symfony/serializer` from `v5.2.1` to `v5.2.2`, the serializer starts throwing exceptions because it cannot access some private properties that don't have a getter. This looks related to #38900.

Commits
-------

f0409b403f [Serializer] Prevent access to private properties without getters
2021-01-27 19:11:59 +01:00
Julien Falque f0409b403f
[Serializer] Prevent access to private properties without getters 2021-01-27 17:59:11 +01:00
Nicolas Grekas f667d792df minor #40002 Replace "branch-version" by "versions" in composer.json (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Replace "branch-version" by "versions" in composer.json

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

Accommodates for https://github.com/composer/composer/pull/9637

Commits
-------

b40e71f096 Replace "branch-version" by "versions" in composer.json
2021-01-27 17:24:49 +01:00
Nicolas Grekas b40e71f096 Replace "branch-version" by "versions" in composer.json 2021-01-27 17:22:20 +01:00
Fabien Potencier aeb15a1322 Bump Symfony version to 4.4.20 2021-01-27 14:59:11 +01:00
Fabien Potencier c2c71dee2c
Merge pull request #39998 from fabpot/release-4.4.19
released v4.4.19
2021-01-27 14:51:38 +01:00
Fabien Potencier 7fb2dbf465 Update VERSION for 4.4.19 2021-01-27 14:50:53 +01:00
Fabien Potencier f8c9307f48 Update CONTRIBUTORS for 4.4.19 2021-01-27 14:50:29 +01:00
Fabien Potencier d02f3635c6 Update CHANGELOG for 4.4.19 2021-01-27 14:50:17 +01:00
Nicolas Grekas 22b1eb40a3 minor #39941 Use createMock() and use import instead of FQCN (OskarStark)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Use createMock() and use import instead of FQCN

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

Commits
-------

e7e61ee551 Use createMock() and use import instead of FQCN
2021-01-27 10:09:34 +01:00
Oskar Stark e7e61ee551 Use createMock() and use import instead of FQCN 2021-01-27 10:09:26 +01:00
Nicolas Grekas c925f4cff8 minor #39987 [HttpKernel] Fix transient tests (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Fix transient tests

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

Because request contains a `REQUEST_TIME` attribute, it make tests failing https://ci.appveyor.com/project/fabpot/symfony/builds/37455398

Commits
-------

9562d6ba5a Fix transient tests
2021-01-27 09:41:19 +01:00
Nicolas Grekas 190f089fee minor #39990 [DoctrineBridge] Fix class resolution in Doctrine EventListenerPass (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Fix class resolution in Doctrine EventListenerPass

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

Commits
-------

08b2da79e8 Fix class resolution in Doctrine EventListenerPass
2021-01-27 09:30:24 +01:00
Jérémy Derussé 9562d6ba5a
Fix transient tests 2021-01-27 01:05:29 +01:00
Jérémy Derussé 08b2da79e8
Fix class resolution in Doctrine EventListenerPass 2021-01-27 01:01:34 +01:00
Nicolas Grekas 484a95d8d1 bug #38900 [Serializer] Exclude non-initialized properties accessed with getters (BoShurik)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Exclude non-initialized properties accessed with getters

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

Allow to serialize
```php
final class Php74DummyPrivate
{
    private string $uninitializedProperty;

    private string $initializedProperty = 'defaultValue';

    public function getUninitializedProperty(): string
    {
        return $this->uninitializedProperty;
    }

    public function getInitializedProperty(): string
    {
        return $this->initializedProperty;
    }
}
```

Similar to #34791

Commits
-------

da9100320e Exclude non-initialized properties accessed with getters
2021-01-26 21:44:18 +01:00
Nicolas Grekas ffdc46c86b minor #39975 [Serializer] Fix tests wrongly marked as incomplete (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Fix tests wrongly marked as incomplete

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

https://github.com/symfony/symfony/pull/30907 has been merged meanwhile.

Commits
-------

e632302004 [Serializer] Fix tests  marked as incomplete
2021-01-26 21:39:55 +01:00
Robin Chalas e632302004 [Serializer] Fix tests marked as incomplete 2021-01-26 11:29:51 +01:00
Christian Flothmann 85989c3678 keep valid submitted choices when additional choices are submitted 2021-01-26 10:39:19 +01:00
Nicolas Grekas 4b8983aef5 bug #39887 [Translator] fix handling plural for floating numbers (kylekatarnls)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Translator] fix handling plural for floating numbers

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

Commits
-------

533cd7ef6c [Translator] fix handling plural for floating numbers
2021-01-26 10:08:00 +01:00
kylekatarnls 533cd7ef6c [Translator] fix handling plural for floating numbers 2021-01-26 10:07:54 +01:00
Nicolas Grekas aa5ca01ed0 bug #39967 [Messenger] fix redis messenger options with dsn (Kleinast)
This PR was submitted for the 5.1 branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Messenger] fix redis messenger options with dsn

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

This will fix the fact that you can use framework.messenger.transports.*.options to complete/default your redis configuration

Commits
-------

a0e7bf4c0d fix redis messenger options with dsn
2021-01-26 09:57:27 +01:00
Bastien Picharles a0e7bf4c0d fix redis messenger options with dsn 2021-01-26 09:57:06 +01:00
Alexander M. Turek d244e796b6 minor #39964 [Console] Fix typo in console.command description (oceanicpanda)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Console] Fix typo in console.command description

input and output can be handed to the command, handed off to the command, or can be handled by the command, but handled to the command doesn't work

| 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       | N/A <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->

Commits
-------

38fd86f34e Update ConsoleEvents.php
2021-01-26 09:54:48 +01:00
Steve Hyde 38fd86f34e Update ConsoleEvents.php
input and output can be handed to the command, handed off to the command, or can be handled by the command, but handled to the command doesn't work
2021-01-26 09:54:39 +01:00
Alexander M. Turek 77401ef844 minor #39973 allow Doctrine persistence 2 too (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

allow Doctrine persistence 2 too

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/39968#pullrequestreview-575900703
| License       | MIT
| Doc PR        |

Commits
-------

11a9e10beb allow Doctrine persistence 2 too
2021-01-26 09:42:19 +01:00
Christian Flothmann 11a9e10beb allow Doctrine persistence 2 too 2021-01-26 08:56:21 +01:00
Fabien Potencier 43eb050c0d bug #39970 [Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64

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

Replaces #33920

When using the Doctrine transport, sending emails with binary attachments currently requires a custom Messenger serializer because the "body" column is created for UTF-8 only.

In #33920, it is proposed to change the TEXT type to a BLOB. It leaves at least one problem unhandled: the conversion of existing messenger tables.

This PR takes a more conservative approach, by encoding messages to base 64, only if they are non-UTF8.

Compatibility with the existing format is preserved.

The drawback of this approach is that the size of eg email attachments is going to increase by 33% because of the extra encoding. I think this drawback is acceptable for 4.4, and that this PR is the most pragmatic way to make attachments just work.

Commits
-------

6fc9e51722 [Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64
2021-01-25 22:43:21 +01:00
Nicolas Grekas 6fc9e51722 [Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64 2021-01-25 18:37:49 +01:00
Robin Chalas 11290f9c8d minor #39968 [FrameworkBundle] add doctrine/persistence as a dev requirement (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] add doctrine/persistence as a dev requirement

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/39941#discussion_r563736775
| License       | MIT
| Doc PR        |

Otherwise, we are testing something that will never be possible in a real application.

Commits
-------

6ea9e4d7ca add doctrine/persistence as a dev requirement
2021-01-25 18:08:47 +01:00
Christian Flothmann 6ea9e4d7ca add doctrine/persistence as a dev requirement 2021-01-25 17:45:18 +01:00
Nicolas Grekas 4181c431e9 minor #39959 Changed private static array-properties to const (simonberger)
This PR was merged into the 4.4 branch.

Discussion
----------

Changed private static array-properties to const

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

This changes all private static properties (just screened arrays) to private const. I left out those which have write access obviously and also those with `static::` access.

It is a new implementation of #38213. Based on 4.4 this time.
If merging it up creates several conflicts, you could ignore all changes of 4.4 and I create a new branch for 5.1 or 5.2. I'll do this anyway if any new private static arrays are existing there.

Commits
-------

aa79381fe4 Changed private static array-properties to const
2021-01-25 14:56:02 +01:00
BoShurik da9100320e Exclude non-initialized properties accessed with getters 2021-01-25 13:41:50 +03:00
Simon Berger aa79381fe4 Changed private static array-properties to const 2021-01-25 00:44:26 +01:00
Nicolas Grekas 0c7eb27c5e bug #39909 [PhpUnitBridge] Allow relative path to composer cache (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Allow relative path to composer cache

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

When users defines a relative path in the `COMPOSER_CACHE_DIR` env variable,
The `simple-phpunit` code, by changing the directory (with `chdir`), give to composer a different context. At the end, composer stores its cache inside the `vendor/bin/.phpunit` folder, and inside the `vendor/bin/.phpunit/phpunit-X.Y.Z` folder.

This PR convert the relative path provided by the user into Absolute path.

Commits
-------

cde0ffdc83 Allow relative path to composer cache
2021-01-23 19:22:35 +01:00
Nicolas Grekas 799bc2a8e0 bug #39944 [HttpKernel] Configure the ErrorHandler even when it is overriden (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Configure the ErrorHandler even when it is overriden

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

Fixes the part of https://github.com/getsentry/sentry-symfony/issues/421 that is about `DebugHandlersListener`.

Commits
-------

31817b48e2 [HttpKernel] Configure the ErrorHandler even when it is overriden
2021-01-23 19:11:27 +01:00
Nicolas Grekas 31817b48e2 [HttpKernel] Configure the ErrorHandler even when it is overriden 2021-01-22 18:13:09 +01:00
Robin Chalas bf1752a550 minor #39938 "export-ignore" contracts and phpunit-bridge (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

"export-ignore" contracts and phpunit-bridge

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

Since these directories are not autoloaded.

Commits
-------

12e19a9a3d "export-ignore" contracts and phpunit-bridge
2021-01-22 13:41:57 +01:00
Robin Chalas c6f5e2a3b8 bug #39932 [Console] [Command] Fix Closure code binding when it is a static anonymous function (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] [Command] Fix Closure code binding when it is a static anonymous function

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

I'm building a single command application and I did:
```php
->setCode(static function (InputInterface $input, OutputInterface $output): void {
    // my code
})
```
and it results in a warning `Cannot bind an instance to a static closure` + an exception `You must override the execute() method in the concrete command class.` I guess we should silently fail here if the Closure is not bindable.

Commits
-------

18d426871e [Console][Command] Fix Closure code binding when it is a static anonymous function
2021-01-22 13:37:43 +01:00
Jérémy Derussé 10f3b10978
minor #39930 Use class const in test (OskarStark)
This PR was merged into the 4.4 branch.

Discussion
----------

Use class const in test

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

super minor

Commits
-------

39181f4fdf Use class const in test
2021-01-22 11:21:47 +01:00
Nicolas Grekas 12e19a9a3d "export-ignore" contracts and phpunit-bridge 2021-01-22 10:53:35 +01:00
Thomas Calvet 18d426871e [Console][Command] Fix Closure code binding when it is a static anonymous function 2021-01-22 09:23:15 +01:00
Oskar Stark 39181f4fdf Use class const in test 2021-01-22 08:46:09 +01:00