Commit Graph

47244 Commits

Author SHA1 Message Date
Nicolas Grekas 4228906e96 Merge branch '3.4' into 4.3
* 3.4:
  [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
  [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
2020-01-09 10:48:33 +01:00
Nicolas Grekas 0716c200a6 minor #35265 [Process] - update @throws phpdoc (Benhssaein Youssef)
This PR was merged into the 4.3 branch.

Discussion
----------

[Process] - update @throws phpdoc

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

Update PHPDoc throws Exceptions on https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Process/Process.php

Commits
-------

2be7029b70 [Process] - update @throws phpdoc
2020-01-09 10:39:14 +01:00
Benhssaein Youssef 2be7029b70 [Process] - update @throws phpdoc 2020-01-09 10:39:05 +01:00
Nicolas Grekas 7e3d89983c minor #35274 [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource (plozmun)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[PHPUnitBridge] file_get_contents() expects parameter 3 to be resource

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

file_get_contents 3rd parameter (context) expects resource or NULL to ignore them

Commits
-------

a28a42187c [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
2020-01-09 10:21:19 +01:00
Pablo Lozano a28a42187c [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource 2020-01-09 10:21:13 +01:00
Nicolas Grekas c3c8e2c806 bug #35254 [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails (mpdude)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails

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

Some commands executed by the `simple-phpunit` script are not checked for success. For example [here](https://travis-ci.org/twigphp/Twig/jobs/634110681), Composer fails with the message

```
  [InvalidArgumentException]
  Could not find package phpunit/phpunit with version 7.5.* in a version inst
  allable using your PHP version 7.0.25.
```

Yet, the `simple-phpunit` script happily continues, going over failing `chdir()`, `file_get_contents()` and `include()` calls and eventually returns a successful `0` exit code. So CI tests look OK when in fact PHPUnit was not even downloaded.

Commits
-------

576e18561f [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
2020-01-09 10:20:23 +01:00
Matthias Pigulla 576e18561f [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails 2020-01-09 10:20:13 +01:00
Pierre du Plessis 1137bdc3f7
Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient 2020-01-09 09:41:13 +02:00
Robin Chalas 1443b43e1b feature #34819 [Console] Add SingleCommandApplication to ease creation of Single Command Application (lyrixx)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Console] Add SingleCommandApplication to ease creation of Single Command Application

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

---

```php
<?php

require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\SingleCommandApplication;

(new SingleCommandApplication())
    ->setName('My Super Command') // Optional
    ->setVersion('1.0.0') // Optional
    ->setProcessTitle('my_proc_title') // Optional
    ->addArgument('who', InputArgument::OPTIONAL, 'Who', 'World')  // Optional
    ->setCode(function(InputInterface $input, OutputInterface $output) {
        $output->writeln(sprintf('Hello %s!', $input->getArgument('who')));
    })
    ->run()
;

```

---

Note: I tried this too, and it works as expected:

```php

class MyCommand extends SingleCommandApplication
{
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('hello');

        return 0;
    }
}

new MyCommand();
```

Commits
-------

4af513d449 [Console] Add SingleCommandApplication to ease creation of Single Command Application
2020-01-09 04:02:00 +01:00
Thomas Calvet 18ce8399d2 [HttpKernel][FileLocator] Fix deprecation message 2020-01-08 19:38:10 +01:00
Nicolas Grekas 8acfd3a9d2 Merge branch '5.0'
* 5.0:
  [Debug] fix ClassNotFoundFatalErrorHandler
  [FrameworkBundle] Document the router.cache_class_prefix parameter removal
  [Routing] Fix using a custom matcher & generator dumper class
  [Notifier] Add more specific types at documentation level when php engine can't
  [Serializer] Fix cache in MetadataAwareNameConverter
  [Dotenv] Fixed infinite loop with missing quote followed by quoted value
  [HttpClient] Added missing sprintf
  [TwigBridge] button_widget now has its title attr translated even if its label = null or false
  [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
  [Messenger] Added check if json_encode succeeded
  [Messenger] Added check if json_encode succeeded
  [FrameworkBundle][ContainerLintCommand] Only skip .errored. services
  [HttpClient] fix exception in case of PSR17 discovery failure
  [DependencyInjection] Handle ServiceClosureArgument for callable in container linting
  fix processing chain adapter based cache pool
  [HttpKernel] release lock explicitly
  [Security] Prevent canceled remember-me cookie from being accepted
  [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
  [Security\Guard] Fix missing typehints
  do not render preferred choices as selected
2020-01-08 18:33:57 +01:00
Nicolas Grekas d65de0f772 Merge branch '4.4' into 5.0
* 4.4:
  [Debug] fix ClassNotFoundFatalErrorHandler
  [Routing] Fix using a custom matcher & generator dumper class
  [Serializer] Fix cache in MetadataAwareNameConverter
  [Dotenv] Fixed infinite loop with missing quote followed by quoted value
  [HttpClient] Added missing sprintf
  [TwigBridge] button_widget now has its title attr translated even if its label = null or false
  [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
  [Messenger] Added check if json_encode succeeded
  [Messenger] Added check if json_encode succeeded
  [FrameworkBundle][ContainerLintCommand] Only skip .errored. services
  [HttpClient] fix exception in case of PSR17 discovery failure
  [DependencyInjection] Handle ServiceClosureArgument for callable in container linting
  fix processing chain adapter based cache pool
  [HttpKernel] release lock explicitly
  [Security] Prevent canceled remember-me cookie from being accepted
  [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
  [Security\Guard] Fix missing typehints
  do not render preferred choices as selected
2020-01-08 18:33:29 +01:00
Nicolas Grekas 80cd480254 Merge branch '4.3' into 4.4
* 4.3:
  [Debug] fix ClassNotFoundFatalErrorHandler
  [Routing] Fix using a custom matcher & generator dumper class
  [Dotenv] Fixed infinite loop with missing quote followed by quoted value
  [HttpClient] Added missing sprintf
  [TwigBridge] button_widget now has its title attr translated even if its label = null or false
  [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
  [Messenger] Added check if json_encode succeeded
  [Security] Prevent canceled remember-me cookie from being accepted
  [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
  [Security\Guard] Fix missing typehints
2020-01-08 18:29:02 +01:00
Nicolas Grekas 9b11c36bd2 bug #35261 [Routing] Fix using a custom matcher & generator dumper class (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] Fix using a custom matcher & generator dumper class

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

This PR fixes a BC break I encountered while upgrading an existing project from 4.2 to 4.4. In this project I use a custom `generator_dumper_class` that is not a `CompiledUrlGeneratorDumper` (it didn't exist yet). I faced 2 problems:
- The generator is considered "compiled" while it is not. This is because we don't check if the `generator_dumper_class` is effectively a `CompiledUrlGeneratorDumper` to compute the `$compiled` variable. That result in a `\TypeError: Return value of Symfony\Component\Routing\Router::getCompiledRoutes() must be of the type array, int returned`
- My custom dumper is not used at all. This is because of https://github.com/symfony/symfony/pull/31964. I altered the condition to fall back only in one way and not the other. The original issue is still fixed (if one uses a classic `UrlGenerator` + a `CompiledUrlGeneratorDumper`, it fall backs on `PhpGeneratorDumper`). However, if one uses a `CompiledUrlGenerator` + a classic `PhpGeneratorDumper` (my case), the classic dumper is still returned. Since `$compiled` is now correctly computed, this case works fine. The Router won't try to get the compiled routes and will use the "old" way.

Commits
-------

3a840a9796 [Routing] Fix using a custom matcher & generator dumper class
2020-01-08 18:23:22 +01:00
Nicolas Grekas d6381617ac Merge branch '3.4' into 4.3
* 3.4:
  [Debug] fix ClassNotFoundFatalErrorHandler
  [Dotenv] Fixed infinite loop with missing quote followed by quoted value
  [TwigBridge] button_widget now has its title attr translated even if its label = null or false
  [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
  [Security] Prevent canceled remember-me cookie from being accepted
  [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
2020-01-08 18:19:22 +01:00
Nicolas Grekas a4a1f12a00 bug #34643 [Dotenv] Fixed infinite loop with missing quote followed by quoted value (naitsirch)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] Fixed infinite loop with missing quote followed by quoted value

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

If there's a quote missing to end a value and in the next line there's again a quoted value Dotenv will run into an infinite loop. An .env file with the following content will result in this error:
```
FOO="foo
BAR="bar"
```
See #34642 for more details.

Commits
-------

eb69e135b2 [Dotenv] Fixed infinite loop with missing quote followed by quoted value
2020-01-08 18:02:35 +01:00
Nicolas Grekas fd19bd7816 bug #35239 [Security\Http] Prevent canceled remember-me cookie from being accepted (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security\Http] Prevent canceled remember-me cookie from being accepted

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

`RememberMeServices::autoLogin()` only checks that the cookie exists in `$request->cookies` while `loginFail()` only alter `$request->attributes` (which allows child implementations to read the canceled cookie for e.g. removing a persistent one).
This makes `autoLogin()` checks for `request->attributes` first, which fixes the linked issue.

Failure expected on deps=high build.

Commits
-------

9b711b87fe [Security] Prevent canceled remember-me cookie from being accepted
2020-01-08 18:02:00 +01:00
Nicolas Grekas 6bb1479012 minor #35263 [FrameworkBundle] Document the router.cache_class_prefix parameter removal (fancyweb)
This PR was merged into the 5.0 branch.

Discussion
----------

[FrameworkBundle] Document the router.cache_class_prefix parameter removal

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

I use this parameter in one of my project. It was removed but it was not documented.

Commits
-------

add10dfe2c [FrameworkBundle] Document the router.cache_class_prefix parameter removal
2020-01-08 17:58:38 +01:00
Nicolas Grekas 2f38a5a6c0 bug #35267 [Debug] fix ClassNotFoundFatalErrorHandler (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] fix ClassNotFoundFatalErrorHandler

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

Spotted by the CI on 4.4, see https://github.com/symfony/symfony/pull/35266 for details.
Replaces https://github.com/symfony/symfony/pull/35255 /cc @mpdude

Commits
-------

0c320febe1 [Debug] fix ClassNotFoundFatalErrorHandler
2020-01-08 17:40:23 +01:00
Nicolas Grekas 0c320febe1 [Debug] fix ClassNotFoundFatalErrorHandler 2020-01-08 17:36:15 +01:00
Thomas Calvet add10dfe2c [FrameworkBundle] Document the router.cache_class_prefix parameter removal 2020-01-08 15:54:22 +01:00
Thomas Calvet 3a840a9796 [Routing] Fix using a custom matcher & generator dumper class 2020-01-08 15:00:15 +01:00
Grégoire Pineau 4af513d449 [Console] Add SingleCommandApplication to ease creation of Single Command Application
```
<?php

require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\SingleCommandApplication;

(new SingleCommandApplication())
    ->setName('My Super Command') // Optional
    ->setVersion('1.0.0') // Optional
    ->setProcessTitle('my_proc_title') // Optional
    ->addArgument('who', InputArgument::OPTIONAL, 'Who', 'World')  // Optional
    ->setCode(function(InputInterface $input, OutputInterface $output): int {
        $output->writeln(sprintf('Hello %s!', $input->getArgument('who')));

        return 0;
    })
    ->run()
;

```
2020-01-08 12:40:31 +01:00
Islam93 b3a2173c8e [DI] deferred exceptions in ResolveParameterPlaceHoldersPass 2020-01-08 14:20:51 +03:00
Fabien Potencier ad7d24109c minor #35081 [Notifier] Add more specific types at documentation level when php engine can't (Philippe Segatori)
This PR was squashed before being merged into the 5.0 branch (closes #35081).

Discussion
----------

[Notifier] Add more specific types at documentation level when php engine can't

| Q             | A
| ------------- | ---
| Branch?       | 5.0 <!-- 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       | Fix #35078  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | . <!-- required for new features -->

This an example of the proposal made in #35078 to document a narrower type when php type declaration cannot.

Commits
-------

b9931f571c [Notifier] Add more specific types at documentation level when php engine can't
2020-01-08 10:13:33 +01:00
Philippe Segatori b9931f571c [Notifier] Add more specific types at documentation level when php engine can't 2020-01-08 10:13:26 +01:00
Fabien Potencier 9589dee808 bug #35252 [Serializer] Fix cache in MetadataAwareNameConverter (bastnic)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Fix cache in MetadataAwareNameConverter

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

`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculation all the time.

This is a serious perf improvement in prod mode for an api.

![image](https://user-images.githubusercontent.com/84887/71933779-38c3ae80-31a3-11ea-8871-8e57cec87a89.png)

![image](https://user-images.githubusercontent.com/84887/71933675-074ae300-31a3-11ea-8e84-7adad3e6c96f.png)

Commits
-------

6449f9299c [Serializer] Fix cache in MetadataAwareNameConverter
2020-01-08 08:58:38 +01:00
Loïck Piera 7f2cef759c
Add support for safe preference - RFC8674 2020-01-07 23:59:55 +01:00
Bastien Jaillot 6449f9299c [Serializer] Fix cache in MetadataAwareNameConverter
`isset` is used to test existence of values that is
`null` by default, which result to always bypass the cache
and force to do the calculate all the time.

This is a critical perf improvement in prod mode for an api.

Ref #35085
2020-01-07 23:30:39 +01:00
Nicolas Grekas 1e4e0ec979 minor #35250 [HttpClient] Added missing sprintf (TiGR)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Added missing sprintf

It was supposed to be there.

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

Commits
-------

08c1481b88 [HttpClient] Added missing sprintf
2020-01-07 22:30:00 +01:00
naitsirch eb69e135b2 [Dotenv] Fixed infinite loop with missing quote followed by quoted value
If there's a quote missing to end a value and in the next line there's again a quoted value Dotenv will run into an infinite loop. An .env file with the following content will result in this error:
```
FOO="foo
BAR="bar"
```
See #34642 for more details.
2020-01-07 21:29:45 +01:00
Igor Tarasov 08c1481b88
[HttpClient] Added missing sprintf
It was supposed to be there.
2020-01-07 23:22:51 +03:00
Fabien Potencier 20bf17f6ad feature #35104 [Messenger] Log sender alias in SendMessageMiddleware (ruudk)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Log sender alias in SendMessageMiddleware

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

This makes it easier to read which sender alias was used.

```diff
- Sending message Domain\Event\PaymentFlow\PaymentFlowFailedEvent with Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
+ Sending message Domain\Event\PaymentFlow\PaymentFlowFailedEvent with async sender using Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransport
```

Commits
-------

4e6626ca63 Log sender alias in SendMessageMiddleware
2020-01-07 20:50:54 +01:00
Fabien Potencier e781cd8283 minor #35109 [FrameworkBundle] cache ClassMetadataFactory in debug (bastnic)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] cache ClassMetadataFactory in debug

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no (performance)
| New feature?  | performance...
| Deprecations? | no
| Tickets       | #35096
| License       | MIT
| Doc PR        |

Cf #35096, validator and serialization yaml/xml files are parsed at each requests. But they are already tracked by a `DirectoryResource` in
bd9dc7c573/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php (L1246-L1261)

So it only needs a real cache purge on validator / serializer sytem cache, and I use the [CachePoolClearerCacheWarmer](https://github.com/api-platform/core/blob/master/src/Bridge/Symfony/Bundle/CacheWarmer/CachePoolClearerCacheWarmer.php) from APIP that already does similar things.

Handling that sort of cache in Symfony fixes a lot of others performance issue.

![image](https://user-images.githubusercontent.com/84887/71452294-e6869480-2783-11ea-9aa8-431db3edfd8d.png)

Commits
-------

53324986cb [FrameworkBundle] cache ClassMetadataFactory in debug
2020-01-07 20:35:07 +01:00
Fabien Potencier b9cc0c8985 bug #35200 [TwigBridge] do not render preferred choices as selected (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] do not render preferred choices as selected

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/35135#issuecomment-570607719
| License       | MIT
| Doc PR        |

Commits
-------

c5b8190424 do not render preferred choices as selected
2020-01-07 20:31:57 +01:00
Fabien Potencier 290ce00f96 bug #35243 [HttpKernel] release lock explicitly (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] release lock explicitly

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

Commits
-------

6fb55812ab [HttpKernel] release lock explicitly
2020-01-07 20:30:23 +01:00
Fabien Potencier aaf6915661 bug #35193 [TwigBridge] button_widget now has its title attr translated even if its label = null or false (stephen-lewis)
This PR was squashed before being merged into the 3.4 branch (closes #35193).

Discussion
----------

[TwigBridge] button_widget now has its title attr translated even if its label = null or false

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

Duplicate of #34436 but changed to bugfix and applied to 3.4. Buttons with null or false 'label' options will now have their 'title' attribute translated against the current translation domain.

Commits
-------

2a5d9cb75a [TwigBridge] button_widget now has its title attr translated even if its label = null or false
2020-01-07 20:28:14 +01:00
Stephen Lewis 2a5d9cb75a [TwigBridge] button_widget now has its title attr translated even if its label = null or false 2020-01-07 20:28:09 +01:00
Nicolas Grekas c4c0b84366 bug #35219 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script (oleg-andreyev)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script

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

Locally using [phpenv](https://github.com/phpenv/phpenv) together [phpenv-composer](https://github.com/ngyuki/phpenv-composer) with for managing php versions and composer installations.

`which composer` is detecting wrapper instead of binary.
Before appending PHP executable to composer path need to validate that detected composer is not a wrapper otherwise PHP will simply return the content of a wrapper

Commits
-------

25c805ed56 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
2020-01-07 20:24:08 +01:00
Oleg Andreyev 25c805ed56 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script 2020-01-07 20:24:01 +01:00
Fabien Potencier 47a866bf7b bug #35150 [Messenger] Added check if json_encode succeeded (toooni)
This PR was squashed before being merged into the 4.3 branch (closes #35150).

Discussion
----------

[Messenger] Added check if json_encode succeeded

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

Similar PR as https://github.com/symfony/symfony/pull/35137 but for branch 4.3.

When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

Commits
-------

c2bdc4c4d3 [Messenger] Added check if json_encode succeeded
2020-01-07 20:21:24 +01:00
Toni Rudolf c2bdc4c4d3 [Messenger] Added check if json_encode succeeded 2020-01-07 20:21:19 +01:00
Fabien Potencier 0942e336aa bug #35137 [Messenger] Added check if json_encode succeeded (toooni)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead (closes #35137).

Discussion
----------

[Messenger] Added check if json_encode succeeded

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

When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

Commits
-------

a16a574ca8 [Messenger] Added check if json_encode succeeded
2020-01-07 20:20:31 +01:00
Toni Rudolf a16a574ca8 [Messenger] Added check if json_encode succeeded 2020-01-07 20:20:25 +01:00
Fabien Potencier 7fa87b46e3 bug #35170 [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/34865#discussion_r362432040
| License       | MIT
| Doc PR        | -

Outputing everything on stderr seems wrong. I'm going to check upper branches.

Commits
-------

87212e41b3 [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
2020-01-07 20:18:41 +01:00
Fabien Potencier 9e7a4102ad bug #35245 [HttpClient] fix exception in case of PSR17 discovery failure (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix exception in case of PSR17 discovery failure

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

On symfony.com, we need to use HTTPlug for 3rd party libs. When `nyholm/psr7` is not installed, we currently see an exception saying `No HTTPlug clients found.` from `HttpClientDiscovery`.

This fixes the message by correctly suggesting `nyholm/psr7` instead, since there *is* an HTTPlug client: `HttplugClient` from our HttpClient component.

It's quite unfortunate that `guzzle/psr7` provides no PSR17 factory yet, because that would have solved some part of this deps mess. /cc @Nyholm @sagikazarmark FYI
Note that https://packagist.org/providers/psr/http-factory-implementation lists `guzzle/psr7` but this is a wrong solution: no tagged release of it is PSR17-compatible, which means installing it doesn't solve the issue.

Commits
-------

96e70a4080 [HttpClient] fix exception in case of PSR17 discovery failure
2020-01-07 20:17:11 +01:00
Fabien Potencier ada4c56a91 bug #35244 [Cache] fix processing chain adapter based cache pool (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] fix processing chain adapter based cache pool

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

Commits
-------

8d7fa32d15 fix processing chain adapter based cache pool
2020-01-07 20:15:45 +01:00
Fabien Potencier 6eb024b103 bug #35247 [FrameworkBundle][ContainerLintCommand] Only skip .errored. services (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][ContainerLintCommand] Only skip .errored. services

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

This PR partially reverts https://github.com/symfony/symfony/pull/34935 that was a kind of a mistake. Skipping all removed ids cannot work because all private services are in the "removed" ids. So the command ends up not validating much.

To still fix the original issue https://github.com/symfony/symfony/issues/34858 we need to skip errored services. However, definition errors are not dumped / read (see https://github.com/symfony/symfony/pull/34928). So instead, even if it's bad, we can maybe rely on the name for this particular error since it's hardcoded 😕 At least it fixes this case in a simple way 😕

Commits
-------

d38cdc9dce [FrameworkBundle][ContainerLintCommand] Only skip .errored. services
2020-01-07 20:14:23 +01:00
Fabien Potencier c29b2a11d4 feature #35205 [Form] derive the view timezone from the model timezone (xabbuh)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] derive the view timezone from the model timezone

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

Commits
-------

ef5835d833 derive the view timezone from the model timezone
2020-01-07 20:12:15 +01:00
Fabien Potencier de34f229a9 minor #35213 [Security\Guard] Fix missing typehints (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security\Guard] Fix missing typehints

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

Commits
-------

2ef8771ad7 [Security\Guard] Fix missing typehints
2020-01-07 20:10:35 +01:00