Commit Graph

25042 Commits

Author SHA1 Message Date
apetitpa
1825d0f2ae cast substr result to string and remove empty function use 2017-04-05 11:10:47 -07:00
apetitpa
894127bf09 rename dataset provider 2017-04-05 11:10:47 -07:00
apetitpa
d973eb1f7d Add a test to prevent future regressions 2017-04-05 11:10:47 -07:00
apetitpa
6f24b05467 Switch to empty native function to check emptiness
Switch to `empty` because depending on the PHP version, substr returns '' or false
2017-04-05 11:10:47 -07:00
apetitpa
f390f29173 remove non relevant test case 2017-04-05 11:10:47 -07:00
apetitpa
91b665c12a Switch to is_string native method 2017-04-05 11:10:46 -07:00
apetitpa
6071ff6c8f Remove unnecessary parentheses 2017-04-05 11:10:32 -07:00
apetitpa
9753a2773e Add a test case to prevent future regressions 2017-04-05 11:10:32 -07:00
apetitpa
4fcb24bacb Move empty condition in return statement 2017-04-05 11:10:32 -07:00
apetitpa
a090ef855a Use LF line separator 2017-04-05 11:10:32 -07:00
apetitpa
60392fdd43 fix coding standard to comply with fabbot 2017-04-05 11:10:32 -07:00
apetitpa
197d19f34c Remove malformed EmailValidatorTest + Update UrlValidator test
Remove malformed EmailValidatorTest + Update UrlValidator test
2017-04-05 11:10:32 -07:00
apetitpa
6b0702e52a Add empty check on host in other methods + add unit tests
Add empty on host in other methods where checkdnsrr is called and add unit tests to prevent future regressions
2017-04-05 11:10:31 -07:00
apetitpa
6dd023f255 [Validator] Allow checkMX() to return false when $host is empty
| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #22106 |
| License | MIT |
| Doc PR | n/a |
2017-04-05 11:10:12 -07:00
Fabien Potencier
933835c13b bug #22280 [DI] Fix the xml schema (GuilhemN)
This PR was merged into the 2.7 branch.

Discussion
----------

[DI] Fix the xml schema

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| 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 |
| License       | MIT
| Doc PR        |

Commits
-------

f2ef1eecef [DI] Fix the xml schema
2017-04-05 08:21:50 -07:00
Fabien Potencier
937045c839 feature #22274 [Yaml] report deprecations when linting YAML files (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] report deprecations when linting YAML files

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

In a project I frequently discovered usages of deprecated YAML formats. I first wanted to set up a build step that would lint all YAML files found in that project to be able to report it inside the CI. While doing so I noticed that the lint command was ignoring all deprecations after all. I suggest that catch all deprecations triggered by the YAML components and turn them into reported errors here. If we think that this could be seen as misbehaviour as the Symfony YAML parser is still able to handle these files properly, we could think about adding an additional option to the command that would turn on the deprecation handling.

Commits
-------

9b4206ff73 report deprecations when linting YAML files
2017-04-05 08:20:10 -07:00
Fabien Potencier
d45d40d732 feature #22286 [DI/Yaml] Remove @experimental flag from "instanceof" and "prototype" (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI/Yaml] Remove `@experimental` flag from "instanceof" and "prototype"

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

We don't need this flag on these features: the implementation is stable, and regular deprecations should be the way to go in the event where we decide to remove this later on.

That would leave only one single `@experimental` feature in 3.3: `CacheItem::getPreviousTags()`, which looks legitimate to me (since this method is aiming at interop).

Commits
-------

e8723df28a [DI/Yaml] Remove `@experimental` flag from "instanceof" and "prototype"
2017-04-05 08:10:17 -07:00
Fabien Potencier
2a40b6fbfd bug #22300 [WebProfiler] Fix race condition in fast Ajax requests (curry684)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[WebProfiler] Fix race condition in fast Ajax requests

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

Patch `startAjaxRequest` and `finishAjaxRequest` functions to absolute noop in case the debug toolbar itself is not loaded yet, and spool historic requests after the toolbar is loaded.

Commits
-------

538a59254f [WebProfiler] Fix race condition in fast Ajax requests
2017-04-05 08:08:32 -07:00
Fabien Potencier
54495b2bd6 feature #22181 [Console] Allow to catch CommandNotFoundException (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Allow to catch CommandNotFoundException

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

Basically reverts #22144, making the command argument optional in console.error event instead, so that `CommandNotFoundException` can be handled as any other console error.

Commits
-------

b21ce850e7 [Console] Allow to catch CommandNotFoundException
2017-04-05 08:05:16 -07:00
Fabien Potencier
91b025affc bug #22282 [DI] Prevent AutowirePass from triggering irrelevant deprecations (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

[DI] Prevent AutowirePass from triggering irrelevant deprecations

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no (just a failing test case atm)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

For populating available types the AutowirePass iterates over `$container->getDefinitions()` trying to instantiate a reflection class for each definition.
Problem is that if one of these classes is deprecated, a notice is triggered due to the reflection, even if the service is actually never used.

