Commit Graph

35477 Commits

Author SHA1 Message Date
Roland Franssen 07dd09db59 [WebProfilerBundle] Imply forward request by a new X-Previous-Debug-Token header 2018-02-12 18:43:33 +01:00
Nicolas Grekas 65b2bcde1b Fix parse error 2018-02-12 08:29:20 +01:00
Fabien Potencier 5bc2753182 feature #26073 [DoctrineBridge] Add support for datetime immutable types in doctrine type guesser (jvasseur)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[DoctrineBridge] Add support for datetime immutable types in doctrine type guesser

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

Add support for datetime immutable types in doctrine type guesser now that we support `DateTimeImmutable` input in the form component.

Commits
-------

8c94fef7f2 Add support for immutable types in doctrine type guesser
2018-02-12 07:58:34 +01:00
Fabien Potencier d418395514 minor #26123 [Workflow] Drop nofooter option in PlantUmlDumper (dead code) (lyrixx)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Workflow] Drop nofooter option in PlantUmlDumper (dead code)

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

---

I also update the test suite: Dumping a worklow with a state machine
dumper does not make sense.

Commits
-------

9b946471e0 [Workflow] Drop nofooter option in PlantUmlDumper (dead code)
2018-02-12 07:57:05 +01:00
Nicolas Grekas 7822436b96 Merge branch '4.0'
* 4.0:
  [Bridge/PhpUnit] Fix tests by backporting #25997 to 3.4
2018-02-11 22:41:21 +01:00
Nicolas Grekas 8be6e19236 Merge branch '3.4' into 4.0
* 3.4:
  [Bridge/PhpUnit] Fix tests by backporting #25997 to 3.4
2018-02-11 22:40:43 +01:00
Nicolas Grekas 9a9c0f6142 [Bridge/PhpUnit] Fix tests by backporting #25997 to 3.4 2018-02-11 22:40:17 +01:00
Nicolas Grekas 998531d47f Merge branch '4.0'
* 4.0:
  [Bridge/PhpUnit] fix tests
2018-02-11 19:37:36 +01:00
Nicolas Grekas 6f596c7696 Merge branch '3.4' into 4.0
* 3.4:
  [Bridge/PhpUnit] fix tests
2018-02-11 19:37:31 +01:00
Nicolas Grekas edd507af78 [Bridge/PhpUnit] fix tests 2018-02-11 19:37:22 +01:00
Nicolas Grekas e4d683235b Merge branch '4.0'
* 4.0:
  [Bridge/PhpUnit] hotfix
2018-02-11 18:57:15 +01:00
Nicolas Grekas f75730df46 Merge branch '3.4' into 4.0
* 3.4:
  [Bridge/PhpUnit] hotfix
2018-02-11 18:57:08 +01:00
Nicolas Grekas 292fb56c70 [Bridge/PhpUnit] hotfix 2018-02-11 18:56:58 +01:00
Nicolas Grekas b292d59f03 Merge branch '4.0'
* 4.0:
  fix merge
2018-02-11 18:30:51 +01:00
Nicolas Grekas c422bac6b6 Merge branch '3.4' into 4.0
* 3.4:
  fix merge
