Commit Graph

30418 Commits

Author SHA1 Message Date
Romain Neutron
4acec8973f
[WebProfilerBundle] Fix content-security-policy compatibility
This fixes the compatibility of the bundle in case of a `style-src 'self'` policy.
2017-03-21 11:36:15 +01:00
Nicolas Grekas
48e90e3124 Merge branch '2.8' into 3.2
* 2.8:
  [WebProfilerBundle] Drop dead code
2017-03-21 11:32:01 +01:00
Nicolas Grekas
3d8959f4b4 minor #22089 [2.8][WebProfilerBundle] Drop dead code (romainneutron)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8][WebProfilerBundle] Drop dead code

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

As you can read in https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php#L40-L46 the `position` can only be `top` or `bottom`. I don't see any reference anywhere to a `normal` position.
The removed tests are always true.

Commits
-------

2de494f [WebProfilerBundle] Drop dead code
2017-03-21 11:29:56 +01:00
Romain Neutron
2de494f60b
[WebProfilerBundle] Drop dead code 2017-03-21 11:01:33 +01:00
Christophe Coevoet
f4a7418e3a Remove unused private method in Dotenv 2017-03-21 10:50:23 +01:00
Christophe Coevoet
14525b73b8 Fix some invalid phpdoc in the Dotenv class 2017-03-21 10:34:30 +01:00
Christophe Coevoet
518f618d33 Release memory for the parsed data after parsing 2017-03-21 10:32:25 +01:00
Nicolas Grekas
6643fe2fa8 bug #22084 [DI] Restore skipping logic when autowiring getters (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Restore skipping logic when autowiring getters

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

Partial revert for #22030: the skipping logic is part of the getter injection experience, which provides laziness, thus shouldn't bother you until you actually call the getter, if you do.

Commits
-------

b3f494f [DI] Restore skipping logic when autowiring getters
2017-03-21 09:19:37 +01:00
Nicolas Grekas
b3f494f5da [DI] Restore skipping logic when autowiring getters 2017-03-21 09:09:26 +01:00
Fabien Potencier
35e66ae0a9 bug #22079 [HttpKernel] Fixed bug with purging of HTTPS URLs (ausi)
This PR was squashed before being merged into the 2.7 branch (closes #22079).

Discussion
----------

[HttpKernel] Fixed bug with purging of HTTPS URLs

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

I found two bugs in `HttpCache\Store::purge()` with HTTPS URLs:

1. `->purge('https://example.com/')` only purges the `http` version not the `https` one.
2. If a cache entry exists for both `http` and `https`, only the `http` version gets purged, the `https` version stays in the cache.

I think this issues were introduced with #21582.

This pull request fixes both issues and adds tests for them.

Commits
-------

f50915066f [HttpKernel] Fixed bug with purging of HTTPS URLs
2017-03-20 17:24:39 -07:00
Martin Auswöger
f50915066f [HttpKernel] Fixed bug with purging of HTTPS URLs 2017-03-20 17:24:37 -07:00
Fabien Potencier
a001c2e7ef minor #22080 [FrameworkBundle] Exclude container.service_locator from UnusedTagsPass (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Exclude container.service_locator from UnusedTagsPass

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes

Commits
-------

ad501e5eeb Whitelist container.service_locator tag
2017-03-20 14:46:32 -07:00
Robin Chalas
ad501e5eeb Whitelist container.service_locator tag 2017-03-20 22:29:41 +01:00
Fabien Potencier
93ff304bce minor #22076 [SecurityBundle] Remove dead code in fixtures (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] Remove dead code in fixtures

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

Commits
-------

afa5ef603c [SecurityBundle] Remove dead code in fixtures
2017-03-20 13:33:03 -07:00
Nicolas Grekas
afa5ef603c [SecurityBundle] Remove dead code in fixtures 2017-03-20 19:08:03 +01:00
Christian Flothmann
abf1787dcc fix some risky tests 2017-03-20 16:03:41 +01:00
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