Commit Graph

30229 Commits

Author SHA1 Message Date
Nicolas Grekas
d7e74b964f Merge branch '2.8' into 3.2
* 2.8:
  [DI] Fix PhpDumper generated doc block
  #20411 fix Yaml parsing for very long quoted strings
  [Doctrine Bridge] fix priority for doctrine event listeners
  Use PHP functions as array_map callbacks when possible
  [Validator] revert wrong Phpdoc change
  Use proper line endings
2017-03-20 10:32:19 +01:00
Christian Flothmann
731a74e79c [Yaml] deprecate "? " starting unquoted strings 2017-03-20 10:21:06 +01:00
Nicolas Grekas
5dd83adb1b minor #22065 [DI] Fix PhpDumper generated doc block (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DI] Fix PhpDumper generated doc block

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

Commits
-------

58b3ee7 [DI] Fix PhpDumper generated doc block
2017-03-20 09:47:13 +01:00
Nicolas Grekas
5d06acadd3 Merge branch '2.7' into 2.8
* 2.7:
  #20411 fix Yaml parsing for very long quoted strings
  [Doctrine Bridge] fix priority for doctrine event listeners
  Use PHP functions as array_map callbacks when possible
  [Validator] revert wrong Phpdoc change
  Use proper line endings
2017-03-20 09:46:40 +01:00
Nicolas Grekas
58b3ee7616 [DI] Fix PhpDumper generated doc block 2017-03-20 09:19:13 +01:00
Nicolas Grekas
e41064f65a feature #22030 [DI] Remove skipping magic for autowired methods (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Remove skipping magic for autowired methods

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

Wildcard based autowiring made it required to auto-skip methods that were not wireable.
Now that things need to be explicit (ie via the `@required` annotation, or via configuration), this "automagic" behavior is not required anymore.
Since it can lead to wtf moments ("*I* did *put that `@required` annotation, why is it ignored by autowiring?*"), I think we should remove it.
This also fixes another issue where configured method calls had their optional arguments wired, while we want only the constructor's to behave as such.

Commits
-------

a6bfe1c [DI] Remove skipping magic for autowired methods
2017-03-19 18:25:10 +01:00
Nicolas Grekas
a6bfe1c6c5 [DI] Remove skipping magic for autowired methods 2017-03-18 00:31:45 +01:00
Fabien Potencier
c12727deb8 minor #22038 [FrameworkBundle] harden the config when using workflow guards (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] harden the config when using workflow guards

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

This will forbid using the FrameworkBundle in 3.3 with previous releases
of the Workflow to avoid issues related to the GuardListener class not
being present. Additionally, it provides a useful exception in case the
guard option is used without the ExpressionLanguage component being
installed.

Commits
-------

418dcc39d4 harden the config when using workflow guards
2017-03-17 12:27:05 -07:00
Christian Flothmann
418dcc39d4 harden the config when using workflow guards
This will forbid using the FrameworkBundle in 3.3 with previous releases
of the Workflow to avoid issues related to the GuardListener class not
being present. Additionally, it provides a useful exception in case the
guard option is used without the ExpressionLanguage component being
installed.
2017-03-17 18:55:12 +01:00
Fabien Potencier
3ae36f4552 feature #22024 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument

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

I first started working on adding this new "container.service_locator" tag, so here it is.
It allows defining and dumping service-locator services properly, where it wasn't possible previously (you had to create a DI extension to do so.)

Then I realized that this allowed us to entirely drop `ServiceLocatorArgument` and replace it with the more flexible `ServiceClosureArgument`.

This makes things simpler overall, see diff stat.

Commits
-------