2018-02-11 18:30:36 +01:00
Nicolas Grekas c8c27e5434 fix merge 2018-02-11 18:30:10 +01:00
Nicolas Grekas e81aa7694c Merge branch '4.0'
* 4.0:
  [YAML] Issue #26065: leading spaces in YAML multi-line string literals
  [Bridge\PhpUnit] Exit as late as possible
  [Bridge\PhpUnit] Cleanup BC layer
  [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener
  [Lock] Log already-locked errors as "notice" instead of "warning"
  add context to serialize and deserialize
  Update Repository Symlink Helper
  isCsrfTokenValid() replace string  by ?string
  Document explicitly that dotfiles and vcs files are ignored by default
  [HttpKernel] don't try to wire Request argument with controller.service_arguments
  Make kernel build time optionally deterministic
  Use 0 for unlimited expiry
  [Routing] fix typo
  Bump default PHPUnit version from 6.3 to 6.5
  do not mock the container builder in tests
  [Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls
2018-02-11 18:18:00 +01:00
Nicolas Grekas 6e34963b3d Merge branch '3.4' into 4.0
* 3.4:
  [YAML] Issue #26065: leading spaces in YAML multi-line string literals
  [Bridge\PhpUnit] Exit as late as possible
  [Bridge\PhpUnit] Cleanup BC layer
  [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener
  [Lock] Log already-locked errors as "notice" instead of "warning"
  add context to serialize and deserialize
  Update Repository Symlink Helper
  Document explicitly that dotfiles and vcs files are ignored by default
  [HttpKernel] don't try to wire Request argument with controller.service_arguments
  Make kernel build time optionally deterministic
  Use 0 for unlimited expiry
  [Routing] fix typo
  Bump default PHPUnit version from 6.3 to 6.5
  do not mock the container builder in tests
  [Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls
2018-02-11 18:17:44 +01:00
Nicolas Grekas 8ed107d09c Merge branch '2.8' into 3.4
* 2.8:
  [Bridge\PhpUnit] Exit as late as possible
  Update Repository Symlink Helper
  Document explicitly that dotfiles and vcs files are ignored by default
  do not mock the container builder in tests
2018-02-11 18:15:12 +01:00
Nicolas Grekas e490d663d6 Merge branch '2.7' into 2.8
* 2.7:
  [Bridge\PhpUnit] Exit as late as possible
  Update Repository Symlink Helper
  Document explicitly that dotfiles and vcs files are ignored by default
  do not mock the container builder in tests
2018-02-11 17:53:59 +01:00
Nicolas Grekas fd1d6d1191 minor #26139 [Bridge\PhpUnit] Cleanup BC layer (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Bridge\PhpUnit] Cleanup BC layer

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

Follow up of #26024

Commits
-------

c41681c [Bridge\PhpUnit] Cleanup BC layer
2018-02-11 16:32:58 +01:00
Nicolas Grekas a23ce690ec bug #26067 [YAML] Issue #26065: leading spaces in YAML multi-line string literals (tamc)
This PR was squashed before being merged into the 3.4 branch (closes #26067).

Discussion
----------

[YAML] Issue #26065: leading spaces in YAML multi-line string literals

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

Doing this:

    Yaml::dump(
        ["text" => "  leading space in first line\nno leading space in last line\n"],
        2,
        4,
        Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK
    );

Will produce this:

    text: |
           leading space in first line
         no leading space in last line

Which is invalid YAML because when the first line has leading spaces it needs a [block indentation indicator](http://www.yaml.org/spec/1.2/spec.html#id2793979) like this:

    text: |4
          leading space in first line
        no leading space in last line

This pull requests contains a test and a patch.

Commits
-------

aa95663 [YAML] Issue #26065: leading spaces in YAML multi-line string literals
2018-02-11 16:00:49 +01:00
Thomas Counsell aa956636ab [YAML] Issue #26065: leading spaces in YAML multi-line string literals 2018-02-11 16:00:48 +01:00
Nicolas Grekas ec9a109b5d bug #26012 Exit as late as possible (greg0ire)
This PR was merged into the 2.7 branch.

Discussion
----------

Exit as late as possible

People might want to register other shutdown functions that should be
able to control the exit code themselves, without the deprecation error
handler taking over. The php manual says:

> If you call exit() within one registered shutdown function, processing
> will stop completely and no other registered shutdown functions will be
> called.

See https://secure.php.net/manual/en/function.register-shutdown-function.php

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

<!--
- Bug fixes must be submitted against the lowest 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 the master branch.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

97370a3 [Bridge\PhpUnit] Exit as late as possible
2018-02-11 16:00:08 +01:00
Grégoire Paris 97370a3dd9 [Bridge\PhpUnit] Exit as late as possible
People might want to register other shutdown functions that should be
able to control the exit code themselves, without the deprecation error
handler taking over. The php manual says:

> If you call exit() within one registered shutdown function, processing
> will stop completely and no other registered shutdown functions will be
> called.

See https://secure.php.net/manual/en/function.register-shutdown-function.php
2018-02-11 15:57:09 +01:00
Nicolas Grekas 404a9ab615 bug #26082 [Cache][WebProfiler][3.4] fix collecting cache stats with sub-requests + allow clearing calls (dmaicher)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache][WebProfiler][3.4] fix collecting cache stats with sub-requests + allow clearing calls

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/23820
| License       | MIT
| Doc PR        | -

This is a follow-up PR for https://github.com/symfony/symfony/pull/26080. It additionally adds the reset behavior for the `TraceableAdapter` back.

Commits
-------

132bba6 [Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls
2018-02-11 15:42:07 +01:00
Nicolas Grekas c41681cb80 [Bridge\PhpUnit] Cleanup BC layer 2018-02-11 15:27:55 +01:00
Nicolas Grekas 40fb8434d3 bug #26024 [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener (shieldo)
This PR was squashed before being merged into the 3.4 branch (closes #26024).

Discussion
----------

[PhpBridge] add PHPUnit 7 support to SymfonyTestsListener

| Q             | A
| ------------- | ---
| Branch?       | 3.4 up to 4.0 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #26017 <!-- #-prefixed issue number(s), if any -->
| License       | MIT

Add support for the new PHPUnit 7 major release to the PHP Bridge for PHPUnit.

I wasn't sure about making a second legacy class here, or the naming of that class - but it seems like something like this would be required. Can re-name if there's a better suggested approach.

Commits
-------

a175a25 [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener
2018-02-11 12:38:33 +01:00
Douglas Greenshields a175a25d97 [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener 2018-02-11 12:38:30 +01:00
Nicolas Grekas 4c0befc1bb bug #26020 [Lock] Log already-locked errors as "notice" instead of "warning" (Simperfit)
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Log already-locked errors as "notice" instead of "warning"

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #25887 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo

We add the ability to specify the log level we want in the lock component. That could be useful when parsing the logs.

![img_3186 heic](https://user-images.githubusercontent.com/3451634/35733664-8ed991dc-081e-11e8-89dd-9efff253e492.jpeg)

Commits
-------

2a74edb [Lock] Log already-locked errors as "notice" instead of "warning"
2018-02-11 12:30:17 +01:00
Amrouche Hamza 2a74edb0f9 [Lock] Log already-locked errors as "notice" instead of "warning" 2018-02-11 12:27:51 +01:00
Nicolas Grekas 94675e17a2 bug #26043 [Serialized] add context to serialize and deserialize (andrey1s)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serialized] add context to serialize and deserialize

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| Tests pass?   | yes
| License       | MIT

added context to `supportsDecoding` `needsNormalization` and `supportsEncoding`

Commits
-------

6f8d5e2 add context to serialize and deserialize
2018-02-11 12:26:54 +01:00
andrey1s 6f8d5e263e add context to serialize and deserialize 2018-02-11 12:21:52 +01:00
Nicolas Grekas 573e462b55 minor #26091 Update Repository Symlink Helper (zanbaldwin)
This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes #26091).

Discussion
----------

Update Repository Symlink Helper

The `link` script is super-useful (thanks @dunglas!) for development - but for some it's unusable in its current form due to the use of `GLOB_BRACE` which is [unavailable on certain platforms](https://github.com/zendframework/zend-stdlib/issues/58#issue-147689568) (such as Alpine) and is a platform-specific problem that will not be fixed in future versions of PHP.

I know the code is a little condensed and not the easiest to read, but I thought that wasn't really an issue considering this is just a development helper script and not part of the 'official' Symfony code base.

| Q             | A
| ------------- | ---
| Branch?       | `3.3`
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | No tests for `/link`
| Fixed tickets |
| License       | MIT
| Doc PR        | can't find documentation for `/link`

<!--
- Bug fixes must be submitted against the lowest 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 the master branch.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

a9568d7 Update Repository Symlink Helper
2018-02-11 12:15:02 +01:00
Zan Baldwin a9568d7c60 Update Repository Symlink Helper
Add workaround for GLOB_BRACE, which is unavailable on certain platforms (such as Alpine).
2018-02-11 12:15:02 +01:00
Nicolas Grekas d7b98f9ef7 minor #26110 Bump default PHPUnit version from 6.3 to 6.5 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Bump default PHPUnit version from 6.3 to 6.5

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no, but unrelated
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This PR bumps the default PHPUnit version for php ≥ 7.2 from the outdated 6.3 to the currently maintained version 6.5.

Commits
-------

aeffc5f Bump default PHPUnit version from 6.3 to 6.5
2018-02-11 12:08:12 +01:00
Nicolas Grekas 57197dbbfd bug #26127 Deterministic time in cache items for reproducible builds (lstrojny)
This PR was merged into the 3.4 branch.

Discussion
----------

Deterministic time in cache items for reproducible builds

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

Allows setting a deterministic time for cache entries. This can be used to seed builds with a deterministic timestamp for reproducibility.

Parent issue is symfony/symfony#25958

Commits
-------

b4259a6 Use 0 for unlimited expiry
2018-02-11 12:04:19 +01:00
Nicolas Grekas eb53c7de53 bug #26128 Make kernel build time optionally deterministic (lstrojny)
This PR was merged into the 3.4 branch.

Discussion
----------

Make kernel build time optionally deterministic

| Q             | A
| ------------- | ---
| Branch?       | master for features / 2.7 up to 4.0 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

As part of the effort to enable reproducible builds, this PR allows setting a deterministic build time for the dumped kernel. Parent issue is symfony/symfony#25958.

Commits
-------

48e8249 Make kernel build time optionally deterministic
2018-02-11 11:59:17 +01:00
Nicolas Grekas cecda0b16b minor #26137 [HttpKernel] don't try to wire Request argument with controller.service_arguments (Tobion)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] don't try to wire Request argument with controller.service_arguments

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This does not make sense as Request is not a service and it's already handled by RequestValueResolver.
Also it produces alot of logging messages like the following whenever you only use the Request class in an action but no other service.

> Cannot autowire service "service_locator.IXu0y5S": it references class "Symfony\Component\HttpFoundation\Request" but no such service exists. It cannot be auto-registered because it is from a different root namespace.

> Removing service-argument resolver for controller "App\Controller\MyController:myAction": no corresponding services exist for the referenced types.

Commits
-------

09b9eb2 [HttpKernel] don't try to wire Request argument with controller.service_arguments
2018-02-11 11:56:59 +01:00
Nicolas Grekas 963b675564 bug #26117 isCsrfTokenValid() replace string by ?string (GaylordP)
This PR was submitted for the master branch but it was squashed and merged into the 4.0 branch instead (closes #26117).

Discussion
----------

isCsrfTokenValid() replace string  by ?string

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| License       | MIT
| PHP version | 7.1.13

Hello,

In my controller :

```php
    class PostController extends Controller
    {
        public function delete(Request $request, Post $post): Response
        {
            if (!$this->isCsrfTokenValid('delete', $request->request->get('token'))) {
                return $this->render('administration/post/delete.html.twig', [
                    'post' => $post,
                ]);
            }
            ... // flush is database
        }
````

Generate this error :

> Type error: Argument 2 passed to Symfony\Bundle\FrameworkBundle\Controller\Controller::isCsrfTokenValid() must be of the type string, null given, called in ...

In `CsrfToken` class, you have :
````php
    namespace Symfony\Component\Security\Csrf;

    class CsrfToken
    {
        public function __construct(string $id, ?string $value)
````
And in ControllerTrait :
````php
    trait ControllerTrait
   {
        protected function isCsrfTokenValid(string $id, string $token): bool
        {
````
Sorry for my bad english, I'm French and this is my first bug report :)

Commits
-------

37fbbca isCsrfTokenValid() replace string  by ?string
2018-02-11 11:55:53 +01:00
Gaylord Poillon 37fbbca086 isCsrfTokenValid() replace string by ?string 2018-02-11 11:55:53 +01:00
Nicolas Grekas 65bab998e5 minor #26087 do not mock the container builder in tests (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

do not mock the container builder in tests

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

Commits
-------

dab4222 do not mock the container builder in tests
2018-02-11 11:53:40 +01:00
Nicolas Grekas 6b0109ff25 minor #26134 Document explicitly that dotfiles and vcs files are ignored by default (mnapoli)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #26134).

Discussion
----------

Document explicitly that dotfiles and vcs files are ignored by default

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | ?
| Fixed tickets | None
| License       | MIT
| Doc PR        | N/A

This change makes it clear whether or not each of those two options are enabled by default.

Without this documentation one has to look into the code.

---

For documentation PRs should I target master or the same branch as bugs?

Commits
-------

e88e1ff Document explicitly that dotfiles and vcs files are ignored by default
2018-02-11 11:02:34 +01:00
Matthieu Napoli e88e1ff494 Document explicitly that dotfiles and vcs files are ignored by default
This change makes it clear whether or not each of those two options are enabled by default.

Without this documentation one has to look into the code.
2018-02-11 11:02:34 +01:00
Tobias Schultze 09b9eb2395 [HttpKernel] don't try to wire Request argument with controller.service_arguments
This does not make sense as Request is not a service and it's already handled by RequestValueResolver.
2018-02-11 01:53:06 +01:00
Lars Strojny 48e8249da9 Make kernel build time optionally deterministic 2018-02-11 00:59:14 +01:00
Lars Strojny b4259a6bf3 Use 0 for unlimited expiry 2018-02-10 17:05:54 +01:00
Nicolas Grekas ed42760b41 [Routing] fix typo 2018-02-10 11:55:44 +01:00
Nicolas Grekas 3ef76bfc0b minor #26125 [PropertyInfo] fix tests (xabbuh)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[PropertyInfo] fix tests

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

Commits
-------

00cdec9 [PropertyInfo] fix tests
2018-02-09 22:43:37 +01:00
Christian Flothmann 00cdec9ea2 [PropertyInfo] fix tests 2018-02-09 19:31:25 +01:00