Commit Graph

38312 Commits

Author SHA1 Message Date
Maxime Steinhausser
ddc016988e feature #35235 [Serializer] Added scalar denormalization (a-menshchikov)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Serializer] Added scalar denormalization

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

Was added an ability to deserialize scalar data (single or array).

Commits
-------

dad04d0adf Added scalar denormalization in Serializer + added scalar normalization tests
2020-01-13 09:54:25 +01:00
Zmey
dad04d0adf Added scalar denormalization in Serializer + added scalar normalization tests 2020-01-13 11:50:29 +03:00
Christian Flothmann
45461c73bf fix PHP const mapping keys using the inline notation 2020-01-13 09:00:59 +01:00
Robin Chalas
ffbf31d8c6 [SecurityBundle] Drop duplicated code 2020-01-12 17:20:05 +01:00
Nyholm
25fd665d0e [FrameworkBundle] Make sure one can use fragments.hinclude_default_template 2020-01-12 07:57:34 +01:00
Fabien Potencier
fa358e61e7 feature #35310 [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option

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

The goal here is to get rid of the `config/packages/routing.yaml` file in Symfony 6.
This should have no practical impact as all new apps already define this setting for 2 years.

Commits
-------

84849bc96a [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option
2020-01-12 07:56:05 +01:00
Robin Chalas
093c6fe588 fix CS 2020-01-11 19:51:52 +01:00
Nicolas Grekas
84849bc96a [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option 2020-01-11 19:23:19 +01:00
Fabien Potencier
584b29dd22 feature #34387 [Yaml] Added yaml-lint binary (jschaedl)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Yaml] Added yaml-lint binary

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #18987  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | tbd.
<!--
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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

2640dfedfa [Yaml] Introduce yaml-lint binary
2020-01-11 16:57:28 +01:00
Fabien Potencier
764c91bd9f bug #35304 [HttpKernel] Fix that no-cache MUST revalidate with the origin (mpdude)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix that no-cache MUST revalidate with the origin

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

From [RFC 7234 Section 5.2.2](https://tools.ietf.org/html/rfc7234#section-5.2.2)

> The "no-cache" response directive indicates that the response MUST NOT be used to satisfy a subsequent request without successful validation on the origin server.  This allows an origin server to prevent a cache from using it to satisfy a request without contacting it, even by caches that have been configured to send stale responses.

This is unconditional – the response must be revalidated right away.

(`must-revalidate`, to the contrary, requires revalidation only once the response has become stale.)

Commits
-------

c8bdcb3408 Fix that no-cache requires positive validation with the origin, even for fresh responses
2020-01-11 08:35:43 +01:00
Fabien Potencier
596caf7b8f minor #35303 [FrameworkBundle] Add missing entry about framework.router.context (ogizanagi)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Add missing entry about framework.router.context

| Q             | A
| ------------- | ---
| Branch?       | master <!-- 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       | Relates to #35281 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Some minor tweaks about #35281

Commits
-------

5a83b07bf4 [FrameworkBundle] Add missing entry about framework.router.context
2020-01-11 08:28:35 +01:00
Matthias Pigulla
c8bdcb3408 Fix that no-cache requires positive validation with the origin, even for fresh responses 2020-01-10 22:32:00 +00:00
Robin Chalas
de4c45c90c Merge branch '5.0'
* 5.0:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
  [Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace
  [Workflow] Fix configuration node reference for "initial_marking"
  expand listener in place
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
  Do not throw exception on valut generate key
2020-01-10 22:57:55 +01:00
Robin Chalas
b4a63f925f Merge branch '4.4' into 5.0
* 4.4:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
  [Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace
  [Workflow] Fix configuration node reference for "initial_marking"
  expand listener in place
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
  Do not throw exception on valut generate key
2020-01-10 22:57:37 +01:00
Robin Chalas
36e6ceaeb7 Merge branch '4.3' into 4.4
* 4.3:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [Workflow] Fix configuration node reference for "initial_marking"
  expand listener in place
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
2020-01-10 22:54:01 +01:00
Robin Chalas
1d25a25109 Merge branch '3.4' into 4.3
* 3.4:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
2020-01-10 22:48:14 +01:00
Maxime Steinhausser
5a83b07bf4 [FrameworkBundle] Add missing entry about framework.router.context 2020-01-10 21:40:24 +01:00
Fabien Potencier
37a886354a Fix CS 2020-01-10 13:09:39 +01:00
Fabien Potencier
22bebd805c feature #35257 [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template (Benjamin RICHARD)
This PR was squashed before being merged into the 5.1-dev branch (closes #35257).

Discussion
----------

[FrameworkBundle] TemplateController should accept extra arguments to be sent to the template

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| 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/roadmap):
 - 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.
-->

In the official documentation (symfony.com/doc/master/templates.html#rendering-a-template-directly-from-a-route) it says that TemplateController should accept extra arguments. In fact it's not available for instance.
So i added the context argument as an array. Because of deprecation of templating, only the twig instance will apply the context argument.

It will need to be implemented in branch 5.

The following issue has been created in documentation project : https://github.com/symfony/symfony-docs/issues/12897

Commits
-------

e27b417817 [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template
2020-01-10 13:08:49 +01:00
Benjamin RICHARD
e27b417817 [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template 2020-01-10 13:08:42 +01:00
Fabien Potencier
74feb17927 feature #34980 [Messenger] remove several messages with command messenger:failed:remove (nikophil)
This PR was squashed before being merged into the 5.1-dev branch (closes #34980).

Discussion
----------

[Messenger] remove several messages with command messenger:failed:remove

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

command `messenger:failed:remove` now accepts an array of ids. If several provided, they are not displayed unless option `--show-messages` is passed

Commits
-------

903455e463 [Messenger] remove several messages with command messenger:failed:remove
2020-01-10 12:59:02 +01:00
Nicolas PHILIPPE
903455e463 [Messenger] remove several messages with command messenger:failed:remove 2020-01-10 12:58:56 +01:00
Yanick Witschi
9ad1caa942 Make sure the UriSigner can be autowired 2020-01-10 11:59:51 +01:00
Matthias Pigulla
3a23ec89c3 Avoid stale-if-error if kernel.debug = true, because it hides errors 2020-01-10 10:52:55 +00:00
Fabien Potencier
d8bb14ccff Fix CS 2020-01-10 10:42:21 +01:00
Fabien Potencier
7dae1cad64 feature #31518 [Validator] Added HostnameValidator (karser)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Validator] Added HostnameValidator

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #10088   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This PR adds HostnameValidator support. I encountered this need in my project and was surprised that this issue has been open for years.

Here is short example:
```
App\Entity\Acme:
    properties:
        domain:
            - Hostname: ~
        non_tld_domain:
            - Hostname: { requireTld: false }
```
The option `requireTld` is `true` by default and disallows domains like localhost and etc.

Commits
-------

8a08c2090a Added HostnameValidator
2020-01-10 10:41:53 +01:00
Fabien Potencier
d099bc395f feature #35284 Simplify UriSigner when working with HttpFoundation's Request (Toflar)
This PR was squashed before being merged into the 5.1-dev branch (closes #35284).

Discussion
----------

Simplify UriSigner when working with HttpFoundation's Request

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

I'm using the `UriSigner` in my own projects from time to time and I've always wondered why I have to manually generate the URI from the `Request` instance in such a way that it is correctly validated.
Let's add a new `checkRequest(Request $request)` method to provide better DX.

Commits
-------

4887b4bee1 Simplify UriSigner when working with HttpFoundation's Request
2020-01-10 10:29:03 +01:00
Yanick Witschi
4887b4bee1 Simplify UriSigner when working with HttpFoundation's Request 2020-01-10 10:28:57 +01:00
Fabien Potencier
f9949e3fe8 feature #35285 [FrameworkBundle] Adding better output to secrets:decrypt-to-local command (weaverryan)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Adding better output to secrets:decrypt-to-local command

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

Hi!

The `secrets:decrypt-to-local` doesn't give any output. This adds some basic details:

<img width="1280" alt="Screen Shot 2020-01-09 at 11 53 54 AM" src="https://user-images.githubusercontent.com/121003/72087704-ebe0f480-32d6-11ea-950c-c698abde783d.png">

(note the `-vvv` wasn't necessary in the command to show the output). And the `<info>`part is fixed.

Cheers!

Commits
-------

a6aa9781eb Adding better output to secrets:decrypt-to-local command
2020-01-10 10:20:24 +01:00
Fabien Potencier
9edb1618d2 feature #35273 [HttpClient] Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient (pierredup)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient

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

This allows changing the logger when using `ScopingHttpClient` (and `TraceableHttpClient` during dev)

Commits
-------

1137bdc3f7 Add LoggerAwareInterface to ScopingHttpClient and TraceableHttpClient
2020-01-10 10:17:03 +01:00
Fabien Potencier
d68a4b0e2e bug #35240 [SecurityBundle] Fix collecting traceable listeners info on lazy firewalls (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Fix collecting traceable listeners info on lazy firewalls

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

Before:
![Screenshot 2020-01-07 at 05 17 47](https://user-images.githubusercontent.com/7502063/71869007-cbffd400-3110-11ea-86ad-234da28621c4.png)

After:
![Screenshot 2020-01-07 at 05 18 12](https://user-images.githubusercontent.com/7502063/71869014-d9b55980-3110-11ea-8efc-1f1b16b2c372.png)

Commits
-------

a3a9a0e30a [SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
2020-01-10 10:12:52 +01:00
Fabien Potencier
af3c2059ca feature #34865 [FrameworkBundle][ContainerLintCommand] Style messages (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle][ContainerLintCommand] Style messages

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

It gives a better feedback.

Commits
-------

93aa5bcd0a [FrameworkBundle][ContainerLintCommand] Style messages
2020-01-10 09:17:37 +01:00
Fabien Potencier
20e8cb207b Fix CS 2020-01-10 09:15:23 +01:00
Fabien Potencier
ebf3885aca feature #34847 Add support for safe HTTP preference - RFC 8674 (pyrech)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Add support for safe HTTP preference - RFC 8674

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

[RFC 8674](https://tools.ietf.org/html/rfc8674) (not a IETF standard at the moment) defines a way for user agents to ask for "safe" content to a server. This PR add helper methods to :
- know if the user agent prefers a safe content
- mark the response as safe

Commits
-------

7f2cef759c Add support for safe preference - RFC8674
2020-01-10 09:14:56 +01:00
Fabien Potencier
c146de141b feature #34880 [Twig][Form] Twig theme for Foundation 6 (Lyssal)
This PR was squashed before being merged into the 5.1-dev branch (closes #34880).

Discussion
----------

[Twig][Form] Twig theme for Foundation 6

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

Hi,

I propose a form theme for Foundation 6. This layout stylizes buttons, percent / money widgets and permits switch inputs adding a 'switch-input' attribute (as for https://symfony.com/blog/new-in-symfony-4-4-bootstrap-custom-switches).

![Foundation_6](https://user-images.githubusercontent.com/10855303/70390292-184cdc80-19ca-11ea-8ad8-090358dd9e35.png)

```php
public function buildForm(FormBuilderInterface $builder, array $options): void
{
    $builder
        // ...
        ->add('checkbox-switch', Type\CheckboxType::class, [
            'attr' => [
                'class' => 'switch-input',
            ],
        ])
    ;
}
```

Commits
-------

e47a134db0 [Twig][Form] Twig theme for Foundation 6
2020-01-10 09:11:20 +01:00
Rémi Leclerc
e47a134db0 [Twig][Form] Twig theme for Foundation 6 2020-01-10 09:11:14 +01:00
Fabien Potencier
d1e31a4fe0 bug #35151 [DI] deferred exceptions in ResolveParameterPlaceHoldersPass (Islam93)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] deferred exceptions in ResolveParameterPlaceHoldersPass

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

fixes case #30428
implemented as in AutowiringPass

Commits
-------

b3a2173c8e [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
2020-01-10 09:08:19 +01:00
Fabien Potencier
cc64b028b6 feature #35281 [FrameworkBundle] Configure RequestContext through router config (benji07)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Configure RequestContext through router config

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 #35229  <!-- 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/roadmap):
 - 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.
-->

- [ ] PR on symfony/symfony-docs

Commits
-------

6658900703 [FrameworkBundle] Configure RequestContext through router config
2020-01-10 09:06:12 +01:00
Thomas Calvet
474f3bef08 [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor 2020-01-10 08:52:48 +01:00
Benjamin Lévêque
6658900703 [FrameworkBundle] Configure RequestContext through router config 2020-01-10 08:44:52 +01:00
Ryan Weaver
a6aa9781eb Adding better output to secrets:decrypt-to-local command 2020-01-09 20:22:51 -05:00
Robin Chalas
a3a9a0e30a [SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy 2020-01-09 22:59:13 +01:00
Thomas Calvet
eaa767bebd [Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace 2020-01-09 22:41:08 +01:00
Nicolas Grekas
84de1a35d2 bug #35099 [FrameworkBundle] Do not throw exception on value generate key (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Do not throw exception on value generate key

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

When using env variable instead of key files and creating a new Secret, the check in `generateKeys` (called by the command `SecretsSetCommand`) prevents generating a secret.

reproducer:

```
$ rm config/secrets/prod/prod.decrypt.private.php
$ export SYMFONY_DECRYPTION_SECRET=XXX
$ ./bin/console secret:set FOO

In SodiumVault.php line 50:

  Cannot generate keys when a decryption key has been provided while instantiating the vault.

```

This PR converts the exception in a warning message.

Commits
-------

2f608b4dfa Do not throw exception on valut generate key
2020-01-09 15:20:34 +01:00
Nicolas Grekas
2787024e34 bug #35278 [EventDispatcher] expand listener in place (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] expand listener in place

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

Commits
-------

f5d407318d expand listener in place
2020-01-09 15:01:40 +01:00
Nicolas Grekas
5c37ab016c Merge branch '5.0'
* 5.0:
  [PhpUnitBridge] fix compat with older versions of composer
2020-01-09 14:39:49 +01:00
Nicolas Grekas
6d10f8891e Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix compat with older versions of composer
2020-01-09 14:38:26 +01:00
Nicolas Grekas
415761ef4d Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] fix compat with older versions of composer
2020-01-09 14:38:20 +01:00
Nicolas Grekas
68b96fa024 Merge branch '3.4' into 4.3
* 3.4:
  [PhpUnitBridge] fix compat with older versions of composer
2020-01-09 14:38:14 +01:00
Nicolas Grekas
416f0abf99 [PhpUnitBridge] fix compat with older versions of composer 2020-01-09 14:36:09 +01:00
Nicolas Grekas
1299336de5 fix tests 2020-01-09 14:25:29 +01:00
Christian Flothmann
f5d407318d expand listener in place 2020-01-09 14:17:05 +01:00
Nicolas Grekas
e7f2a1afaa Merge branch '5.0'
* 5.0:
  fix tests
2020-01-09 13:59:39 +01:00
Nicolas Grekas
85cf2ee0ca Merge branch '4.4' into 5.0
* 4.4:
  fix tests
2020-01-09 13:59:02 +01:00
Nicolas Grekas
29f5b180d9 Merge branch '4.3' into 4.4
* 4.3:
  fix tests
2020-01-09 13:57:53 +01:00
Nicolas Grekas
56877e7186 Merge branch '3.4' into 4.3
* 3.4:
  fix tests
2020-01-09 13:45:17 +01:00
Nicolas Grekas
d24df0d441 fix tests 2020-01-09 13:44:20 +01:00
Nicolas Grekas
9476574453 Merge branch '5.0'
* 5.0:
  fix deps
  Relax transient test
2020-01-09 13:39:32 +01:00
Nicolas Grekas
bf47b7d960 Merge branch '4.4' into 5.0
* 4.4:
  fix deps
  Relax transient test
2020-01-09 13:38:56 +01:00
Nicolas Grekas
f06e5ccb84 Merge branch '4.3' into 4.4
* 4.3:
  fix deps
  Relax transient test
2020-01-09 13:35:03 +01:00
Nicolas Grekas
4ee84b3915 fix deps 2020-01-09 13:29:25 +01:00
Nicolas Grekas
cc2246e916 Merge branch '3.4' into 4.3
* 3.4:
  Relax transient test
2020-01-09 13:15:56 +01:00
Nicolas Grekas
0497fd9d31 Relax transient test 2020-01-09 13:09:28 +01:00
Nicolas Grekas
80cc6bda60 Merge branch '5.0'
* 5.0:
  Added more tests for WebProfilerBundle
2020-01-09 13:01:00 +01:00
Nicolas Grekas
0c6f88e43a Merge branch '4.4' into 5.0
* 4.4:
  Added more tests for WebProfilerBundle
2020-01-09 13:00:51 +01:00
Nicolas Grekas
2a3de1a6d1 Merge branch '4.3' into 4.4
* 4.3:
  Added more tests for WebProfilerBundle
2020-01-09 12:59:40 +01:00
Nicolas Grekas
0c47116813 Merge branch '3.4' into 4.3
* 3.4:
  Added more tests for WebProfilerBundle
2020-01-09 12:56:22 +01:00
Javier Eguiluz
2f7a820edd Added more tests for WebProfilerBundle 2020-01-09 12:43:54 +01:00
Nicolas Grekas
e0c1f4da32 Merge branch '5.0'
* 5.0:
  [String] add test case for wordwrap method
  [Process] - update @throws phpdoc
  [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
  [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
  [HttpKernel][FileLocator] Fix deprecation message
2020-01-09 10:56:45 +01:00
Mohamed Gamal
c314598df9 [String] add test case for wordwrap method 2020-01-09 10:55:26 +01:00
Nicolas Grekas
8031b864c3 Merge branch '4.4' into 5.0
* 4.4:
  [Process] - update @throws phpdoc
  [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
  [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
  [HttpKernel][FileLocator] Fix deprecation message
2020-01-09 10:53:06 +01:00
Nicolas Grekas
62c4608e17 bug #35269 [HttpKernel][FileLocator] Fix deprecation message (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel][FileLocator] Fix deprecation message

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

Ref https://github.com/symfony/symfony/pull/34886

`$deprecatedPath` is the foreach value so it only works if the last element triggers the deprecation, otherwise the value is wrong.

Commits
-------

18ce8399d2 [HttpKernel][FileLocator] Fix deprecation message
2020-01-09 10:50:57 +01:00
Nicolas Grekas
e587194d89 Merge branch '4.3' into 4.4
* 4.3:
  [Process] - update @throws phpdoc
  [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:50:08 +01:00
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
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
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
Philippe Segatori
b9931f571c [Notifier] Add more specific types at documentation level when php engine can't 2020-01-08 10:13:26 +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
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