~~Right now this only reproduces the issue with a failing test case~~, this bug (if we agree it's a bug) breaks the test suite of a bundle I maintain (see https://travis-ci.org/lexik/LexikJWTAuthenticationBundle/jobs/218275650#L262)

Solutions I can think about for now:
- ~~Skip deprecated definitions from type registering, meaning that if a service is deprecated a day, all autowired services that rely on it will suddenly be broken, also the bug would remain if the definition is not deprecated but relies on a deprecated class, not good I think~~
- Register an error handler ignoring deprecations during the type registering process (`AutowirePass#populateAvailableType()`), ~~works but makes my test suite say `THE ERROR HANDLER HAS CHANGED`. I'll push my try as a 2nd commit.~~

Thoughts?

Commits
-------

77927f4b33 [DI] Prevent AutowirePass from triggering irrelevant deprecations
2017-04-05 08:02:21 -07:00
Fabien Potencier
a2003579e9 bug #22255 [Translation] avoid creating cache files for fallback locales. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[Translation] avoid creating cache files for fallback locales.

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

Commits
-------

22425b2692 [Translation] avoid creating cache files for fallback locales.
2017-04-05 07:56:27 -07:00
Robin Chalas
77927f4b33 [DI] Prevent AutowirePass from triggering irrelevant deprecations 2017-04-05 16:41:09 +02:00
Christian Flothmann
9b4206ff73 report deprecations when linting YAML files 2017-04-05 16:34:46 +02:00
Fabien Potencier
b65ebc7424 feature #22296 Bump monolog to 1.19 and use the agent regex const from parent (redthor)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Bump monolog to 1.19 and use the agent regex const from parent

See #22264

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

Bump monolog and use const from parent. See https://github.com/symfony/symfony/issues/22264#issuecomment-291524038

I went for `static` instead of `self` in case anyone wanted to easily override just the agent string.

Commits
-------

69f9586fd5 Bump monolog to 1.19 and use the agent regex const from parent, see #22264
2017-04-05 06:53:23 -07:00
Fabien Potencier
3aeac5aa3f Merge branch '3.2'
* 3.2:
  bumped Symfony version to 3.2.8
  updated VERSION for 3.2.7
  updated CHANGELOG for 3.2.7
  Fixes #22264 - add support for Chrome headless, see also Seldaek/monolog#966
  [Workflow] update documentation URL in readme
  bumped Symfony version to 2.8.20
  updated VERSION for 2.8.19
  updated CHANGELOG for 2.8.19
  Dont call sprintf() when no placeholders are used
2017-04-05 06:44:55 -07:00
Fabien Potencier
f53e81dd6a Merge branch '2.8' into 3.2
* 2.8:
  Fixes #22264 - add support for Chrome headless, see also Seldaek/monolog#966
  bumped Symfony version to 2.8.20
  updated VERSION for 2.8.19
  updated CHANGELOG for 2.8.19
  Dont call sprintf() when no placeholders are used
2017-04-05 06:44:24 -07:00
Fabien Potencier
f92ada80f4 Merge branch '2.7' into 2.8
* 2.7:
  Fixes #22264 - add support for Chrome headless, see also Seldaek/monolog#966
  Dont call sprintf() when no placeholders are used
2017-04-05 06:42:13 -07:00
Niels Keurentjes
538a59254f [WebProfiler] Fix race condition in fast Ajax requests
Patch startAjaxRequest and finishAjaxRequest functions to absolute noop
in case the debug toolbar itself is not loaded yet, and spool historic
requests after the toolbar is loaded.

Fixes #22297
2017-04-05 15:42:05 +02:00
Fabien Potencier
958b0aeffc bug #22279 [DI] Fix anonymous factories/configurators support (GuilhemN)
This PR was squashed before being merged into the 3.3-dev branch (closes #22279).

Discussion
----------

[DI] Fix anonymous factories/configurators support

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| 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 | https://github.com/symfony/symfony/pull/21999#discussion_r106019873
| License       | MIT
| Doc PR        |

Using prototypes / instanceof conditionals, anonymous factories are inlined using `Definition`, so a new instance will be created for every service created from the prototype / conditional which is inconsistent with the way other anonymous services are managed.

Commits
-------

dda43ed8ce [DI] Fix anonymous factories/configurators support
2017-04-05 06:16:31 -07:00
Guilhem Niot
dda43ed8ce [DI] Fix anonymous factories/configurators support 2017-04-05 06:16:28 -07:00
Fabien Potencier
757e5f7f7c bumped Symfony version to 3.2.8 2017-04-05 06:13:01 -07:00
Douglas Reith
69f9586fd5 Bump monolog to 1.19 and use the agent regex const from parent, see #22264 2017-04-05 13:03:25 +00:00
Fabien Potencier
98313d4c7b updated VERSION for 3.2.7 2017-04-05 05:52:03 -07:00
Douglas Reith
a03dbd2cca Fixes #22264 - add support for Chrome headless, see also Seldaek/monolog#966 2017-04-05 12:36:22 +00:00
Nicolas Grekas
e8723df28a [DI/Yaml] Remove @experimental flag from "instanceof" and "prototype" 2017-04-05 12:13:51 +02:00
Christian Flothmann
98a18ee162 [Workflow] sync the changelog 2017-04-05 11:30:54 +02:00
Christian Flothmann
b878f7e62e [Workflow] update documentation URL in readme 2017-04-05 10:00:23 +02:00
Nicolas Grekas
6ecec3557e [HttpKernel] Fix forward compat with Request::setTrustedProxies() 2017-04-05 08:52:45 +02:00
Fabien Potencier
d5ea53325a bumped Symfony version to 2.8.20 2017-04-04 21:19:23 -07:00
Fabien Potencier
19ccd43812 updated VERSION for 2.8.19 2017-04-04 21:04:34 -07:00
Roland Franssen
a7bd9443a8 [FrameworkBundle] Fix console fixtures 2017-04-04 23:42:02 +02:00
Fabien Potencier
24b1b0d908 fixed wording 2017-04-04 12:45:53 -07:00
Fabien Potencier
ab624f1c38 feature #21437 [Security] Use IteratorArgument for voters (jvasseur)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security] Use IteratorArgument for voters

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

Use an IteratorArgument for injecting voters into the AccessDecisionManager.

Commits
-------

4ec80b1ae8 Use IteratorArgument for voters
2017-04-04 12:44:44 -07:00
Nicolas Grekas
7aee0aeaf5 Merge branch '3.2'
* 3.2:
  fix merge
2017-04-04 21:00:44 +02:00
Nicolas Grekas
761d452162 fix merge 2017-04-04 21:00:33 +02:00
Nicolas Grekas
080cb5b5c2 Merge branch '3.2'
* 3.2:
  [FrameworkBundle] Update console fixtures after #22217
  Allow Upper Case property names
  fix some risky tests
  bumped Symfony version to 2.7.27
  updated VERSION for 2.7.26
  update CONTRIBUTORS for 2.7.26
  updated CHANGELOG for 2.7.26
2017-04-04 20:59:08 +02:00
Nicolas Grekas
aa46df1997 Merge branch '2.8' into 3.2
* 2.8:
  [FrameworkBundle] Update console fixtures after #22217
2017-04-04 20:55:04 +02:00
Nicolas Grekas
200b45eb43 minor #22278 [FrameworkBundle] Update console fixtures after #22217 (ro0NL)
This PR was squashed before being merged into the 2.8 branch (closes #22278).

Discussion
----------

[FrameworkBundle] Update console fixtures after #22217

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes (regression from #22217)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22217#issuecomment-291497513
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

cc @fabpot

Sorry for the inconvenience :)

Commits
-------

6e1cee6 [FrameworkBundle] Update console fixtures after #22217
2017-04-04 20:51:44 +02:00
Roland Franssen
6e1cee62b9 [FrameworkBundle] Update console fixtures after #22217 2017-04-04 20:50:26 +02:00
Nicolas Grekas
4951d3c962 Dont call sprintf() when no placeholders are used 2017-04-04 20:32:29 +02:00
Guilhem Niot
f2ef1eecef
[DI] Fix the xml schema 2017-04-04 20:13:57 +02:00
Jérôme Vasseur
4ec80b1ae8 Use IteratorArgument for voters 2017-04-04 19:58:27 +02:00
Fabien Potencier
08ef799f60 feature #22277 [DI] Add "factory" support to named args and autowiring (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Add "factory" support to named args and autowiring

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

To me, factories are expected to work named arguments.
Doing so also unlocks supporting them when autowiring, and will benefit #22187 soon.

Commits
-------

27470de62a [DI] Add "factory" support to named args and autowiring
2017-04-04 10:30:46 -07:00
Fabien Potencier
ff286d6da9 Merge branch '2.8' into 3.2
* 2.8:
  Allow Upper Case property names
  fix some risky tests
  bumped Symfony version to 2.7.27
  updated VERSION for 2.7.26
  update CONTRIBUTORS for 2.7.26
  updated CHANGELOG for 2.7.26
2017-04-04 08:30:56 -07:00
Fabien Potencier
945fee14db Merge branch '2.7' into 2.8
* 2.7:
  fix some risky tests
  bumped Symfony version to 2.7.27
  updated VERSION for 2.7.26
  update CONTRIBUTORS for 2.7.26
  updated CHANGELOG for 2.7.26
2017-04-04 08:24:26 -07:00
Fabien Potencier
a2cd63c885 minor #22267 fix some more risky tests (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

fix some more risky 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        |

Continuation of #22066 fixing the tests for the following components:

* Config
* Form
* HttpFoundation
* Security

Commits
-------

fffcd247b2 fix some risky tests
2017-04-04 08:21:03 -07:00
Abdellatif Ait boudad
22425b2692 [Translation] avoid creating cache files for fallback locales. 2017-04-04 16:15:29 +01:00
insekticid
2fe1631be8 Allow Upper Case property names
ReflectionExtractor::getProperties() returns $id instead of $Id. It is bad naming convention, but is possible

```
class Entity {
    protected $Id;

    public function getId()
    {
        return $this->Id;
    }
}
```

# Conflicts:
#	src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php
#	src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php
2017-04-04 08:07:48 -07:00
Fabien Potencier
6e54cdf855 bug #22261 [Console] Give errors back to error handler if not handled by console.error listeners (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Give errors back to error handler if not handled by console.error listeners

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

Re-throws errors if `ConsoleErrorEvent::markErrorAsHandled()` hasn't been called so that they can reach the global error handler, fixing the BC break.

Commits
-------

5a5bf54d37 [Console] Give errors back to error handlers if not handled by console.error listeners
2017-04-04 08:00:37 -07:00
Christian Flothmann
fffcd247b2 fix some risky tests 2017-04-04 16:55:33 +02:00
Fabien Potencier
a146e4da1b feature #22276 [FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel

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

Commits
-------

da333a035d [FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel
2017-04-04 07:53:29 -07:00
Fabien Potencier
e47a50b7b2 Merge branch '3.2'
* 3.2:
  [Console] Fix render exception test
  [Workflow] fix risky tests
2017-04-04 07:34:05 -07:00
Fabien Potencier
6c8bdb782d minor #22270 [Console] Fix render exception test (ro0NL)
This PR was squashed before being merged into the 3.2 branch (closes #22270).

Discussion
----------

[Console] Fix render exception test

| Q             | A
| ------------- | ---
| Branch?       | 3.2 and up
| Bug fix?      | yes (regression from #22188 in master)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22217#issuecomment-291437500
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

As pointed out by @chalasr tests are mysteriously broken.. not sure what i missed but this is apparently needed now..

cc @fabpot

Commits
-------

6b71722392 [Console] Fix render exception test
2017-04-04 07:33:43 -07:00
Roland Franssen
6b71722392 [Console] Fix render exception test 2017-04-04 07:33:42 -07:00
Nicolas Grekas
27470de62a [DI] Add "factory" support to named args and autowiring 2017-04-04 16:31:36 +02:00
Javier Eguiluz
f9087c72c8 [WebProfilerBundle] Tweaked the Cache profiler panel 2017-04-04 07:31:23 -07:00
Grégoire Pineau
da333a035d [FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel 2017-04-04 15:38:28 +02:00
Grégoire Pineau
ada8a2948b minor #22271 [Workflow] fix risky tests (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

[Workflow] fix risky tests

| 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
-------

4e661e7a73 [Workflow] fix risky tests
2017-04-04 15:01:55 +02:00
Christian Flothmann
4e661e7a73 [Workflow] fix risky tests 2017-04-04 11:54:46 +02:00
Robin Chalas
5a5bf54d37 [Console] Give errors back to error handlers if not handled by console.error listeners 2017-04-04 10:56:16 +02:00
Nicolas Grekas
146f07471e [DI] Reduce complexity of autowiring 2017-04-04 10:21:54 +02:00
Nicolas Grekas
22bb403c20 Merge branch '3.2'
* 3.2:
  [DI] Autowiring and factories are incompatible with each others
  [DI] Don't use auto-registered services to populate type-candidates
  Lighten tests output by removing composer suggestions
  support nullable array or collection
  Complete the injection of the expression in all syntax errors
  CS: Remove invisible chars
  Disable resource tracking if the config component is missing
  [EventDispatcher] Remove unneded count()
  Fix tests expecting a valid date
  Avoid forcing to define the choices_as_values option when using choice_loader
  add expression text to SyntaxError
  [Console] Fix table cell styling
  [Console] Revised exception rendering
  Fix @param in PHPDoc
  [WebProfilerBundle] Normalize whitespace in exceptions passed in headers
  Disable color support detection for tests
  [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
2017-04-04 09:47:41 +02:00
Nicolas Grekas
ccbbff2328 Merge branch '2.8' into 3.2
* 2.8:
  [DI] Autowiring and factories are incompatible with each others
  [DI] Don't use auto-registered services to populate type-candidates
  Lighten tests output by removing composer suggestions
  support nullable array or collection
  Complete the injection of the expression in all syntax errors
  CS: Remove invisible chars
  Disable resource tracking if the config component is missing
  [EventDispatcher] Remove unneded count()
  Fix tests expecting a valid date
  Avoid forcing to define the choices_as_values option when using choice_loader
  add expression text to SyntaxError
  [Console] Fix table cell styling
  [Console] Revised exception rendering
  [WebProfilerBundle] Normalize whitespace in exceptions passed in headers
  Disable color support detection for tests
  [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
2017-04-04 09:26:27 +02:00
Fabien Potencier
e580c68899 bumped Symfony version to 2.7.27 2017-04-03 21:47:45 -07:00
Fabien Potencier
4cc567782e updated VERSION for 2.7.26 2017-04-03 21:31:58 -07:00
Fabien Potencier
83fc742b9d feature #22238 [BC BREAK][HttpFoundation] Request::setTrustedProxies() takes a new required $trustedHeaderSet argument (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[BC BREAK][HttpFoundation] Request::setTrustedProxies() takes a new required $trustedHeaderSet argument

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

As discussed in linked issue, and already deprecated by #21830

Commits
-------

72e28957e2 [BC BREAK][HttpFoundation] Request::setTrustedProxies() takes a new required $trustedHeaderSet argument
2017-04-03 16:22:00 -07:00
Fabien Potencier
6b862e85c2 Merge branch '2.7' into 2.8
* 2.7:
  Complete the injection of the expression in all syntax errors
  add expression text to SyntaxError
2017-04-03 16:11:44 -07:00
Fabien Potencier
0d85a99e18 minor #22224 Fix HttpCache test (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fix HttpCache test

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | https://github.com/symfony/symfony/pull/22043#discussion_r107864054
| License       | MIT
| Doc PR        | n/a

will make appveyor green.

Commits
-------

3178f50594 Fix failing HttpCache test on windows
2017-04-03 15:52:28 -07:00
Fabien Potencier
2450449605 feature #22175 [DI] add ServiceLocatorTagPass::register() to share service locators (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] add ServiceLocatorTagPass::register() to share service locators

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

Right now, one service locator is created per controller / service subscriber. But since service locators are stateless, this is just wasting resources when several controllers have the exact same set of services managed by their locators (as would be the case when registering the new `AbstractController` as a service subscribers).

This PR fixes this issue, and a few related others found along the way.

Commits
-------

8ff764be82 [DI] add ServiceLocatorTagPass::register() to share service locators
2017-04-03 15:47:57 -07:00
Fabien Potencier
88c587df78 bug #22223 [DI] Dont trigger deprecation for event_dispatcher service (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Dont trigger deprecation for event_dispatcher service

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

Mute deprecations for the event_dispatcher service keeping only relevant ones i.e when the api of the deprecated class is used intentionally, ugly but prevent breaking test suites like the [LexikJWTAuthenticationBundle one](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle/jobs/216664013#L278).

Commits
-------

a49fe25fa3 [DI] Dont trigger deprecation for event_dispatcher service
2017-04-03 15:45:37 -07:00
Fabien Potencier
bad24d3935 bug #22258 [DI] Autowiring and factories are incompatible with each others (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DI] Autowiring and factories are incompatible with each others

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

Commits
-------

9b601633a7 [DI] Autowiring and factories are incompatible with each others
2017-04-03 15:14:48 -07:00
Fabien Potencier
ee10bf2daa bug #22254 [DI] Don't use auto-registered services to populate type-candidates (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DI] Don't use auto-registered services to populate type-candidates

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no (every bug fix is a bc break, isn't it?)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22162, ~~#21658~~
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Alternative to #22170 and ~~#21665~~.

The core issue fixed here is that auto-registered services should *not* be used as type-candidates.
The culprit is this line:
`$this->populateAvailableType($argumentId, $argumentDefinition);`

Doing so creates a series of wtf-issues (the linked ones), with no simple fixes (the linked PRs are just dealing with the simplest cases, but the real fix would require a reboot of autowiring for every newly discovered types.)

The other changes accommodate for the removal of the population of the `types` property, and fix a few other issues found along the way:
- variadic constructors
- empty strings injection
- tail args removal when they match the existing defaults

Commits
-------

992c677534 [DI] Don't use auto-registered services to populate type-candidates
2017-04-03 15:09:59 -07:00
Fabien Potencier
fe71e8d233 minor #22137 [Serializer][XmlEncoder] Added a FORMAT constant (Zarcox)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Serializer][XmlEncoder] Added a FORMAT constant

| 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        | -

Added a FORMAT constant in the XmlEncoder class to normalize it like other Encoder classes.

Commits
-------

0a0901b8bc [Serializer] Added a FORMAT constant in the XmlEncoder class
2017-04-03 15:04:25 -07:00
Fabien Potencier
a9da8a3858 bug #22229 [ExpressionLanguage] Provide the expression in syntax errors (k0pernikus, stof)
This PR was merged into the 2.7 branch.

Discussion
----------

[ExpressionLanguage] Provide the expression in syntax errors

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

This finishes the PR #19449.

Commits
-------

7cd744133d Complete the injection of the expression in all syntax errors
dc55db2a9d add expression text to SyntaxError
2017-04-03 14:52:00 -07:00
Kévin Dunglas
80cea46ff1
bug #22251 [PropertyInfo] Support nullable array or collection (4rthem)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Support nullable array or collection

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

`@var array|null` was always considered as not nullable in the `PhpDocExtractor`.

Commits
-------

74ee588924 support nullable array or collection
2017-04-03 22:48:36 +02:00
Nicolas Grekas
d49005a651 Merge branch '2.7' into 2.8
* 2.7:
  Lighten tests output by removing composer suggestions
  CS: Remove invisible chars
  Disable resource tracking if the config component is missing
  [EventDispatcher] Remove unneded count()
  Fix tests expecting a valid date
  [Console] Fix table cell styling
  [Console] Revised exception rendering
  [WebProfilerBundle] Normalize whitespace in exceptions passed in headers
  Disable color support detection for tests
  [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
2017-04-03 22:37:06 +02:00
Nicolas Grekas
9b601633a7 [DI] Autowiring and factories are incompatible with each others 2017-04-03 20:09:33 +02:00
Nicolas Grekas
992c677534 [DI] Don't use auto-registered services to populate type-candidates 2017-04-03 20:02:13 +02:00
Grégoire Pineau
47740ce2d5 feature #22180 [Workflow] Added 'workflow_marked_places' twig function (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Workflow] Added 'workflow_marked_places' twig function

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

---

When someone uses a custom MarkingStore, the value in the
$subject::marking can be really different from the value inside
Marking::getPlaces(). This occurs, for example, when the value stored in
the subject is a bit mask.

So it's always safer to get the places names from the marking, and so
with this new function.

---

usage:
```twig
{{ workflow_marked_places(post)|join(',') }}
```

Commits
-------

ead6f142bb [Workflow] Added 'workflow_marked_places' twig function
2017-04-03 16:20:48 +02:00
Nicolas Grekas
72e28957e2 [BC BREAK][HttpFoundation] Request::setTrustedProxies() takes a new required $trustedHeaderSet argument 2017-04-03 11:58:17 +02:00
Robin Chalas
3178f50594 Fix failing HttpCache test on windows 2017-04-03 11:40:19 +02:00
Robin Chalas
a49fe25fa3 [DI] Dont trigger deprecation for event_dispatcher service 2017-04-03 11:37:23 +02:00
Arthur de Moulins
74ee588924 support nullable array or collection 2017-04-03 11:21:18 +02:00
Christophe Coevoet
7cd744133d Complete the injection of the expression in all syntax errors 2017-04-03 10:58:13 +02:00
Nicolas Grekas
d518e42ec9 minor #22232 CS: Remove invisible chars (keradus)
This PR was squashed before being merged into the 2.7 branch (closes #22232).

Discussion
----------

CS: Remove invisible chars

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

I found out that we have 2 non-visible in regular IDE chars in codebase.
One is just inside a comment, it could be safely removed.
But second is inside a real code, I have replaced it with `pack`, so one won't accidentally replace non-breaking space with regular space.

Commits
-------

0f623f4 CS: Remove invisible chars
2017-04-03 10:10:25 +02:00
Dariusz Ruminski
0f623f4220 CS: Remove invisible chars 2017-04-03 10:10:21 +02:00
Nicolas Grekas
03755ee8b3 minor #22237 [EventDispatcher] Remove unneded count() (ostrolucky)
This PR was merged into the 2.7 branch.

Discussion
----------

[EventDispatcher] Remove unneded count()

| 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
-------

9a1915f [EventDispatcher] Remove unneded count()
2017-04-03 10:06:44 +02:00
Fabien Potencier
ae7bcaeb96 minor #22121 [Lock] Simplify BlockingTest (jderusse)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Lock] Simplify BlockingTest

| 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
-------

7130dd8296 Simplify BlockingTest
2017-04-02 19:33:59 +02:00
Robin Chalas
75d5cb1bad Disable resource tracking if the config component is missing 2017-04-02 15:41:57 +02:00
Jérémy Derussé
7130dd8296
Simplify BlockingTest 2017-04-01 22:15:43 +02:00
Jérémy Derussé
d35db5db29
Add message in exception 2017-04-01 21:40:43 +02:00
Nicolas Grekas
8ff764be82 [DI] add ServiceLocatorTagPass::register() to share service locators 2017-04-01 13:57:21 +02:00
Gabriel Ostrolucký
9a1915f88b [EventDispatcher] Remove unneded count() 2017-04-01 00:21:40 +02:00
Fabien Potencier
e3d99649aa bug #22207 [HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22171, silexphp/Silex#1496
| License       | MIT
| Doc PR        | -

Implementing `ServiceSubscriberInterface` creates a dep on the DI component, which Silex can't afford. Let's revert that part.

@GromNaN can you please confirm this fixes your issue?

Commits
-------

7cd90f5c97 [HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener
2017-03-31 16:39:57 +02:00
Fabien Potencier
6008489153 bug #22140 [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set (fancyweb)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set

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

Commits
-------

ef39b704cc [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
2017-03-31 16:36:01 +02:00
Fabien Potencier
d62b765298 bug #22217 [Console] Fix table cell styling (ro0NL)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix table cell styling

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | tiny one
| 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        | symfony/symfony-docs#... <!--highly recommended for new features-->

Fixes an issue with newlines and table cells. Remembered this little trick from @chalasr as we had it before with style blocks i believe..

```php
$table = new Table($output);
$table->setRows(array(
    array(new TableCell('<error>Dont break'."\n".'here</error>', array('colspan' => 2))),
    new TableSeparator(),
    array('foo', new TableCell('<error>Dont break'."\n".'here</error>', array('rowspan' => 2))),
    array('bar'),
));
$table->render();
```

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24467857/74dacc9e-14b6-11e7-8f62-3831508ac949.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24467923/bb578f0e-14b6-11e7-85ed-039cd73b81a0.png)

Commits
-------

53ecf8393e [Console] Fix table cell styling
2017-03-31 16:33:09 +02:00
Fabien Potencier
19a9b2f29b bug #22216 [Component] [Yaml] [Parser] : can parse with trailing space as 2.8 (jordscream)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Component] [Yaml] [Parser] :  can parse with trailing space as 2.8

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #22193
| License       | MIT
| Doc PR        | symfony/symfony-docs

Missing rtrim method in line to parse as the version 2.8 does

Commits
-------

ce3d5ab7d1 [Component] [Yaml] [Parser] :  can parse with trailing space as 2.8
2017-03-31 16:30:03 +02:00
Fabien Potencier
fb6de49fd0 bug #22194 [Console] CommandTester: disable color support detection (julienfalque)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] CommandTester: disable color support detection

| 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        | -

By default, the command tester relies on [color support guessing](3fe419cf66/src/Symfony/Component/Console/Output/StreamOutput.php (L91)) to enable output decoration.

This is an issue for tests in that guessing is done against the stream instance on Linux and against the actual environment running the test on Windows, so color support can be detected on Windows even when the used stream is a memory stream like here, resulting in non-deterministic tests.

This PR disables output decoration by default. This will only change behavior on Windows with color support, as guessing on Linux always detects color as not supported for memory streams anyway. Tests should enable decoration explicitly when they want to test it.

A better fix would be to actually detect that we are using a memory stream on Windows as well, but I'm not sure it's possible.

Commits
-------

3fe419cf66 Disable color support detection for tests
2017-03-31 14:44:27 +02:00
Christophe Coevoet
071548090b Fix tests expecting a valid date 2017-03-31 14:26:28 +02:00
Christophe Coevoet
fb4d8de5e4 Avoid forcing to define the choices_as_values option when using choice_loader
When using the choice loader, choices are ignored entirely. Forcing the dev
to add the choices_as_values just to avoid the deprecation warning (and then
to remove the option again at some point in 3.x due to deprecation) is a bad
developer experience.
2017-03-31 10:23:48 +02:00
Philipp Kretzschmar
dc55db2a9d add expression text to SyntaxError
fixes #19445
2017-03-31 09:39:36 +02:00
Nicolas Grekas
7cd90f5c97 [HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener 2017-03-30 14:49:17 +02:00
Roland Franssen
53ecf8393e [Console] Fix table cell styling 2017-03-30 10:19:40 +02:00
Jordan Samouh
ce3d5ab7d1 [Component] [Yaml] [Parser] : can parse with trailing space as 2.8 2017-03-30 09:16:02 +02:00
Robin Chalas
b21ce850e7 [Console] Allow to catch CommandNotFoundException 2017-03-29 21:37:27 +02:00
Christian Flothmann
8c81f5eefe [FrameworkBundle] fix typo in changelog 2017-03-29 18:13:28 +02:00
Grégoire Pineau
ead6f142bb [Workflow] Added 'workflow_marked_places' twig function
When someone uses a custom MarkingStore, the value in the
$subject::marking can be really different from the value inside
Marking::getPlaces(). This occurs, for example, when the value stored in
the subject is a bit mask.

So it's always safer to get the places names from the marking, and so
with this new function.
2017-03-29 14:29:58 +02:00
Fabien Potencier
329b1819f1 minor #22186 [DI] Throw on "configured-keys <> getSubscribedServices()" mismatch (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Throw on "configured-keys <> getSubscribedServices()" mismatch

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

As reported on Slack, this creates DX issues, and provides no practical benefit. Let's throw instead of logging.

Commits
-------

4da8884ca4 [DI] Throw on "configured-keys <> getSubscribedServices()" mismatch
2017-03-29 07:30:55 +02:00
Fabien Potencier
11a06ccced bug #22188 [Console] Revised exception rendering (ro0NL)
This PR was squashed before being merged into the 2.7 branch (closes #22188).

Discussion
----------

[Console] Revised exception rendering

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| 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        | symfony/symfony-docs#... <!--highly recommended for new features-->

Continuation of #22142, as escaping can break too i just realized.

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24376962/fc85a15c-133d-11e7-90fe-a8c754cbf592.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24377289/340a8f2e-133f-11e7-83b3-54e1ea6f46bd.png)

cc @chalasr

Commits
-------

17f1f079b2 [Console] Revised exception rendering
2017-03-29 07:27:06 +02:00
Roland Franssen
17f1f079b2 [Console] Revised exception rendering 2017-03-29 07:27:03 +02:00
Fabien Potencier
9466237db0 bug #22154 [WebProfilerBundle] Normalize whitespace in exceptions passed in headers (curry684)
This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] Normalize whitespace in exceptions passed in headers

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

If an exception was thrown with line separators in its message the WebProfiler would cause an exception by passing it through unsanitized into the X-Debug-Error HTTP header. This commit fixes that by replacing all whitespace sequences with a single space in the header.

Commits
-------

d64679014b [WebProfilerBundle] Normalize whitespace in exceptions passed in headers
2017-03-29 07:19:30 +02:00
Jérôme Tamarelle
6ed9d0e4c1 Fix @param in PHPDoc
Errors reported by Sami API Doc generator on branch 3.2

ERROR: The "factory" @param tag variable name is wrong (should be "objectLoader") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: The "objectLoader" @param tag variable name is wrong (should be "factory") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: "7" @param tags are expected but only "6" found on "Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::__construct" in src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php:50
ERROR: "3" @param tags are expected but only "2" found on "Symfony\Component\Asset\PathPackage::__construct" in src/Symfony/Component/Asset/PathPackage.php:35
ERROR: "2" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\PhpArrayAdapter::create" in src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php:64
ERROR: "3" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\RedisAdapter::__construct" in src/Symfony/Component/Cache/Adapter/RedisAdapter.php:39
ERROR: The "format" @param tag variable name is wrong (should be "fileLinkFormat") on "Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat" in src/Symfony/Component/Debug/ExceptionHandler.php:90
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\Compiler::addPass" in src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:73
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\PassConfig::addPass" in src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php:97
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass" in src/Symfony/Component/DependencyInjection/ContainerBuilder.php:311
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface::getProxyFactoryCode" in src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php:41
ERROR: "0" @param tags are expected but only "1" found on "Symfony\Component\HttpFoundation\Request::isMethodSafe" in src/Symfony/Component/HttpFoundation/Request.php:1458
ERROR: "5" @param tags are expected but only "6" found on "Symfony\Component\Serializer\Normalizer\AbstractNormalizer::instantiateObject" in src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php:291
2017-03-28 23:38:24 +02:00
Niels Keurentjes
d64679014b [WebProfilerBundle] Normalize whitespace in exceptions passed in headers
If an exception was thrown with line separators in its message the
WebProfiler would cause an exception by passing it through unsanitized
into the X-Debug-Error HTTP header. This commit fixes that by replacing
all whitespace sequences with a single space in the header.
2017-03-28 22:44:31 +02:00
Nicolas Grekas
05d15cf4df feature #22185 [DI] Enhance DX by throwing instead of triggering a deprecation notice (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Enhance DX by throwing instead of triggering a deprecation notice

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes - at the config file level, for edge cases
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22143
| License       | MIT
| Doc PR        | -

Looking at the linked issue, I'm reconsidering our decision to trigger a deprecation notice when one uses `_instanceof` or `_defaults` as a service name. While on the BC side, this is strict - on the DX side, it looks like this opens a trap where people fill fall into.

The same occurs to me with named args: instead of silently accepting invalid args as was the case before, let's throw to help DX when people do mistakes.

Last change in this PR: the complex logic required to force strings to be given as `$id` args into `Reference` or `Alias` makes no sense to me, especially considering that a `string` type hint on PHP7 will *do* a string cast.

Commits
-------

b07da3d [DI] Enhance DX by throwing instead of triggering a deprecation notice
2017-03-28 10:56:13 +02:00
Grégoire Pineau
8f090bca12 [Workflow] Added more PHPDoc 2017-03-28 10:44:09 +02:00
Grégoire Pineau
cbb0c1809b minor #22195 [Workflow] Added more PHPDoc (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Workflow] Added more PHPDoc

| 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        | -

---

asked by @fabpot / @HeahDude

Commits
-------

97787c6bdc [Workflow] Added more PHPDoc
2017-03-28 10:39:12 +02:00
Grégoire Pineau
97787c6bdc [Workflow] Added more PHPDoc 2017-03-28 10:29:42 +02:00
Julien Falque
3fe419cf66
Disable color support detection for tests 2017-03-28 08:19:43 +02:00
Nicolas Grekas
b07da3dc1e [DI] Enhance DX by throwing instead of triggering a deprecation notice 2017-03-28 08:18:44 +02:00
Nicolas Grekas
4da8884ca4 [DI] Throw on "configured-keys <> getSubscribedServices()" mismatch 2017-03-28 08:17:58 +02:00
Fabien Potencier
d0e904b0da Merge branch '3.2'
* 3.2:
  [Process] Fix bug which wiped or mangled env vars
2017-03-27 11:09:43 -07:00
Patrick Dawkins
9439237c81 [Process] Fix bug which wiped or mangled env vars 2017-03-27 11:07:02 -07:00
HeahDude
b5b56fcbac [Form] Deprecated usage of "choices" option in sub types 2017-03-27 18:52:54 +02:00
Nicolas Grekas
af1eed92c2 [HttpFoundation] Fix bad merge 2017-03-27 16:57:37 +02:00
Nicolas Grekas
d5af0da0a7 Merge branch '3.2'
* 3.2:
  [Console] Fix test
  [HttpKernel] Fix test
  Remove port from default host in server:status command
  [Console] Escape exception messages
2017-03-27 16:51:00 +02:00
Nicolas Grekas
56d476942c Merge branch '2.8' into 3.2
* 2.8:
  [HttpKernel] Fix test
  Remove port from default host in server:status command
  [Console] Escape exception messages
2017-03-27 16:49:31 +02:00
Nicolas Grekas
a0e654d981 Merge branch '2.7' into 2.8
* 2.7:
  [HttpKernel] Fix test
  Remove port from default host in server:status command
  [Console] Escape exception messages
2017-03-27 16:49:15 +02:00
Fabien Potencier
dd3712601d minor #22177 [HttpKernel] Fix test (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Fix test

| 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        | -

Should make 2.7 green again on Travis.

Commits
-------

ba8f46ad23 [HttpKernel] Fix test
2017-03-27 07:44:58 -07:00
Fabien Potencier
46cf21506c bug #22142 [Console] Escape exception messages in renderException (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Escape exception messages in renderException

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

Adding style on exception messages should be prevented, it leads to weird results.

> Allowing formatting in them would be a nightmare, given that Symfony itself applies some formatting when rendering the exception.

Commits
-------

cb1348231a [Console] Escape exception messages
2017-03-27 07:36:47 -07:00
Nicolas Grekas
e9c3df6c94 [Console] Fix test 2017-03-27 16:36:46 +02:00
Fabien Potencier
9ca3f23f72 minor #22174 [Config] Update PHPDoc (Ahmed TAILOULOUTE)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Config] Update PHPDoc

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

Commits
-------

d052c563b8 Update PHPDoc
2017-03-27 07:33:53 -07:00
Nicolas Grekas
ba8f46ad23 [HttpKernel] Fix test 2017-03-27 16:31:27 +02:00
Ahmed TAILOULOUTE
d052c563b8 Update PHPDoc 2017-03-27 15:17:59 +01:00
Fabien Potencier
615a2c5ee9 bug #22165 [WebServerBundle] Fix starting second server + port lookup (ro0NL)
This PR was squashed before being merged into the 3.3-dev branch (closes #22165).

Discussion
----------

[WebServerBundle] Fix starting second server + port lookup

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24333032/5edc45f6-1251-11e7-890d-e02236c1e4f2.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24333036/6d35a8a4-1251-11e7-8317-59d1fc0dfe7b.png)

Commits
-------

37e613b459 remove unknown address argument in help text
a4345e59de [WebServerBundle] Fix starting second server + port lookup
2017-03-27 07:15:41 -07:00
Fabien Potencier
3cd563ad00 minor #22153 [DX] [DI] Throw more helpful error when shortcutting global classes (curry684)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DX] [DI] Throw more helpful error when shortcutting global classes

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

As discussed in #22146 the error message received when trying to use a class in the global
namespace as a service without defined class is confusing. Helpful information was added
pointing out this current limitation.

Commits
-------

b9e7b4fd61 [DependencyInjection] Throw helpful error when shortcutting global classes
2017-03-27 07:02:28 -07:00
Andreas Braun
dbcfa5c659
Remove port from default host in server:status command 2017-03-27 08:24:12 +02:00
Niels Keurentjes
b9e7b4fd61 [DependencyInjection] Throw helpful error when shortcutting global classes
As discussed in #22146 the error message received when trying to use a class in the global
namespace as a service without defined class is confusing. Helpful information was added
pointing out this current limitation.
2017-03-26 23:09:16 +02:00
Roland Franssen
37e613b459 remove unknown address argument in help text 2017-03-26 19:02:20 +02:00
Roland Franssen
a4345e59de [WebServerBundle] Fix starting second server + port lookup 2017-03-26 18:28:54 +02:00
Fabien Potencier
1b634746ed fixed bad merge 2017-03-26 08:53:54 -07:00
Fabien Potencier
811a6bf5eb Merge branch '3.2'
* 3.2:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [WebProfilerBundle] Include badge status in translation tabs
  [FrameworkBundle] Cache pool clear command requires at least 1 pool
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-26 08:50:20 -07:00
Fabien Potencier
dc66960f84 Merge branch '2.8' into 3.2
* 2.8:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
2017-03-26 08:47:15 -07:00
Fabien Potencier
d175340777 Merge branch '2.7' into 2.8
* 2.7:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
2017-03-26 08:40:40 -07:00
Nicolas Grekas
0577c7b089 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite 2017-03-26 17:09:07 +02:00
Roland Franssen
543ac435b8 [WebProfilerBundle] Include badge status in translation tabs 2017-03-26 14:00:52 +02:00
Fabien Potencier
6cc9dc7586 feature #22060 [DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention

| 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 PR adds a new autowiring mode, based only on the class <> id convention.
This way of autowiring is free from any conflicting behavior, which is what I was looking for to begin with.

The expected DX is a bit more involving than the current way we do autowiring. But it's worth it to me, because it's plain predictable - a lot less "magic" imho.

So in this mode, for each `App\Foo` type hint, a reference to an "App\Foo" service will be created. If no such service exists, an exception will be thrown. To me, this opens a nice DX: when type hinting interfaces (which is the best practice), this will tell you when you need to create the explicit interface <> id mapping that is missing - thus encourage things to be made explicit, but only when required, and gradually, in a way that will favor discoverability by devs.

Of course, this is opt-in, and BC. You'd need to do eg in yaml: `autowire: by_id`.
For consistency, the current mode (`autowire: true`) can be configured using `autowire: by_type`.

Commits
-------

c298f2a90c [DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention
2017-03-25 13:18:59 -07:00
Fabien Potencier
9896f86743 feature #22158 Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)" (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)"

This reverts commit 2183f98f54, reversing
changes made to b465634a55.

| 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        | -

Let's remove getter injection, we now have enough alternative mechanisms to achieve almost the same results (e.g. `ServiceSubscriberInterface`, see #21708)., and I'm tired being called by names because of it.

The only use case in core is `ControllerTrait`, but this should be gone if #22157 is merged.

Commits
-------

23fa3a09bf Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)"
2017-03-25 12:45:22 -07:00
Nicolas Grekas
a93f059878 [FrameworkBundle] Introduce AbstractController, replacing ControllerTrait 2017-03-25 18:18:01 +01:00
Fabien Potencier
8901c7eaa6 feature #22046 [Asset] Adding a new version strategy that reads from a manifest JSON file (weaverryan)
This PR was squashed before being merged into the 3.3-dev branch (closes #22046).

Discussion
----------

[Asset] Adding a new version strategy that reads from a manifest JSON file

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

Hi guys!

Often, when using a frontend task manager or bundler (e.g. webpack of gulp), the final assets are dumped with a version or content hash in the filename itself (e.g. main.123abc.css). To know what the correct, current hashed filename is, you'll dump a `manifest.json` file - e.g.

```json
{
  "main.js": "main.123abc.js",
  "css/styles.css": "css/styles.555def.css"
}
```

Examples: [gulp-rev](https://github.com/sindresorhus/gulp-rev) and [webpack-manifest-plugin](https://www.npmjs.com/package/webpack-manifest-plugin).

This PR adds a new version strategy that will look up the asset path (e.g. `main.css`) in that file and return the final, versioned path. Some people may dump manifest files in other formats, but I think this catches the most common use-case (and you can always still create your own version strategy). I've written this to be "forgiving" - if a path doesn't exist in the manifest, the path is simply returned, unaltered.

Another implementation *could* have been to add a new Twig filter (e.g. `{{ asset('main.css|manifest_path) }}`) - but I thought I'd try first using the existing versioning system.

## Usage

```yml
# app/config/config.yml
framework:
    # ...
    assets:
       # added validation prevents you from setting json_manifest_path AND version, for example
        json_manifest_path: '%kernel.root_dir%/../web/manifest.json'
```

```twig
{# someTemplate.html.twig #}

{# use asset() just like normal #}
<script src="{{ asset('js/main.js') }}"></script>
```

## TODO
* fabbot hates my invalid json syntax file... even though I tried to be clever and not give it a `.json` suffix :)

Commits
-------

07fec2bbad [Asset] Adding a new version strategy that reads from a manifest JSON file
2017-03-25 09:22:52 -07:00
Ryan Weaver
07fec2bbad [Asset] Adding a new version strategy that reads from a manifest JSON file 2017-03-25 09:22:50 -07:00
Roland Franssen
a61797f850 [FrameworkBundle] Cache pool clear command requires at least 1 pool 2017-03-25 08:48:15 -07:00
Fabien Potencier
869e68dd1f bug #22144 [Console] Fixed fatal error when the command is not defined (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Fixed fatal error when the command is not defined

| 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/18140/files#r107871406
| License       | MIT
| Doc PR        |

Commits
-------

d5b41b6b0a [Console] Fixed fatal error when the command is not defined
2017-03-25 08:31:41 -07:00
Nicolas Grekas
23fa3a09bf Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)"
This reverts commit 2183f98f54, reversing
changes made to b465634a55.
2017-03-25 15:07:47 +01:00
Robin Chalas
cb1348231a [Console] Escape exception messages 2017-03-25 13:51:36 +01:00
Fabien Potencier
eda821a87a feature #22129 [WebProfilerBundle] Improve cache panel (ro0NL)
This PR was squashed before being merged into the 3.3-dev branch (closes #22129).

Discussion
----------

[WebProfilerBundle] Improve cache panel

| Q             | A
| ------------- | ---
| Branch?       | master
| 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        | symfony/symfony-docs#... <!--highly recommended for new features-->

An attempt to improve the page a bit. Personally i think all elements on a single page is too much info.

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24272477/d4d96a44-101d-11e7-9cc5-1646fc2c0603.png)

![image](https://cloud.githubusercontent.com/assets/1047696/24272500/e51318a6-101d-11e7-8875-c270016f11a2.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24311179/530dcc6a-10d3-11e7-9c39-7c73ee2775f1.png)

![image](https://cloud.githubusercontent.com/assets/1047696/24311215/82c48566-10d3-11e7-82ff-6d79c3040a25.png)

Commits
-------

3592d0de6a [WebProfilerBundle] Improve cache panel
2017-03-24 15:59:01 -07:00
Roland Franssen
3592d0de6a [WebProfilerBundle] Improve cache panel 2017-03-24 15:58:51 -07:00
Fabien Potencier
da0b520a50 bug #22133 [Filesystem] normalize paths before making them relative (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] normalize paths before making them relative

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

Commits
-------

d50ffa1de7 normalize paths before making them relative
2017-03-24 15:53:44 -07:00
Fabien Potencier
be3d2d2389 minor #22139 [HttpFoundation][DX] MockArraySessionStorage: phpdocs update (MacDada)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation][DX] MockArraySessionStorage: phpdocs update

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

Commits
-------

967f7a7add MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
2017-03-24 15:51:36 -07:00
Nicolas Grekas
c298f2a90c [DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention 2017-03-24 15:54:23 +01:00
Dawid Nowak
d984c73e66 [HttpFoundation][bugfix] should always be initialized 2017-03-24 07:50:55 -07:00
Dawid Nowak
967f7a7add MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work 2017-03-24 15:14:19 +01:00
Grégoire Pineau
d5b41b6b0a [Console] Fixed fatal error when the command is not defined 2017-03-24 11:19:00 +01:00
Nicolas Grekas
d7557cf975 [DI] Add hints to exceptions thrown by AutowiringPass 2017-03-24 10:50:03 +01:00
Thomas Calvet
ef39b704cc [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set 2017-03-24 10:02:28 +01:00
Christian Flothmann
d50ffa1de7 normalize paths before making them relative 2017-03-24 08:21:37 +01:00
Kevin EMO
0a0901b8bc [Serializer] Added a FORMAT constant in the XmlEncoder class 2017-03-24 01:34:02 +01:00
Fabien Potencier
2ad59231c6 remvoed dead code 2017-03-23 11:14:29 -07:00
Fabien Potencier
fb56bcce98 Merge branch '2.8' into 3.2
* 2.8:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-23 09:09:32 -07:00
Fabien Potencier
f971f4f5f2 Merge branch '2.7' into 2.8
* 2.7:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-23 09:08:03 -07:00
Fabien Potencier
80af0838f5 removed test that does not test anything 2017-03-23 09:07:35 -07:00
Fabien Potencier
e31d3461ea fixed tests 2017-03-23 09:02:44 -07:00
Antanas Arvasevicius
6d23c8c41c #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile 2017-03-23 08:57:18 -07:00
Fabien Potencier
db8d87dce2 feature #21819 [Twig Bridge] A simpler way to retrieve flash messages (javiereguiluz)
This PR was squashed before being merged into the 3.3-dev branch (closes #21819).

Discussion
----------

[Twig Bridge] A simpler way to retrieve flash messages

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

Getting flash messages in templates is more complex than it could be. Main problems:

1. It's too low level: you need to get the "flash bag" (and first, learn what a "flash bag" is) and then you need to call the internal method: `all()`, `get()`, etc.
2. You need to be careful because the session will start automatically when you ask for flashes (even if there are no flashes). You can prevent this with the `{% if app.session is not null and app.session.started %}` code, but it's boring to always use that.

So, I propose to add a new `app.flashes` helper that works as follows.

---

## Get all the flash messages

### Before

```twig
{% if app.session is not null and app.session.started %}
    {% for label, messages in app.session.flashbag.all %}
        {% for message in messages %}
            <div class="alert alert-{{ label }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endfor %}
{% endif %}
```

### After

```twig
{% for label, messages in app.flashes %}
    {% for message in messages %}
        <div class="alert alert-{{ label }}">
            {{ message }}
        </div>
    {% endfor %}
{% endfor %}
```

---

## Get only the flashes of type `notice`

```twig
{% if app.session is not null and app.session.started %}
    {% for message in app.session.flashbag.get('notice') %}
        <div class="alert alert-notice">
            {{ message }}
        </div>
    {% endfor %}
{% endif %}
```

### After

```twig
{% for message in app.flashes('notice') %}
    <div class="alert alert-notice">
        {{ message }}
    </div>
{% endfor %}
```

---

As an added bonus, you can get any number of flash messages because the method allows to pass an array of flash types:

```twig
{% for label, messages in app.flashes(['warning', 'error']) %}
    {% for message in messages %}
        <div class="alert alert-{{ label }}">
            {{ message }}
        </div>
    {% endfor %}
{% endfor %}
```

Commits
-------

5a56b23327 [Twig Bridge] A simpler way to retrieve flash messages
2017-03-23 08:48:12 -07:00
Javier Eguiluz
5a56b23327 [Twig Bridge] A simpler way to retrieve flash messages 2017-03-23 08:48:05 -07:00
Nikolay Labinskiy
d980e706ad [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page 2017-03-23 11:48:03 +02:00
Robin Chalas
ea84aa1868 Fix tests 2017-03-23 10:34:23 +01:00
Fabien Potencier
bafa8e29e0 feature #19026 [Security] Strengthen comparison of target_url vs login_path (mrzard)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security] Strengthen comparison of target_url vs login_path

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

Commits
-------

ac9d75a09e [Security] Strengthen comparison of target_url vs login_path
2017-03-22 16:29:02 -07:00
Fabien Potencier
6f998375ff updated CHANGELOG 2017-03-22 16:26:17 -07:00
Fabien Potencier
ce067a3844 feature #19496 [DX][Form][Validator] Add ability check if cocrete constraint fails. (Koc)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DX][Form][Validator] Add ability check if cocrete constraint fails.

| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | wait for travis |
| Fixed tickets | #15154 |
| License | MIT |
| Doc PR | should open |

Sometimes for big forms with multiple constraints we should handle some errors separately.

``` php
// when using validator
$constraintViolations = $validator->validate(...);
if (count($constraintViolations->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
  // display some message or send email or etc
}

// when using forms
if (count($form->getErrors()->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
  // display some message or send email or etc
}
```

This PR add some useful methods to handle this. Before we should iterate all failed constraints using foreach.

Feel free to suggest better names for new methods.

Commits
-------

29a3a7e0d6 Add ability retrieve errors by their code.
2017-03-22 16:25:22 -07:00
Fabien Potencier
b59660c23d minor #22119 [Lock] Adjust lock delay to avoid false error tests (jderusse)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Lock] Adjust lock delay to avoid false error 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        |

Adjust the clockDelay to fix tests
This test is here to:

T0.
* Fork A, B, C

T1.
* A acquire Lock then start sleeping for 3*clockDelay
* B start sleeping for 1*clockDelay
* C start sleeping for 1*clockDelay

T2
* B wakeup AND try to acquire lock in wait mode
* C wakeup AND try to acquire lock in non wait mode (lock should be till acquired by A)

T4
* A release Lock
* B acquire lock and release it

At the end, this tests assert than:
* A acquire and delete the lock
* B acquire and delete the lock
* C failed to acquire the lock

The point is, this test is time sensitive, and if the fork is too slow, A, B and C are not synchronized and C is able to acquire Lock.

This PR adjuste clock delay to reduce false failures

Commits
-------

33f2a9a6f7 Adjust lock delay to avoid false error tests
2017-03-22 16:13:19 -07:00
Fabien Potencier
ba4d6bce29 feature #18140 [Console] Add console.ERROR event and deprecate console.EXCEPTION (wouterj)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Add console.ERROR event and deprecate console.EXCEPTION

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

The current `console.EXCEPTION` event is only dispatched for exceptions during the execution of `Command#execute()`. All other exceptions (e.g. the ones thrown by listeners to events) are catched by the `try ... catch` loop in `Application#doRunCommand()`. This means that there is _no way to override exception handling_.
## The Solution

This PR adds a `console.ERROR` event which has the same scope as the default `try ... catch` loop. This allows to customize all exception handling.

In order to keep BC, a new event was created and `console.EXCEPTION` was deprecated.

Commits
-------

c02a4c9857 Added a console.ERROR event
2017-03-22 16:10:45 -07:00
Fabien Potencier
42e5b4e10d feature #22120 [FrameworkBundle] Multiple services on one Command class (SenseException)
This PR was squashed before being merged into the 3.3-dev branch (closes #22120).

Discussion
----------

[FrameworkBundle] Multiple services on one Command class

rebased version of #19305

Commits
-------

2b82fcb437 [FrameworkBundle] Multiple services on one Command class
2017-03-22 16:05:06 -07:00
Claudio Zizza
2b82fcb437 [FrameworkBundle] Multiple services on one Command class 2017-03-22 16:05:04 -07:00
Fabien Potencier
ce9cd71372 fixed Yoda condition 2017-03-22 16:03:14 -07:00
Fabien Potencier
426a666def minor #22043 Refactor stale-while-revalidate code in HttpCache, add a (first?) test for it (mpdude)
This PR was squashed before being merged into the 3.3-dev branch (closes #22043).

Discussion
----------

Refactor stale-while-revalidate code in HttpCache, add a (first?) test for it

| 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        |

I came up with this while trying to hunt a production bug related to handling of stale cache entries under the condition of a busy backend (also see #22033).

It's just a refactoring to make the code more readable plus a new test.

Commits
-------

b14057c88a Refactor stale-while-revalidate code in HttpCache, add a (first?) test for it
2017-03-22 16:02:33 -07:00
Matthias Pigulla
b14057c88a Refactor stale-while-revalidate code in HttpCache, add a (first?) test for it 2017-03-22 16:02:29 -07:00
Jérémy Derussé
33f2a9a6f7
Adjust lock delay to avoid false error tests 2017-03-22 23:42:28 +01:00
Matthias Pigulla
30639c6af6 Minor cleanups in HttpCache, especially centralize Date header fixup 2017-03-22 15:30:57 -07:00
Fabien Potencier
0a5998d996 feature #21771 [FrameworkBundle] Add new "controller.service_arguments" tag to inject services into actions (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Add new "controller.service_arguments" tag to inject services into actions

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

Talking with @simensen and @weaverryan, we wondered if we could leverage the `ArgumentResolver` mechanism to make it inject services on demand, using e.g. autowiring.

```php
class PostController
{
  public function indexAction(Request $request, PostRepository $postRepository)
  {
    // PostRepository comes from the container
    $postRepository->findAll(); // ...
  }
}
```

This PR achieves that, using a new "controller.service_arguments" tag. Typically:
```yaml
services:
    AppBundle\Controller\PostController:
        autowire: true
        tags:
            - name: controller.service_arguments
```

It also supports with explicit wiring (thus doesn't necessarily require autowiring if you don't want to use it):
```yaml
services:
    AppBundle\Controller\PostController:
        tags:
            - name: controller.service_arguments
              action: fooAction
              argument: logger
              id: my_logger
```

~~The attached diff is bigger than strictly required for now, until #21770 is merged.~~

Todo:
- [x] rebase on top of #21770 when merged
- [x] add tests
- [x] add cleaning pass to remove empty service locators

Commits
-------

9c6e672780 [FrameworkBundle] Add new "controller.service_arguments" tag to inject services into actions
2017-03-22 15:24:31 -07:00
Fabien Potencier
b2d5ba7db7 feature #22114 [lock] Rename Quorum into Strategy (jderusse)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[lock] Rename Quorum into Strategy

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes (not consistent naming)
| New feature?  | no
| BC breaks?    | yes (but version 3.4 not yet released)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        |

The term `Quorum` in Interface is confusing an not consistent with the Symfony project.
This PR switch to naming `Strategy\StrategyInterface` (like in adapter i `Cache` and `Ldap` component)

Commits
-------

1e9671b993 Rename Quorum into Strategy
2017-03-22 15:21:53 -07:00
Fabien Potencier
2eb5c979fa minor #22117 [Lock] Don't call blindly the redis client (jderusse)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Lock] Don't call blindly the redis client

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

Actual code rely on controls on the constructor. This PR add an assertion to avoid futur bugs

Commits
-------

e4db018b6d Don't call blindly the redis client
2017-03-22 15:17:31 -07:00
Jérémy Derussé
1e9671b993
Rename Quorum into Strategy 2017-03-22 23:05:31 +01:00
Maxime Steinhausser
57427cc01e Fix deprecation message 2017-03-22 22:52:11 +01:00
Jérémy Derussé
e4db018b6d
Don't call blindly the redis client 2017-03-22 22:50:35 +01:00
Fabien Potencier
a6b20d1e5c bug #19778 [Security] Fixed roles serialization on token from user object (eko)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Fixed roles serialization on token from user object

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

This PR fixes the serialization of tokens when using `Role` objects provided from the user. Indeed, there were actually a reference issue that can causes fatal errors like the following one:

```
FatalErrorException in RoleHierarchy.php line 43:
Error: Call to a member function getRole() on string
```

Here is a small code example to reproduce and its output:

``` php
$user = new Symfony\Component\Security\Core\User\User('name', 'password', [
    new Symfony\Component\Security\Core\Role\Role('name')
]);
$token = new Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken($user, 'password', 'providerKey', $user->getRoles());

$serialized = serialize($token);
$unserialized = unserialize($serialized);

var_dump($unserialized->getRoles());
```

Before:

```
array(1) { [0]=> bool(true) }
```

After:

```
array(1) { [0]=> object(Symfony\Component\Security\Core\Role\Role)#15 (1) {["role":"Symfony\Component\Security\Core\Role\Role":private]=> string(4) "name" } }
```

Thank you

Commits
-------

dfa7f5020e [Security] Fixed roles serialization on token from user object
2017-03-22 14:44:57 -07:00
Nicolas Grekas
4927993835 Merge branch '3.2'
* 3.2:
  Fixed pathinfo calculation for requests starting with a question mark.
  [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header
  [Validator] Add object handling of invalid constraints in Composite
  [WebProfilerBundle] Remove uneeded directive in the form collector styles
  removed usage of $that
  HttpCache: New test for revalidating responses with an expired TTL
  [Serializer] [XML] Ignore Process Instruction
  [Security] simplify the SwitchUserListenerTest
  Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
  [HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST
2017-03-22 22:42:42 +01:00
Fabien Potencier
1635a6a4e7 feature #20516 [Security][SecurityBundle] Enhance automatic logout url generation (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security][SecurityBundle] Enhance automatic logout url generation

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

This should help whenever:

- [the token does not implement the `getProviderKey` method](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php#L89-L99)
- you've got multiple firewalls sharing a same context but a logout listener only define on one of them.

##### Behavior:

> When not providing the firewall key:
>
>- Try to find the key from the token (unless it's an anonymous token)
>- If found, try to get the listener from the key. If the listener is found, stop there.
>- Try from the injected firewall key. If the listener is found, stop there.
>- Try from the injected firewall context. If the listener is found, stop there.
>
>The behavior remains unchanged when providing explicitly the firewall key. No fallback.

Commits
-------

5b7fe852aa [Security][SecurityBundle] Enhance automatic logout url generation
2017-03-22 14:38:03 -07:00
Fabien Potencier
c73009a996 feature #22081 [FrameworkBundle][Validator] Move Validator passes to the component (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Validator] Move Validator passes to the component

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

Commits
-------

0b741da343 Move AddValidatorInitializersrPass & AddConstraintValidatorsPass to the Validator
2017-03-22 14:26:38 -07:00
Fabien Potencier
a25fd7ddbc minor #22112 Minor PR fixes (ro0NL)
This PR was squashed before being merged into the 3.3-dev branch (closes #22112).

Discussion
----------

Minor PR fixes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

cc @fabpot  my bad :)

Commits
-------

0728fb91b8 typo
036b0414d6 Minor PR fixes
2017-03-22 14:24:53 -07:00
Fabien Potencier
6a1f5d4dfa feature #20567 [WebProfilerBundle] Improved cookie traffic (ro0NL)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[WebProfilerBundle] Improved cookie traffic

| Q             | A
| ------------- | ---
| Branch?       | "master"
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

![image](https://cloud.githubusercontent.com/assets/1047696/20455635/a033a814-ae60-11e6-8500-e60146f4619e.png)

Relates to #20569 in terms of getting _all_ the cookies.

Commits
-------

171c6d100e [WebProfilerBundle] Improved cookie traffic
2017-03-22 14:19:48 -07:00
Fabien Potencier
e3d90db747 bug #22036 Set Date header in Response constructor already (mpdude)
This PR was squashed before being merged into the 2.8 branch (closes #22036).

Discussion
----------

Set Date header in Response constructor already

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

Setting the `Date` header in the `Response` constructor has been removed in #14912 and changed to a more lazy approach in `getDate()`.

That way, methods like `getAge()`, `getTtl()` or `isFresh()` cause side effects as they eventually call `getDate()` and the Request "starts to age" once you call them.

I don't know if this would be a nice test, but current behaviour is

```php
        $response = new Response();
        $response->setSharedMaxAge(10);
        sleep(20);
        $this->assertTrue($response->isFresh());
        sleep(5);
        $this->assertTrue($response->isFresh());
        sleep(5);
        $this->assertFalse($response->isFresh());
```

A particular weird case is the `isCacheable()` method, because it calls `isFresh()` only under certain conditions, like particular status codes, no `ETag` present etc. This symptom is also described under "Cause of the problem" in #19390, however the problem is worked around there in other ways.

So, this PR suggests to effectively revert #14912.

Additionally, I'd like to suggest to move this special handling of the `Date` header into the `ResponseHeaderBag`. If the `ResponseHeaderBag` guards that we always have the `Date`, we would not need special logic in `sendHeaders()` and could also take care of https://github.com/symfony/symfony/pull/14912#issuecomment-110105215.

Commits
-------

3a7fa7ede2 Set Date header in Response constructor already
2017-03-22 14:18:49 -07:00
Matthias Pigulla
3a7fa7ede2 Set Date header in Response constructor already 2017-03-22 14:18:47 -07:00
Fabien Potencier
0a17358abf feature #19887 Sort alternatives alphabetically when a command is not found (javiereguiluz)
This PR was squashed before being merged into the 3.3-dev branch (closes #19887).

Discussion
----------

Sort alternatives alphabetically when a command is not found

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

Commits
-------

ba6c9464ea Sort commands like a human would do
f04b1bd72f Sort alternatives alphabetically when a command is not found
2017-03-22 14:10:51 -07:00
Roland Franssen
0728fb91b8 typo 2017-03-22 22:08:21 +01:00
Roland Franssen
036b0414d6 Minor PR fixes 2017-03-22 22:04:16 +01:00
Fabien Potencier
59dd7521a7 feature #20851 [Cache] Add CacheItem::getPreviousTags() (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Cache] Add CacheItem::getPreviousTags()

| 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 #19728

Commits
-------

da354660e0 [Cache] Add CacheItem::getPreviousTags()
2017-03-22 14:02:20 -07:00
Roland Franssen
171c6d100e [WebProfilerBundle] Improved cookie traffic 2017-03-22 21:55:42 +01:00
Robin Chalas
0b741da343 Move AddValidatorInitializersrPass & AddConstraintValidatorsPass to the Validator 2017-03-22 21:51:09 +01:00
Fabien Potencier
9761b44aa4 bug #22034 [Security] json auth listener should not produce a 500 response on bad request format (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security] json auth listener should not produce a 500 response on bad request format

| 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

To me, it looks wrong to simply throw a `BadCredentialsException` in the wild, which produces a 500 (unless an entrypoint handles it, which you probably don't have on a json login firewall). There isn't any server error, the client request originated the error due to a wrong format.

Instead, the listener should give a chance to the failure handler to resolve it, and return a proper 4XX response. (BTW, the `UsernamePasswordFormAuthenticationListener` also throws a similar `BadCredentialsException` on a too long submitted username, which is caught and forwarded to the failure handler)

Better diff: https://github.com/symfony/symfony/pull/22034/files?w=1

BTW, should we have another exception type like `BadCredentialsFormatException` or whatever in order to distinct a proper `BadCredentialsException` from a format issue in a failure listener?

Commits
-------

cb175a41c3 [Security] json auth listener should not produce a 500 response on bad request format
2017-03-22 13:49:06 -07:00
Nikolay Labinskiy
3599c476bf [Validator] fix URL validator to detect non supported chars according to RFC 3986 2017-03-22 13:42:34 -07:00
Fabien Potencier
f29664893d Merge branch '2.8' into 3.2
* 2.8:
  Fixed pathinfo calculation for requests starting with a question mark.
  [Security] simplify the SwitchUserListenerTest
2017-03-22 13:39:24 -07:00
Fabien Potencier
89bb89538b Merge branch '2.7' into 2.8
* 2.7:
  Fixed pathinfo calculation for requests starting with a question mark.
  [Security] simplify the SwitchUserListenerTest
2017-03-22 13:39:14 -07:00
Fabien Potencier
2240ecfa14 minor #22049 [Security] simplify the SwitchUserListenerTest (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] simplify the SwitchUserListenerTest

| 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        |

While working on #22048 I noticed that the `SwitchUserListenerTest` was more complicated than necessary by mocking a lot of stuff that didn't need to be mocked.

Commits
-------

923bbdbf9f [Security] simplify the SwitchUserListenerTest
2017-03-22 13:38:16 -07:00
Fabien Potencier
4599afef86 minor #20885 [Console] Option to disable stty (johmue)
This PR was squashed before being merged into the 3.3-dev branch (closes #20885).

Discussion
----------

[Console] Option to disable stty

| Q             | A
| ------------- | ---
| Branch?       |
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   |
| Fixed tickets |
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

Shall fix problems in Windows based environments if e.g. git is installed and stty is therefore found but writes only cryptic rubbish into the cmd. In the case of console questions it is also possible that input can't be read properly by console component.

Commits
-------

a189a6c52e [Console] Option to disable stty
2017-03-22 13:36:10 -07:00
Johannes Mueller
a189a6c52e [Console] Option to disable stty 2017-03-22 13:36:08 -07:00
Nicolas Grekas
9c6e672780 [FrameworkBundle] Add new "controller.service_arguments" tag to inject services into actions 2017-03-22 21:34:42 +01:00
Fabien Potencier
04fcac74b1 Merge branch '2.8' into 3.2
* 2.8:
  [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header
  [Validator] Add object handling of invalid constraints in Composite
  [WebProfilerBundle] Remove uneeded directive in the form collector styles
  Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
  [HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST
2017-03-22 13:31:03 -07:00
Nicolas Grekas
d3c960493c [HttpFoundation] Add $trustedHeaderSet arg to Request::setTrustedProxies() - deprecate not setting it 2017-03-22 21:29:40 +01:00
Fabien Potencier
8371dea4e2 bug #21849 [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header

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

We're missing handling of for/host/proto info embedded in the `Forwarded` header, as eg in:
`Forwarded:  for=1.1.1.1:443, host=foo.example.com:1234, proto=https, for=2.2.2.2, host=real.example.com:8080`

Commits
-------

04caacb757 [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header
2017-03-22 13:28:23 -07:00
Fabien Potencier
e8653b9964 bug #21968 Fixed pathinfo calculation for requests starting with a question mark. (syzygymsu)
This PR was squashed before being merged into the 2.7 branch (closes #21968).

Discussion
----------

Fixed pathinfo calculation for requests starting with a question mark.

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

With  improper `strpos` result check calculated pathinfo for requests starting with '?' equals to request itself.
Correct pathinfo for those requests should be '/'.

Commits
-------

43297b45de Fixed pathinfo calculation for requests starting with a question mark.
2017-03-22 13:27:23 -07:00
Anton A. Sumin
43297b45de Fixed pathinfo calculation for requests starting with a question mark. 2017-03-22 13:27:21 -07:00
Fabien Potencier
3023e4b707 feature #21924 [FrameworkBundle] Allow to configure Serializer mapping paths (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Allow to configure Serializer mapping paths

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

Follows https://github.com/symfony/symfony/pull/19086 for the Serializer

Commits
-------

5446903296 [FrameworkBundle] Allow configuring serializer mapping paths
2017-03-22 13:19:32 -07:00
Nicolas Grekas
04caacb757 [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header 2017-03-22 21:13:53 +01:00
Fabien Potencier
5f9d941365 bug #22027 Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)" (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21953, https://github.com/symfony/symfony/issues/22050
| License       | MIT
| Doc PR        | n/a

A bit frustrated to revert this change since the BC break report lacks of information, making us unable to reproduce nor to look at improving the situation.
I'm going to re-propose this on master, covering the BC break that is identified, fixed and tested using the changes made in #21953. That will let the choice for the reporter to upgrade using the 1 required LOC.

Commits
-------

5af47c40dc Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
2017-03-22 13:13:18 -07:00
Fabien Potencier
5dcef29531 feature #19278 [FrameworkBundle] Added about command (ro0NL)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Added about command

| Q | A |
| --- | --- |
| Branch? | "master" |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any |
| License | MIT |
| Doc PR | reference to the documentation PR, if any |

![image](https://cloud.githubusercontent.com/assets/1047696/24218101/50c4ebe2-0f42-11e7-985d-b47fc8a6f520.png)

Commits
-------

2550eab43c [FrameworkBundle] Added about command
2017-03-22 13:07:01 -07:00
Fabien Potencier
e1ab80159a Merge branch '2.7' into 2.8
* 2.7:
  [Validator] Add object handling of invalid constraints in Composite
  [HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST
2017-03-22 13:02:32 -07:00
Fabien Potencier
d562cacf44 bug #21846 [HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST

| 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        | -

The first "host" in the list provided by `X_FORWARDED_HOST` should be the one, not the last.
Already the case for "port" and "scheme".

Commits
-------

9a2b2de64f [HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST
2017-03-22 13:01:02 -07:00
Roland Franssen
2550eab43c [FrameworkBundle] Added about command 2017-03-22 20:57:40 +01:00
Fabien Potencier
940c29abec minor #21926 [Routing] Optimised dumped matcher (frankdejonge)
This PR was squashed before being merged into the 3.3-dev branch (closes #21926).

Discussion
----------

[Routing] Optimised dumped matcher

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

TL;DR: I've optimised the PhpMatcherDumper output for a <del>60x</del> 4.4x performance improvement on a collection of ~800 routes by inducing cyclomatic complexity.

[EDIT] The 60x performance boost was only visible when profiling with blackfire, which is quite possibly a result of the cost of profiling playing a part. After doing some more profiling the realistic benefit of the optimisation is more likely to be in the ranges is 1.3x to 4.4x.

After the previous optimisation I began looking at how the PrefixCollection was adding its performance boost. I spotted another way to do this, which has the same theory behind it (excluding groups based on prefixes). The current implementation only groups when one prefix resides in the other. In this new implementation I've created a way to detect common prefixes, which allows for much more efficient grouping. Every time a route is added to the group it'll either merge into an existing group, merge into a new group with a route that has a common prefix, or merge into a new group with an existing group that has a common prefix.

However, when a parameter is present grouping must only be done AFTER that route, this case is accounted for. In all other cases, where there's no collision routes can be grouped freely because if a group was matched other groups wouldn't have matched.

After all the groups are created the groups are optimised. Groups with fewer than 3 children are inlined into the parent group. This is because a group with 2 children would potentially result in 3 prefix checks while if they are inlines it's 2 checks.

Like with the previous optimisation I've profiled this using blackfire. But the match function didn't show up anymore. I've added `usleep` calls in the dumped matcher during profiling, which made it show up again. I've verified with @simensen that this is because the wall time of the function was too small for it to be of any interest. When it DID get detected, because of more tasks running, it would show up with around 250 nanoseconds. In comparison, the previous speed improvement brought the wall time down from 7ms to ~2.5ms on a set of ~800 routes.

Because of the altered grouping behaviour I've not modified the PrefixCollection but I've created a new StaticPrefixCollection and updated the PhpMatcherDumper to use that instead.

Commits
-------

449b6912dc [Routing] Optimised dumped matcher
2017-03-22 12:45:31 -07:00
Frank de Jonge
449b6912dc [Routing] Optimised dumped matcher 2017-03-22 12:45:25 -07:00
Nicolas Grekas
c5e80a2b09 implement ServiceSubscriberInterface where applicable 2017-03-22 20:26:10 +01:00
Nicolas Grekas
9b7df39865 [DI] Add and wire ServiceSubscriberInterface 2017-03-22 20:26:09 +01:00
Fabien Potencier
fa36ce8858 minor #22067 [Yaml] ParseException: pcre.backtrack_limit reached (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] ParseException: pcre.backtrack_limit reached

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

while merging 3.2 into master, I noticed that `testCanParseVeryLongValue` is triggering this error on master, due to this regexp that we added for handling yaml tags. This regexp needs to be fixed so that we can merge the test case.

ping @GuilhemN

Commits
-------

f0256f1aa5 [Yaml] Fix pcre.backtrack_limit reached
2017-03-22 12:08:11 -07:00
Fabien Potencier
065bf489fa feature #22011 [FrameworkBundle][Serializer] Add option to register a circular_reference_handler (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Serializer] Add option to register a circular_reference_handler

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

---

Right now, it's quite hard (especially for new comers) to register a CircularReferenceHandler:

![screenshot1](https://cloud.githubusercontent.com/assets/408368/23959193/ce19bcec-09a4-11e7-82c7-80abd7b7f602.png)

---

This PR introduce an option to wire a service to the internal Object Normalizer.

Commits
-------

0a638f5352 [FrameworkBundle][Serializer] Add option to register a "circular_reference_handler"
2017-03-22 12:06:37 -07:00
Claudio Zizza
4bd2c22871 [Validator] Add object handling of invalid constraints in Composite 2017-03-22 12:05:13 -07:00
Fabien Potencier
7b6006488e feature #19673 [DI] Deprecate Container::isFrozen and introduce isCompiled (ro0NL)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Deprecate Container::isFrozen and introduce isCompiled

| Q | A |
| --- | --- |
| Branch? | "master" |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | yes |
| Tests pass? | yes |
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any |
| License | MIT |
| Doc PR | reference to the documentation PR, if any |

This deprecates the concept of freezing a container, implied by `Container::isFrozen`. However, freezing happens due compilation (`Container::compile`). So having just `isCompiled` instead seems more intuitive, and plays along well with `ContainerBuilder`.

Before/After;
- `Container::isFrozen`
  - Checks if the parameter bag is frozen, but is deprecated in 3.2
  - In 4.0 this methods does not exists and can be replaced with `getParameterBag() instanceof FrozenParameterBag` _or_ `isCompiled()`. Depending on what you want (to clarify; the behavior is different when passing a frozen bag to the constructor)
- `Container::isCompiled`
  - Truly checks if `compile()` has ran, and is a new feature
- `ContainerBuilder::merge` etc.
  - Now uses `isCompiled` instead of `isFrozen`, ie. we allow for it till compilation regarding the state of the paramater bag

Commits
-------

6abd312800 [DI] Deprecate Container::isFrozen and introduce isCompiled
2017-03-22 12:01:37 -07:00
Roland Franssen
6abd312800 [DI] Deprecate Container::isFrozen and introduce isCompiled 2017-03-22 19:49:34 +01:00
Fabien Potencier
c97407ee17 feature #19954 [Console] Exclude empty namespaces in text descriptor (ro0NL)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Exclude empty namespaces in text descriptor

| Q | A |
| --- | --- |
| Branch? | "master" |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any |
| License | MIT |
| Doc PR | reference to the documentation PR, if any |

Before:

```
$ bin/console

 doctrine
  doctrine:mapping:convert                [orm:convert:mapping] Convert mapping information between supported formats.
 orm <----
 router
  router:match                            Helps debug routes by simulating a path info match

$ bin/console list orm

  [Symfony\Component\Debug\Exception\ContextErrorException]
  Warning: max(): Array must contain at least one element

$ bin/console list generate

Available commands for the "generate" namespace:
  generate:bundle      Generates a bundle
  generate:command     Generates a console command
  generate:controller  Generates a controller
```

After:

```
$ bin/console

 doctrine
  doctrine:mapping:convert                [orm:convert:mapping] Convert mapping information between supported formats.
 router
  router:match                            Helps debug routes by simulating a path info match

$ bin/console list orm

Available commands for the "orm" namespace:
  orm:convert:mapping  Convert mapping information between supported formats.

$ bin/console list generate

Available commands for the "generate" namespace:
  generate:bundle             Generates a bundle
  generate:command            Generates a console command
  generate:controller         Generates a controller
  generate:doctrine:crud      Generates a CRUD based on a Doctrine entity
  generate:doctrine:entities  Generates entity classes and method stubs from your mapping information
  generate:doctrine:entity    Generates a new Doctrine entity inside a bundle
  generate:doctrine:form      Generates a form type class based on a Doctrine entity
```

Overrules #19776 but also includes other fixes related to aliases that popped up when writing tests 👍

Commits
-------

d5a7608036 [Console] Exclude empty namespaces in text descriptor
2017-03-22 11:48:53 -07:00
Fabien Potencier
858af7158f feature #21093 [Lock] Create a lock component (jderusse)
This PR was squashed before being merged into the 3.3-dev branch (closes #21093).

Discussion
----------

[Lock] Create a lock component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | they will
| Fixed tickets | #20382
| License       | MIT
| Doc PR        | symfony/symfony-docs#7364

This PR aim to add a new component Lock going further than the FileSystem\LockHandler by allowing remote backend (like Redis, memcache, etc)
Inspired by

## Usage

The simplest way to use lock is to inject an instance of a Lock in your service
```php
class MyService
{
    private $lock;

    public function __construct(LockInterface $lock)
    {
        $this->lock = $lock;
    }

    public function run()
    {
        $this->lock->acquire(true);

        // If I'm here, no exception had been raised. Lock is acquired
        try {
            // do my job
        } finally {
            $this->lock->release();
        }
    }
}
```
Configured with something like
```yaml
services:
    app.my_service:
        class: AppBundle\MyService
        arguments:
            - app.lock.my_service
    app.lock.my_service:
        class: Symfony\Component\Lock\Lock
        factory: ['@locker', createLock]
        arguments: ['my_service']
```

If you need to lock serveral resource on runtime, wou'll nneed to inject the LockFactory.
```php
class MyService
{
    private $lockFactory;

    public function __construct(LockFactoryInterface $lockFactory)
    {
        $this->lockFactory = $lockFactory;
    }

    public function run()
    {
        foreach ($this->items as $item) {
            $lock = $this->lockFactory->createLock((string) $item);

            try {
                $lock->acquire();
            } catch (LockConflictedException $e) {
                continue;
            }

            // When I'm here, no exception had been, raised. Lock is acquired
            try {
                // do my job
            } finally {
                $lock->release();
            }
        }
    }
}
```
Configured with something like
```yaml
services:
    app.my_service:
        class: AppBundle\MyService
        arguments:
            - '@locker'
```

This component allow you to refresh an expirable lock.
This is usefull, if you run a long operation split in several small parts.
If you lock with a ttl for the overall operatoin time and your process crash, the lock will block everybody for the defined TTL.
But thank to the refresh method, you're able to lock for a small TTL, and refresh it between each parts.
```php
class MyService
{
    private $lock;

    public function __construct(LockInterface $lock)
    {
        $this->lock = $lock;
    }

    public function run()
    {
        $this->lock->acquire(true);

        try {
            do {
                $finished = $this->performLongTask();

                // Increase the expire date by 300 more seconds
                $this->lock->refresh();
            } while (!$finished)
            // do my job
        } finally {
            $this->lock->release();
        }
    }
}
```

## Naming anc implementation choise

```
$lock->acquire()
vs
$lock->lock()
```

Choose to use acquire, because this component is full of `lock` Symfony\Component\Lock\Lock::Lock` raised a E_TOO_MANY_LOCK in my head.

```
$lock->acquire(false);
$lock->acquire(true);
vs
$lock->aquire()
$lock->waitAndAquire()
```

Not a big fan of flag feature and 2. But I choose to use the blocking flag to offer a simple (and common usecase) implementation

```
$lock = $factory->createLock($key);
$lock->acquire();
vs
$lock->aquire($key)
```

I choose to a the pool of locks implementation. It allow the user to create 2 instances and use cross lock even in the same process.

```
interface LockInterface
final class Lock implements LockInterface
vs
final class Lock
```

I choose to use a Interface even if there is only one implementaiton to offer an extension point here

# TODO

## In this PR
* [x] tests
* [x] add logs
* [x] offer several redis connectors
* [x] try other store implementation to validate the architecture/interface

## In other PR
* documentation
* add configuration in framework bundle
* add stop watch in the debug bar
* improve the combined store (takes the drift into account and elapsed time between each store)
* implement other stores (memcache, ...)
* use this component in session manipulation (fixes #4976)

Commits
-------

018e0fc330 [Lock] Create a lock component
2017-03-22 11:45:21 -07:00
Jérémy Derussé
018e0fc330 [Lock] Create a lock component 2017-03-22 11:45:19 -07:00
Roland Franssen
d5a7608036 [Console] Exclude empty namespaces in text descriptor 2017-03-22 19:41:00 +01:00
Fabien Potencier
6327b4161d feature #21007 [WebProfilerBundle] Improve AJAX toolbar panel (ro0NL)
This PR was squashed before being merged into the 3.3-dev branch (closes #21007).

Discussion
----------

[WebProfilerBundle] Improve AJAX toolbar panel

| Q             | A
| ------------- | ---
| Branch?       | master
| 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        | symfony/symfony-docs#... <!--highly recommended for new features-->

Before

![image](https://cloud.githubusercontent.com/assets/1047696/21394974/072b3570-c79b-11e6-8104-23e9be365b0b.png)

![image](https://cloud.githubusercontent.com/assets/1047696/21383263/1dc484fc-c765-11e6-84e8-7133d67da324.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/21394997/1a508cb8-c79b-11e6-87de-962ac41c9022.png)

![image](https://cloud.githubusercontent.com/assets/1047696/21383308/53b4f196-c765-11e6-8993-2645f342c7e9.png)

Commits
-------

afbcaa7a32 [WebProfilerBundle] Improve AJAX toolbar panel
2017-03-22 11:29:13 -07:00
Roland Franssen
afbcaa7a32 [WebProfilerBundle] Improve AJAX toolbar panel 2017-03-22 11:28:54 -07:00
Fabien Potencier
d378947321 feature #20642 [FrameworkBundle] Add project directory default for installing assets (Noah Heck)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Add project directory default for installing assets

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

This allows the `assets:install` console command to have a fallback default of the project root directory.

Current behavior is to install assets only in the `target` of the current working directory.

Commits
-------

7a11f3ecf3 [FrameworkBundle] Add project directory default for installing assets
2017-03-22 11:06:20 -07:00
Fabien Potencier
1cb9afde12 feature #20365 [TwigBridge] Handle form label attributes like others (ro0NL)
This PR was squashed before being merged into the 3.3-dev branch (closes #20365).

Discussion
----------

[TwigBridge] Handle form label attributes like others

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

The HTML for rendering attributes is duplicated in multiple blocks, making it error prone/hard to maintain.

Next, the label attributes followed a different approach. Imo. all should follow the same base rendering, showing the above is actually an issue.

Commits
-------

e317e0aeab [TwigBridge] Handle form label attributes like others
2017-03-22 10:41:18 -07:00
Roland Franssen
e317e0aeab [TwigBridge] Handle form label attributes like others 2017-03-22 10:41:14 -07:00
Fabien Potencier
a4a41662a6 feature #22010 [FrameworkBundle][Translator] Make the Translator works with any PSR-11 container (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Translator] Make the Translator works with any PSR-11 container

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

Uses a service-locator for collected translation loaders and replace the single call of `getParameter()` by an optional constructor argument.

Commits
-------

85177a649e [FrameworkBundle] Make Translator works with any PSR-11 container
2017-03-22 09:31:28 -07:00
Robin Chalas
85177a649e [FrameworkBundle] Make Translator works with any PSR-11 container 2017-03-22 16:47:35 +01:00
Fabien Potencier
7c308be5de bug #22070 [PhpUnitBridge] add errors as late as possible (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[PhpUnitBridge] add errors as late as possible

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

PHPUnit may change the test's state after the listener's startTest()
method has been executed thus leading to broken test result output.

Commits
-------

167742e521 add errors as late as possible
2017-03-22 08:44:06 -07:00
Robin Chalas
5446903296 [FrameworkBundle] Allow configuring serializer mapping paths 2017-03-22 16:36:42 +01:00
Romain
40a67c9e60 [WebProfilerBundle] Remove uneeded directive in the form collector styles 2017-03-22 07:05:52 -07:00
Robin Chalas
de6799cb17 Fix ConsoleLoggerTest 2017-03-22 13:19:17 +01:00
Robin Chalas
71cec8203f [Yaml] Fix error handling in parser 2017-03-22 11:47:48 +01:00
Nicolas Grekas
f0256f1aa5 [Yaml] Fix pcre.backtrack_limit reached 2017-03-22 09:30:29 +01:00
Fabien Potencier
7d76227e06 removed usage of $that 2017-03-21 15:48:52 -07:00
Fabien Potencier
664740698e Merge branch '2.8' into 3.2
* 2.8:
  HttpCache: New test for revalidating responses with an expired TTL
  [Serializer] [XML] Ignore Process Instruction
2017-03-21 15:47:50 -07:00
Fabien Potencier
3b1143c47c Merge branch '2.7' into 2.8
* 2.7:
  HttpCache: New test for revalidating responses with an expired TTL
  [Serializer] [XML] Ignore Process Instruction
2017-03-21 15:47:17 -07:00
Fabien Potencier
f9b64a206b minor #22099 HttpCache: New test for revalidating responses with an expired TTL (mpdude)
This PR was squashed before being merged into the 2.7 branch (closes #22099).

Discussion
----------

HttpCache: New test for revalidating responses with an expired TTL

| 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        |

See #22035, in particular [this and the following comments](https://github.com/symfony/symfony/pull/22035#issuecomment-287572234).

Commits
-------

067ab52ba0 HttpCache: New test for revalidating responses with an expired TTL
2017-03-21 15:46:55 -07:00
Matthias Pigulla
067ab52ba0 HttpCache: New test for revalidating responses with an expired TTL 2017-03-21 15:46:50 -07:00
Fabien Potencier
bca4778ef1 bug #22044 [Serializer] [XML] Ignore Process Instruction (jordscream)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] [XML] Ignore Process Instruction

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

This Pull request ignores Process instruction data in XML for decoding the data.

Commits
-------

0c741f5704 [Serializer] [XML] Ignore Process Instruction
2017-03-21 15:20:34 -07:00
Fabien Potencier
7ed3237645 [FrameworkBundle] deprecated cache:clear with warmup 2017-03-21 15:16:20 -07:00
Jordan Samouh
0c741f5704 [Serializer] [XML] Ignore Process Instruction 2017-03-21 23:11:30 +01:00
Fabien Potencier
7f7b897ee2 feature #22098 [*Bundle] Add autowiring aliases for common services (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[*Bundle] Add autowiring aliases for common services

| 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 spotted while working on #22060, we're missing many aliases to prevent any autowiring ambiguities.
I also removed the "Symfony\Component\EventDispatcher\EventDispatcher" and "Symfony\Component\DependencyInjection\Container" aliases: we'd better encourage using the corresponding interfaces instead.
On ControllerTrait, we need to type hint against SessionInterface, because otherwise, when session support is disabled, autowiring still auto-registers an "autowired.Session" service, which defeats the purpose of being able to enable/disable it.

Commits
-------

08c2ee32f1 [*Bundle] Add autowiring aliases for common services
2017-03-21 14:56:35 -07:00
Fabien Potencier
b0482963f1 Merge branch '3.2'
* 3.2:
  Fixes a typo in the form collector styles
  [WebProfilerBundle] Fix content-security-policy compatibility
  [WebProfilerBundle] Drop dead code
  [HttpKernel] Fixed bug with purging of HTTPS URLs
  fix some risky tests
  [DI] [YamlFileLoader] change error message of a non existing file
  [WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly
  [Security] Added option to return true in the method isRememberMeRequested
2017-03-21 14:44:47 -07:00
Fabien Potencier
8cd835e658 Merge branch '2.8' into 3.2
* 2.8:
  Fixes a typo in the form collector styles
  [HttpKernel] Fixed bug with purging of HTTPS URLs
  fix some risky tests
  [DI] [YamlFileLoader] change error message of a non existing file
  [Security] Added option to return true in the method isRememberMeRequested
2017-03-21 14:44:32 -07:00
Fabien Potencier
295a8e0a82 Merge branch '2.7' into 2.8
* 2.7:
  [HttpKernel] Fixed bug with purging of HTTPS URLs
  fix some risky tests
  [DI] [YamlFileLoader] change error message of a non existing file
  [Security] Added option to return true in the method isRememberMeRequested
2017-03-21 14:39:01 -07:00
Fabien Potencier
65260bc346 minor #22066 fix some risky tests (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

fix some risky 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        |

PHPUnit 6 marks tests as risky when they have no assertions (and are not marked as skipped or incomplete). This PR will update our test suite accordingly.

Component that still need to be covered:

- [ ] Config
- [ ] Form
- [ ] HttpFoundation
- [ ] Security
- [ ] Workflow

Commits
-------

abf1787dcc fix some risky tests
2017-03-21 14:36:30 -07:00
Nicolas Grekas
08c2ee32f1 [*Bundle] Add autowiring aliases for common services 2017-03-21 22:34:27 +01:00
Fabien Potencier
4c0006a1dd feature #22095 [DI] Add logging and better failure recovery to AutowirePass (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Add logging and better failure recovery to AutowirePass

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

So useful to understand what autowiring is doing.

Commits
-------

3e297ba3e4 [DI] Add logging and better failure recovery to AutowirePass
2017-03-21 14:28:17 -07:00
Romain Pierre
b3f341fd90 Fixes a typo in the form collector styles 2017-03-21 14:21:32 -07:00
Romain Pierre
6e13a58e16 Fixes a typo in the form collector styles 2017-03-21 22:03:13 +01:00
Nicolas Grekas
3e297ba3e4 [DI] Add logging and better failure recovery to AutowirePass 2017-03-21 19:30:57 +01:00
Fabien Potencier
a96a99723a feature #21889 Deprecate the special SYMFONY__ environment variables (javiereguiluz)
This PR was squashed before being merged into the 3.3-dev branch (closes #21889).

Discussion
----------

Deprecate the special SYMFONY__ environment variables

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

Commits
-------

e3362e854c Deprecate the special SYMFONY__ environment variables
2017-03-21 08:27:08 -07:00
Javier Eguiluz
e3362e854c Deprecate the special SYMFONY__ environment variables 2017-03-21 08:27:06 -07:00
Fabien Potencier
7f89ad41d7 minor #22094 [FrameworkBundle] Document removal of server:* commands (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Document removal of server:* commands

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

To ease upgrading.

We could also add something like that in the framework application:
```php
public function findNamespace($namespace)
{
    try {
        return parent::findNamespace($namespace);
    } catch (CommandNotFoundException $e) {
        if ('server' === $namespace) {
            throw new CommandNotFoundException('The "server:start", "server:stop", "server:status" and "server:run" commands have been moved...');
        }
    }
}
```
But AFAIK we never did so in the past, tell me if we should.

Commits
-------

c99641a540 Document removal of server:* commands from the framework
2017-03-21 07:59:18 -07:00
Robin Chalas
c99641a540 Document removal of server:* commands from the framework 2017-03-21 15:47:31 +01:00
Fabien Potencier
8ba279bc22 minor #22015 [Security] Added option to return true in the method isRememberMeRequested (WhiteEagle88)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Added option to return true in the method isRememberMeRequested

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

Replaces #21989

Commits
-------

522ec3ef0c [Security] Added option to return true in the method isRememberMeRequested
2017-03-21 07:31:45 -07:00
Fabien Potencier
c797fc4462 minor #22087 Fix some invalid phpdoc in the Dotenv class (stof)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fix some invalid phpdoc in the Dotenv class

| 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
-------

14525b73b8 Fix some invalid phpdoc in the Dotenv class
2017-03-21 07:24:05 -07:00
Fabien Potencier
749451ed59 minor #22086 Release memory for the parsed data after parsing (stof)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Release memory for the parsed data after parsing

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

If the Dotenv instance outlives the parsing of the file (which is the case easily in the usage described in the documentation as it is used in the global scope and so the variable does not go out of scope until the end of the process), there is no reason to keep the parsed data in memory after the end of the parsing.

I have not reset the integer properties, as this would not save any memory anyway (integers are inline inside the ZVAL anyway)

Commits
-------

518f618d33 Release memory for the parsed data after parsing
2017-03-21 07:21:25 -07:00
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
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
b3f494f5da [DI] Restore skipping logic when autowiring getters 2017-03-21 09:09:26 +01:00
Martin Auswöger
f50915066f [HttpKernel] Fixed bug with purging of HTTPS URLs 2017-03-20 17:24:37 -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