Commit Graph

45412 Commits

Author SHA1 Message Date
Fabien Potencier 871e8e9158 bug #32051 [Serializer] Add CsvEncoder tests for PHP 7.4 (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes #32051).

Discussion
----------

[Serializer] Add CsvEncoder tests for PHP 7.4

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

Some CSV encoder tests to show the broken behavior of a trailing slash. Spotted in #31867, not sure what to do with it :)

Commits
-------

760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4
2019-10-01 01:11:46 +02:00
Roland Franssen 760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4 2019-10-01 01:11:32 +02:00
Fabien Potencier befa5c69c2 feature #33776 Copy phpunit.xsd to a predictable path (julienfalque)
This PR was merged into the 3.4 branch.

Discussion
----------

Copy phpunit.xsd to a predictable path

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

In symfony/recipes#652 I would like to make Flex create the `phpunit.xml.dist` file with a local URI for the `phpunit.xsd`. This is doable when using `phpunit/phpunit` standalone because the path to the XSD file is known. This PR aims to allow doing this when using the PHPUnit Bridge, which installs PHPUnit in a path that might change.

Is is simple `@copy()` call ok? Should I add some error handling?

Commits
-------

233dcb4b75 Copy phpunit.xsd to a predictable path
2019-10-01 01:07:55 +02:00
Fabien Potencier f4af6d2273 minor #33762 [Console] remove duplicated test (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] remove duplicated test

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

Commits
-------

4c1b66c6de remove duplicated test
2019-10-01 01:04:49 +02:00
Fabien Potencier a824e08314 bug #33759 [Security/Http] fix parsing X509 emailAddress (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Http] fix parsing X509 emailAddress

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

Commits
-------

fceb86bde6 [Security/Http] fix parsing X509 emailAddress
2019-10-01 01:01:20 +02:00
Julien Falque 233dcb4b75
Copy phpunit.xsd to a predictable path 2019-09-30 22:33:19 +02:00
Jan Schädlich 77534aa45d [WebserverBundle] Remove duplicated deprecation message 2019-09-30 20:56:12 +02:00
Nicolas Grekas a2cd56c12f bug #33733 [Serializer] fix denormalization of string-arrays with only one element (mkrauser)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] fix denormalization of string-arrays with only one element

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

This PR does almost the same as ac70edf8cd, just not only for arrays of objects.

Commits
-------

8814751b96 [Serializer] fix denormalization of string-arrays with only one element #33731
2019-09-30 16:55:04 +02:00
Christian Flothmann 5e48c39f79 minor #33760 [HttpKernel] drop support for retrieving container from non-booted kernels (xabbuh)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[HttpKernel] drop support for retrieving container from non-booted kernels

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

Commits
-------

81ae635100 drop support for retrieving container from non-booted kernels
2019-09-30 16:37:48 +02:00
Christian Flothmann 4c1b66c6de remove duplicated test 2019-09-30 16:33:22 +02:00
Christian Flothmann 6623ec2131 remove abbreviation support for hidden commands 2019-09-30 16:19:32 +02:00
Christian Flothmann 81ae635100 drop support for retrieving container from non-booted kernels 2019-09-30 15:58:09 +02:00
Christian Flothmann 001777ac07 minor #33757 [FrameworkBundle] conflict with VarDumper < 4.4 (dmaicher)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] conflict with VarDumper < 4.4

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

While trying FrameworkBundle 4.4.x-dev I noticed that I was still using VarDumper 4.3 which leads to this error:

