Commit Graph

30402 Commits

Author SHA1 Message Date
Fabien Potencier
2ba564d984 minor #22012 [DI] [YamlFileLoader] change error message of a non existing file (jordscream)
This PR was squashed before being merged into the 2.7 branch (closes #22012).

Discussion
----------

[DI] [YamlFileLoader] change error message of a non existing file

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

This PR replaces the error message when non existing Yaml file is loaded. It gives more sense for the user.

Commits
-------

1c2ea97585 [DI] [YamlFileLoader] change error message of a non existing file
2017-03-20 07:02:55 -07:00
Jordan Samouh
1c2ea97585 [DI] [YamlFileLoader] change error message of a non existing file 2017-03-20 07:02:54 -07:00
Fabien Potencier
88914a9b1b feature #22059 [Yaml] deprecate "? " starting unquoted strings (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] deprecate "? " starting unquoted strings

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

Commits
-------

731a74e79c [Yaml] deprecate "? " starting unquoted strings
2017-03-20 06:59:57 -07:00
Fabien Potencier
ece42c50f8 bug #22045 [WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly (romainneutron)
This PR was merged into the 3.2 branch.

Discussion
----------

[WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly

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

This header should have been handled from the beginning.
Content-Security-Policy recommendation specify this header, it needs to be correctly handled

Commits
-------

b0ba698111 [WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly
2017-03-20 06:59:21 -07:00
Christian Flothmann
167742e521 add errors as late as possible
PHPUnit may change the test's state after the listener's startTest()
method has been executed thus leading to broken test result output.
2017-03-20 14:28:31 +01:00
Nicolas Grekas
4d48b58d19 Merge branch '3.2'
* 3.2:
  [Yaml] CS
  [DI] Fix PhpDumper generated doc block
  #20411 fix Yaml parsing for very long quoted strings
  [Workflow] add Phpdoc for better IDE support
  fix package name in conflict rule
  improve message when workflows are missing
  [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 11:06:58 +01:00
Nicolas Grekas
ab08fd69b4 Merge branch '2.8' into 3.2
* 2.8:
  [Yaml] CS
2017-03-20 10:45:15 +01:00
Nicolas Grekas
c80a0ae90f Merge branch '2.7' into 2.8
* 2.7:
  [Yaml] CS
2017-03-20 10:41:44 +01:00
Nicolas Grekas
3185dc9c8f [Yaml] CS 2017-03-20 10:41:03 +01:00
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
Christian Flothmann
923bbdbf9f [Security] simplify the SwitchUserListenerTest 2017-03-17 23:55:35 +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
Maxime Steinhausser
cb175a41c3 [Security] json auth listener should not produce a 500 response on bad request format 2017-03-17 11:48:56 +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
Robin Chalas
5af47c40dc Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
This reverts commit b8b6774634, reversing
changes made to 82790559de.
2017-03-16 17:10:10 +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