5d230b5871 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument
2017-03-17 10:07:04 -07:00
Romain Neutron
b0ba698111
[WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly 2017-03-17 17:52:43 +01:00
Nicolas Grekas
5d230b5871 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument 2017-03-17 17:49:32 +01:00
Fabien Potencier
207d068a40 minor #22039 Skip abstract definitions in compiler passes (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Skip abstract definitions in compiler passes

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

Commits
-------

fc1ba0d64a Skip abstract definitions in compiler passes
2017-03-17 09:47:45 -07:00
Fabien Potencier
4836007172 minor #22029 [DI] Remove useless state from ServiceLocator (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Remove useless state from ServiceLocator

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

One less state to manage for the engine, and allows to deal with non-shared services.

Commits
-------

e0a5eecf2a [DI] Remove useless state from ServiceLocator
2017-03-17 09:46:28 -07:00
Fabien Potencier
ab1d9383b9 bug #21523 #20411 fix Yaml parsing for very long quoted strings (RichardBradley)
This PR was squashed before being merged into the 2.7 branch (closes #21523).

Discussion
----------

#20411 fix Yaml parsing for very long quoted strings

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

This is a second fix for the issue discussed in #20411. My first PR (#21279) didn't fix the bug in all cases, sorry.

If a YAML string has too many spaces in the value, it can trigger a `PREG_BACKTRACK_LIMIT_ERROR` error in the Yaml parser.

There should be no behavioural change other than the bug fix

I have included a test which fails before this fix and passes after this fix.

I have also added checks that detect other PCRE internal errors and throw a more descriptive exception. Before this patch, the YAML engine would often give incorrect results, rather than throwing, on a PCRE `PREG_BACKTRACK_LIMIT_ERROR` error.

Commits
-------

c9a1c09182 #20411 fix Yaml parsing for very long quoted strings
2017-03-17 09:20:26 -07:00
Richard Bradley
c9a1c09182 #20411 fix Yaml parsing for very long quoted strings 2017-03-17 09:20:23 -07:00
Fabien Potencier
64466395ea bug #22006 [FrameworkBundle] remove translator helper if Translator is disabled (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] remove translator helper if Translator is disabled

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20928#issuecomment-274293396, #21374
| License       | MIT
| Doc PR        |

Commits
-------

25ea510ba4 remove translator helper if Translator is disabled
2017-03-17 09:19:12 -07:00
Fabien Potencier
ac109f154b bug #22001 [Doctrine Bridge] fix priority for doctrine event listeners (dmaicher)
This PR was merged into the 2.7 branch.

Discussion
----------

[Doctrine Bridge] fix priority for doctrine event listeners

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

This fixes handling the priorities for doctrine event listeners. As found out by @chapterjason in https://github.com/symfony/symfony/issues/21977 the priority was incorrectly handled as soon as a listener had more than one tag (so listening to multiple events).

With this changes all tagged listeners are globally sorted by priority (using the same stable sort approach as in the later available `PriorityTaggedServiceTrait`) and then added one by one to the event manager.

I also updated the tests a bit as it was not covering all cases.

We also have to extend the docs for it I think as it does not mention the `priority` and `lazy` option at all? http://symfony.com/doc/current/doctrine/event_listeners_subscribers.html

Commits
-------

9d9d4efb88 [Doctrine Bridge] fix priority for doctrine event listeners
2017-03-17 09:17:57 -07:00
Grégoire Pineau
d50885cc16 bug #22040 [FrameworkBundle] improve message when workflows are missing (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] improve message when workflows are missing

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

Commits
-------

46c12c9d1d improve message when workflows are missing
2017-03-17 16:59:28 +01:00
Grégoire Pineau
fb5e6cec57 minor #22042 [Workflow] add Phpdoc for better IDE support (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

[Workflow] add Phpdoc for better IDE support

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

Allow IDEs to provide more precise auto-completion support.

Commits
-------

916a97c834 [Workflow] add Phpdoc for better IDE support
2017-03-17 16:57:43 +01:00
Christian Flothmann
916a97c834 [Workflow] add Phpdoc for better IDE support
Allow IDEs to provide more precise auto-completion support.
2017-03-17 16:32:08 +01:00
Nicolas Grekas
398d78d758 Merge branch '3.2'
* 3.2:
  [Cache] cache/integration-tests is now compatible with phpunit namespaces
  [FrameworkBundle] Fix translation dep constraint
  [Workflow] Added more tests
  [Cache] Enhance error reporting for FilesystemAdapter
2017-03-17 15:59:00 +01:00
Fabien Potencier
813a7e9ef3 minor #22041 [FrameworkBundle] fix package name in conflict rule (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] fix package name in conflict rule

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

Commits
-------

71e93dddf2 fix package name in conflict rule
2017-03-17 07:56:05 -07:00
Nicolas Grekas
ce55ce7d97 minor #22037 [Cache] cache/integration-tests is now compatible with phpunit namespaces (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Cache] cache/integration-tests is now compatible with phpunit namespaces

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

Commits
-------

2e2d018 [Cache] cache/integration-tests is now compatible with phpunit namespaces
2017-03-17 15:49:01 +01:00
Christian Flothmann
71e93dddf2 fix package name in conflict rule 2017-03-17 15:28:59 +01:00
Christian Flothmann
46c12c9d1d improve message when workflows are missing 2017-03-17 15:26:20 +01:00
Nicolas Grekas
2e2d018dd8 [Cache] cache/integration-tests is now compatible with phpunit namespaces 2017-03-17 14:59:28 +01:00
Robin Chalas
fc1ba0d64a Skip abstract definitions in compiler passes 2017-03-17 14:55:48 +01:00
Nicolas Grekas
3fe34be1ed bug #22032 [FrameworkBundle] Fix translation dep constraint (chalasr)
This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] Fix translation dep constraint

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

The framework Translator makes use of the Translator component domain exceptions which exist since 3.2 only, leading to a fatal error when one of these exceptions is thrown in the framework using `symfony/translations:<3.2`. Bug introduced in https://github.com/symfony/symfony/pull/20012

Commits
-------

e1caf7d [FrameworkBundle] Fix translation dep constraint
2017-03-17 13:00:40 +01:00
Nicolas Grekas
6315c1d5aa bug #21996 [Cache] Enhance error reporting for FilesystemAdapter (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Cache] Enhance error reporting for FilesystemAdapter

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

So that we can provide feedback for cases like #21995

Commits
-------

ebb316d [Cache] Enhance error reporting for FilesystemAdapter
2017-03-17 12:53:30 +01:00
Robin Chalas
e1caf7da7f [FrameworkBundle] Fix translation dep constraint 2017-03-17 11:28:35 +01:00
Fabien Potencier
eb6f3f7515 minor #22026 Fix dotenv documentation link (bitdagger)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fix dotenv documentation link

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | <!--highly recommended for new features-->

Replaces the Documentation link for the DotEnv component with the correct link.

Context: https://github.com/symfony/symfony-docs/issues/7526#issuecomment-287095159

Commits
-------

8810d61ee3 Fix dotenv documentation link
2017-03-16 14:55:36 -07:00
Nicolas Grekas
e0a5eecf2a [DI] Remove useless state from ServiceLocator 2017-03-16 19:18:58 +01:00
Matt Fields
8810d61ee3 Fix dotenv documentation link
Context: https://github.com/symfony/symfony-docs/issues/7526#issuecomment-287095159
2017-03-16 11:46:40 -04:00
Grégoire Pineau
067ce70b34 minor #22020 [Workflow] Added more tests (lyrixx)
This PR was merged into the 3.2 branch.

Discussion
----------

[Workflow] Added more tests

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

---

It's not the first time that people try to fix the workflow because they don't understand how it works. Basically, it's because the default configuration is using the "workflow" and not the "state_machine" type. It was a mistake but it's too late because it will be BC break. May be we could solve that by triggering a deprecation if the type is not explicit. But nobody will see it because it will be triggered during the compilation. It could also be fixed with more documentation.

Anyway, I want to add more tests to cover that with a little comment in the test suite. Right now, only one tests failed. With this PR more tests are failing.

Commits
-------

e47cfe903e [Workflow] Added more tests
2017-03-16 11:26:54 +01:00
Grégoire Pineau
e47cfe903e [Workflow] Added more tests 2017-03-16 10:59:44 +01:00
Dmytro Boiko
522ec3ef0c [Security] Added option to return true in the method isRememberMeRequested 2017-03-16 00:06:02 +02:00
Fabien Potencier
18bbf3741a feature #21837 [FrameworkBundle] Lazy configuration of annotations' loader and @required (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Lazy configuration of annotations' loader and `@required`

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

This would remove the need for https://github.com/symfony/symfony-standard/pull/1052 and for the `autoload.php` file altogether.

Tested on symfony-demo with great success so far.

Commits
-------

d332b37b4b [FrameworkBundle] Lazy configuration of annotations' loader and `@required`
2017-03-15 09:56:25 -07:00
Christian Flothmann
25ea510ba4 remove translator helper if Translator is disabled 2017-03-15 12:04:33 +01:00
Fabien Potencier
2a99e161d1 bug #22002 [WebServerBundle] fix server:log when Monolog is not installed (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[WebServerBundle] fix server:log when Monolog is not installed

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

Commits
-------

9d56f0cf7d [WebServerBundle] fixed server:log when Monolog is not installed
2017-03-14 20:08:50 -07:00
Fabien Potencier
9d56f0cf7d [WebServerBundle] fixed server:log when Monolog is not installed 2017-03-14 20:05:57 -07:00
Fabien Potencier
133c37a9a3 minor #22000 [DependencyInjection] Remove the "id" attribute of "callable" (GuilhemN)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] Remove the "id" attribute of "callable"

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

It seems like this attribute was added by mistake as it's used nowhere.
It should be removed but I don't think it's worth adding a bc layer.

Commits
-------

19547a2639 [DependencyInjection] Remove the "id" attribute of "callable"
2017-03-14 14:50:16 -07:00
Nicolas Grekas
ebb316d616 [Cache] Enhance error reporting for FilesystemAdapter 2017-03-14 22:48:08 +01:00
Fabien Potencier
209b0bc629 feature #21970 [DependencyInjection] Support anonymous services in Yaml (GuilhemN)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] Support anonymous services in Yaml

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/16328
| License       | MIT
| Doc PR        |

This PR allows creating anonymous services in yaml using the `!service` tag as proposed by @nicolas-grekas:
```yml
services:
    _instanceof:
        FooInterface:
            arguments:
                - !service
                    class: Bar
                    autowire: true

    Foo:
        factory: [ !service { class: Quz }, 'constructFoo' ]
```

Anonymous services are forbidden in parameters as in xml.
Defaults and instanceof conditionals aren't applied on anonymous services, as in xml too.

Commits
-------

9b7138545e [DependencyInjection] Support anonymous services in Yaml
2017-03-14 14:36:40 -07:00
Fabien Potencier
cee0136acf feature #21979 [FrameworkBundle][TwigBundle] Require PSR-11 container instead of Symfony container (enumag)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][TwigBundle] Require PSR-11 container instead of Symfony container

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

As discussed in #21978 here is the second PR.

Commits
-------

857ce7c7be [FrameworkBundle][TwigBundle] Require PSR-11 container instead of Symfony container
2017-03-14 14:32:46 -07:00
Jáchym Toušek
857ce7c7be
[FrameworkBundle][TwigBundle] Require PSR-11 container instead of Symfony container 2017-03-14 22:27:21 +01:00
David Maicher
9d9d4efb88 [Doctrine Bridge] fix priority for doctrine event listeners 2017-03-14 21:52:39 +01:00
Guilhem Niot
9b7138545e
[DependencyInjection] Support anonymous services in Yaml 2017-03-14 21:40:20 +01:00
Fabien Potencier
c72a4f0a79 bug #21514 301 status code must drop request method to GET. (jlamur)
This PR was merged into the 3.3-dev branch.

Discussion
----------

301 status code must drop request method to GET.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| BC breaks?    | yes
| Tests pass?   | yes
| Fixed tickets | #20924
| License       | MIT

[RFC 7231 §6.4.2](https://tools.ietf.org/html/rfc7231#section-6.4.2) states that 301 HTTP Code should forward POST requests to the Location URI.

But, it also states that:

> For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request.

This is the behavior implemented in almost all user agents.
However the `BrowserKit` did forward the method to the subsequent request.

This PR make the `BrowserKit` change the request method from POST to GET when the response status code is 301.

Commits
-------

abda966d75 301 status code must drop request method to GET.
2017-03-14 13:25:39 -07:00
Guilhem Niot
19547a2639
[DependencyInjection] Remove the "id" attribute of "callable" 2017-03-14 21:21:43 +01:00