```
> app/console cache:clear

Fatal error: Uncaught Symfony\Component\ErrorHandler\Exception\ClassNotFoundException: Attempted to load class "ContextualizedDumper" from namespace "Symfony\Component\VarDumper\Dumper".
Did you forget a "use" statement for another namespace? in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php:13
Stack trace:
#0 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(1357): require()
#1 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(2282): ContainerB7mbdCh\appAppKernelDevDebugContainer->load('getDebug_DumpLi...')
#2 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(275): ContainerB7mbdCh\appAppKernelDevDebugContainer->ContainerB7mbdCh\{closure}()
#3 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(90): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.command')
#4 /var/www/x in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php on line 13
PHP Fatal error:  Uncaught Symfony\Component\ErrorHandler\Exception\ClassNotFoundException: Attempted to load class "ContextualizedDumper" from namespace "Symfony\Component\VarDumper\Dumper".
Did you forget a "use" statement for another namespace? in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php:13
Stack trace:
#0 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(1357): require()
#1 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(2282): ContainerB7mbdCh\appAppKernelDevDebugContainer->load('getDebug_DumpLi...')
#2 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(275): ContainerB7mbdCh\appAppKernelDevDebugContainer->ContainerB7mbdCh\{closure}()
#3 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(90): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.command')
#4 /var/www/x in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php on line 13
Script app/console cache:clear handling the post-update-cmd event returned with error code 255
```
So we need to use `symfony/var-dumper >= 4.4`

Commits
-------

9b512c6d5d [FrameworkBundle] conflict with VarDumper < 4.4
2019-09-30 15:16:52 +02:00
Nicolas Grekas fceb86bde6 [Security/Http] fix parsing X509 emailAddress 2019-09-30 14:24:32 +02:00
David Maicher 9b512c6d5d [FrameworkBundle] conflict with VarDumper < 4.4 2019-09-30 13:00:46 +02:00
Nicolas Grekas b15ae9c5e0 Merge branch '4.4'
* 4.4:
  [4.4] Fix some leftovers
  [VarDumper] Output the location of calls to dump()
2019-09-30 12:48:47 +02:00
Matthias Krauser 8814751b96 [Serializer] fix denormalization of string-arrays with only one element #33731 2019-09-30 12:45:58 +02:00
Nicolas Grekas 2b71c6f221 bug #33752 [4.4] Fix some leftovers (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] Fix some leftovers

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

Found while running console commands with the Symfony Demo.

Commits
-------

b416c12d29 [4.4] Fix some leftovers
2019-09-30 12:04:15 +02:00
Nicolas Grekas 03f2adcb4e bug #33754 [Cache] fix known tag versions ttl check (SwenVanZanten)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix known tag versions ttl check

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

The introduced changes from PR #27007 came with a knownTagVersionTtl property defaulted to 0.15 microseconds. The if statement defined on line 353 checks if the ttl is higher then the already known tag versions. This results in the opposite of the wanted behavior. Instead of waiting for the ttl to expire the if statement is only true if the known versions are lower than the version ttl.

So if this Adapter stays in memory the tag versions are never checked again if the ttl is already lower then the passed time.

The unit test I've added tests once if the version is changed and another time it doesn't get checked cause the ttl hasn't been expired yet.

Commits
-------

205abf3435 [Cache] fix known tag versions ttl check
2019-09-30 12:02:01 +02:00
Nicolas Grekas b416c12d29 [4.4] Fix some leftovers 2019-09-30 11:07:05 +02:00
Swen van Zanten 205abf3435
[Cache] fix known tag versions ttl check 2019-09-29 23:19:44 +02:00
Nicolas Grekas 8649f43009 minor #33746 [String] improve AbstractUnicodeString::ascii() fallback logic (nicolas-grekas)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] improve AbstractUnicodeString::ascii() fallback logic

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

`any-latin/bgn` is a better default when available, and accepting `\Transliterator` instances allows the consumer code to decide how they are instantiated.

Commits
-------

59069626fd [String] improve AbstractUnicodeString::ascii() fallback logic
2019-09-29 21:33:53 +02:00
Nicolas Grekas 5440d671ca feature #31446 [VarDumper] Output the location of calls to dump() (ktherage)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Output the location of calls to dump()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not tested yet
| Fixed tickets | #30830
| License       | MIT
| Doc PR        |

see #30830

Commits
-------

f0a59d3eab [VarDumper] Output the location of calls to dump()
2019-09-28 18:21:11 +02:00
THERAGE Kévin f0a59d3eab [VarDumper] Output the location of calls to dump() 2019-09-28 18:20:13 +02:00
Nicolas Grekas 10be999069 Merge branch '4.4'
* 4.4:
  sync phpunit script with master
  [HttpFoundation] allow additinal characters in not raw cookies
  [Console] Deprecate abbreviating hidden command names using  Application->find()
  Do not include hidden commands in suggested alternatives
  [Messenger] Improve error message when routing to an invalid transport (closes #31613)
  [DependencyInjection] Fix wrong exception when service is synthetic
  [Security] add "anonymous: lazy" mode to firewalls
2019-09-28 18:14:00 +02:00
Nicolas Grekas 55843f2de6 Merge branch '4.3' into 4.4
* 4.3:
  sync phpunit script with master
  [HttpFoundation] allow additinal characters in not raw cookies
2019-09-28 18:13:05 +02:00
Nicolas Grekas d8a026bcad Merge branch '3.4' into 4.3
* 3.4:
  sync phpunit script with master
2019-09-28 18:12:55 +02:00
Nicolas Grekas fda5b20c39 sync phpunit script with master 2019-09-28 18:12:11 +02:00
Nicolas Grekas 241e2f7fb7 Merge branch '3.4' into 4.3
* 3.4:
  [HttpFoundation] allow additinal characters in not raw cookies
2019-09-28 17:12:15 +02:00
Nicolas Grekas ca253960d8 bug #33646 [HttpFoundation] allow additinal characters in not raw cookies (marie)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] allow additinal characters in not raw cookies

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| Tickets       | Fix #33619
| License     | MIT

> **Description**
> When creating a non-raw Cookie, it is impossible to provide a name that contains characters matching the regex class [=,; \t\r\n\013\014]

**Solution**: Check with this regex only raw cookie

Commits
-------

4db1402770 [HttpFoundation] allow additinal characters in not raw cookies
2019-09-28 17:10:09 +02:00
marie 4db1402770 [HttpFoundation] allow additinal characters in not raw cookies 2019-09-28 17:09:56 +02:00
Robin Chalas e627989089 feature #33412 [Console] Do not leak hidden console commands (m-vo)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Do not leak hidden console commands

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (updated)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33398
| License       | MIT

This PR attempts to fix hidden console commands to be leaked when interacting with the console.

These are the changes:
* Hidden commands won't be shown anymore in the list of commands in a namespace as well as the list of  suggestions ("Did you mean...") for invalid or ambiguous commands.
* Hidden commands therefore now need to be always entered with their full name.
* If an abbreviated command is entered that was previously ambiguous with (only) hidden commands, it's now executed directly (not ambiguous anymore).

Side note: When implementing the tests & changes I realized that `Application->get()` isn't side effect free (when redirecting to the help command) and behaves differently when called multiple times. It therefore must not be used from inside `find()`. Maybe we should change this? Here are the relevant bits:
f71f74b36a/src/Symfony/Component/Console/Application.php (L495-L502)

Commits
-------

f3406338e6 [Console] Deprecate abbreviating hidden command names using  Application->find()
2019-09-28 17:03:31 +02:00
M. Vondano f3406338e6 [Console] Deprecate abbreviating hidden command names using Application->find() 2019-09-28 17:00:54 +02:00
Nicolas Grekas 399e0fb06f Merge branch '4.3' into 4.4
* 4.3:
  Do not include hidden commands in suggested alternatives
  [DependencyInjection] Fix wrong exception when service is synthetic
2019-09-28 16:56:00 +02:00
Nicolas Grekas 8033fc5a1d Merge branch '3.4' into 4.3
* 3.4:
  Do not include hidden commands in suggested alternatives
  [DependencyInjection] Fix wrong exception when service is synthetic
2019-09-28 16:55:46 +02:00
Nicolas Grekas 944cda7969 bug #33748 [Console] Do not include hidden commands in suggested alternatives (m-vo)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Do not include hidden commands in suggested alternatives

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

Partially backports #33412 on 3.4, avoids leaking the names of hidden commands in suggested alternatives on command not found.

Commits
-------

8a9d173c36 Do not include hidden commands in suggested alternatives
2019-09-28 16:54:55 +02:00
M. Vondano 8a9d173c36 Do not include hidden commands in suggested alternatives 2019-09-28 16:39:43 +02:00
Nicolas Grekas 59069626fd [String] improve AbstractUnicodeString::ascii() fallback logic 2019-09-28 15:42:02 +02:00
Roland Franssen 82f341864c [DI] Add CSV env var processor tests 2019-09-28 11:59:10 +02:00
Fabien Potencier ae61ae5104 minor #31710 [DX][Messenger] Improve error message when routing to an invalid transport (Koc)
This PR was merged into the 4.4 branch.

Discussion
----------

[DX][Messenger] Improve error message when routing to an invalid transport

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31613
| License       | MIT
| Doc PR        | -

Commits
-------

7909092891 [Messenger] Improve error message when routing to an invalid transport (closes #31613)
2019-09-28 09:18:11 +02:00
Robin Chalas 6fef3fb83c feature #33676 [Security] add "anonymous: lazy" mode to firewalls (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] add "anonymous: lazy" mode to firewalls

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

Contains #33663 until it is merged.

This PR allows defining a firewall as such:
```yaml
security:
    firewalls:
        main:
            anonymous: lazy
```

This means that the corresponding area should not start the session / load the user unless the application actively gets access to it. On pages that don't fetch the user at all, this means the session is not started, which means the corresponding token neither is. Lazily, when the user is accessed, e.g. via a call to `is_granted()`, the user is loaded, starting the session if needed.

See #27817 for previous explanations on the topic also.

Note that thanks to the logic in #33633, this PR doesn't have the drawback spotted in #27817: here, the profiler works as expected.

Recipe update pending at https://github.com/symfony/recipes/pull/649

Commits
-------

5cd1d7b4cc [Security] add "anonymous: lazy" mode to firewalls
2019-09-28 01:05:16 +02:00
Konstantin Myakshin 7909092891 [Messenger] Improve error message when routing to an invalid transport (closes #31613) 2019-09-28 01:24:27 +03:00
Nicolas Grekas 335632152e Merge branch '4.4'
* 4.4:
  cs fix bis
  cs fix
  [DomCrawler] add a value() method, normalize whitespaces
2019-09-27 19:13:30 +02:00
Nicolas Grekas f5d3d5fe17 cs fix bis 2019-09-27 19:11:11 +02:00
Nicolas Grekas 7a3a664ea0 cs fix 2019-09-27 19:09:14 +02:00
Nicolas Grekas 7d6b6571aa feature #32440 [DomCrawler] add a normalizeWhitespace argument to text() method (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[DomCrawler] add a normalizeWhitespace argument to text() method

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| 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 | #21302, #23626  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo <!-- 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):
 - 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.
-->

I've taken #24412, rebased with 4.4, fixed the comments in the PR.

cc @xabbuh @stof @nicolas-grekas

Commits
-------

1746718553 [DomCrawler] add a value() method, normalize whitespaces
2019-09-27 19:07:24 +02:00
Amrouche Hamza 1746718553 [DomCrawler] add a value() method, normalize whitespaces 2019-09-27 19:06:53 +02:00
Nicolas Grekas 293a22a433 bug #33625 [DependencyInjection] Fix wrong exception when service is synthetic (k0d3r1s)
This PR was squashed before being merged into the 3.4 branch (closes #33625).

Discussion
----------

[DependencyInjection] Fix wrong exception when service is synthetic

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

This fixes wrongfully thrown exception when service is defined as synthetic and some arguments are binded in _defaults

Commits
-------

152dec95bc [DependencyInjection] Fix wrong exception when service is synthetic
2019-09-27 17:48:09 +02:00
k0d3r1s 152dec95bc [DependencyInjection] Fix wrong exception when service is synthetic 2019-09-27 17:47:48 +02:00
Nicolas Grekas 7daf7df2ff Merge branch '4.4'
* 4.4:
  fix merge (bis)
  fix merge
2019-09-27 16:40:47 +02:00