Commit Graph

31259 Commits

Author SHA1 Message Date
Nicolas Grekas e5a698e215 Merge branch '3.2' into 3.3
* 3.2:
  typo
  [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null)
  Use namespaced Twig
2017-06-02 10:55:39 +02:00
Nicolas Grekas 59751226e2 Merge branch '2.8' into 3.2
* 2.8:
  typo
2017-06-02 10:29:21 +02:00
Nicolas Grekas 99e0836fd4 typo 2017-06-02 10:28:06 +02:00
Nicolas Grekas a6b525e136 Merge branch '2.8' into 3.2
* 2.8:
  [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null)
  Use namespaced Twig
2017-06-02 10:26:05 +02:00
Nicolas Grekas 434c8334ed Merge branch '2.7' into 2.8
* 2.7:
  [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null)
  Use namespaced Twig
2017-06-02 09:47:27 +02:00
Nicolas Grekas 36f00509bc minor #22962 Use namespaced Twig (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Use namespaced Twig

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | needs https://github.com/twigphp/Twig/pull/2490 and https://github.com/twigphp/Twig/pull/2491
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

c3d1262 Use namespaced Twig
2017-06-02 09:20:11 +02:00
Fabien Potencier 32f65347f2 bug #23024 [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null) (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null)

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

Commits
-------

e7c4149e78 [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null)
2017-06-01 15:38:21 -07:00
Nicolas Grekas e7c4149e78 [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null) 2017-06-01 23:49:12 +02:00
Nicolas Grekas c3d1262208 Use namespaced Twig 2017-06-01 23:44:38 +02:00
Fabien Potencier 60b89bb67f Merge branch '3.2' into 3.3
* 3.2:
  Using FQ name for PHP_VERSION_ID
  [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
  Harden the debugging of Twig filters and functions
  bumped Symfony version to 3.2.10
  updated VERSION for 3.2.9
  updated CHANGELOG for 3.2.9
  bumped Symfony version to 2.8.22
  updated VERSION for 2.8.21
  updated CHANGELOG for 2.8.21
  bumped Symfony version to 2.7.29
  updated VERSION for 2.7.28
  update CONTRIBUTORS for 2.7.28
  updated CHANGELOG for 2.7.28
2017-06-01 14:01:25 -07:00
Fabien Potencier 2c57bf20ad Merge branch '2.8' into 3.2
* 2.8:
  Using FQ name for PHP_VERSION_ID
  [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
  Harden the debugging of Twig filters and functions
  bumped Symfony version to 2.8.22
  updated VERSION for 2.8.21
  updated CHANGELOG for 2.8.21
  bumped Symfony version to 2.7.29
  updated VERSION for 2.7.28
  update CONTRIBUTORS for 2.7.28
  updated CHANGELOG for 2.7.28
2017-06-01 14:00:24 -07:00
Fabien Potencier bd62b148db Merge branch '2.7' into 2.8
* 2.7:
  Using FQ name for PHP_VERSION_ID
  [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
  Harden the debugging of Twig filters and functions
  bumped Symfony version to 2.7.29
  updated VERSION for 2.7.28
  update CONTRIBUTORS for 2.7.28
  updated CHANGELOG for 2.7.28
2017-06-01 13:52:29 -07:00
Fabien Potencier 78c4a5ff43 minor #23021 Using FQ name for PHP_VERSION_ID (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

Using FQ name for PHP_VERSION_ID

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

Commits
-------

f91a020b84 Using FQ name for PHP_VERSION_ID
2017-06-01 13:48:21 -07:00
Fabien Potencier 3fc1189910 bug #23008 [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument

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

If we decide to go this way, we might drop ClosureProxyArgument entirely because we won't need it internally. I'll propose it in another PR for discussion if this one is accepted.

This PR allows "high-order" listeners, as `array(Closure, method)`. Closure is called to get the actual instance when needed only.

How does it look to you? (I'll add tests once confirmed)

Commits
-------

c17a009d66 [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument
2017-06-01 13:46:45 -07:00
Fabien Potencier f91a020b84 Using FQ name for PHP_VERSION_ID 2017-06-01 13:44:56 -07:00
Nicolas Grekas c17a009d66 [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument 2017-06-01 20:27:22 +02:00
Fabien Potencier 156a50d124 bug #23018 [FrameworkBundle] Fix CacheCollectorPass priority (chalasr)
This PR was merged into the 3.3 branch.

Discussion
----------

[FrameworkBundle] Fix CacheCollectorPass priority

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

It was run before optimization, so child definitions were not resolved yet.

Commits
-------

28b253ab40 Fix CacheCollectorPass priority
2017-06-01 10:43:34 -07:00
Fabien Potencier f32ec458be bug #23009 [Routing] Allow GET requests to be redirected. Fixes #23004 (frankdejonge)
This PR was merged into the 3.3 branch.

Discussion
----------

[Routing] Allow GET requests to be redirected. Fixes #23004

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

GET requests didn't get the same redirect treatment as HEAD requests. I've also added tests cases for all the different trailing/non-trailing slash situations.

Commits
-------

71d4e366a9 [Routing] Allow GET requests to be redirected. Fixes #23004
2017-06-01 10:33:26 -07:00
Robin Chalas 28b253ab40 Fix CacheCollectorPass priority 2017-06-01 19:06:24 +02:00
Nicolas Grekas 36bd06a152 bug #22996 [2.7][Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 (romainneutron)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323

| 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 | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

The issue is documented here.
The current symfony code works when `intl.use_exception` is off. however, it's on on PHP 7+ and the issue is reproducible. See https://3v4l.org/PllP1 and https://3v4l.org/3XnKI

Commits
-------

f42c73f [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
2017-06-01 14:45:44 +02:00
Nicolas Grekas 744a4eb491 minor #23005 [DI] Deal with inlined non-shared services (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[DI] Deal with inlined non-shared services

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | no (fixing a non released bug fix)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

A non-shared service can be inlined several times.

Commits
-------

996698d [DI] Deal with inlined non-shared services
2017-06-01 12:46:51 +02:00
Romain Neutron f42c73f213
[Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 2017-06-01 11:48:44 +02:00
Frank de Jonge 71d4e366a9 [Routing] Allow GET requests to be redirected. Fixes #23004 2017-06-01 11:46:06 +02:00
Nicolas Grekas 996698d996 [DI] Deal with inlined non-shared services 2017-06-01 08:31:18 +02:00
Fabien Potencier 7a9875c3cd bug #22965 [Cache] Ignore missing annotations.php (ro0NL)
This PR was squashed before being merged into the 3.3 branch (closes #22965).

Discussion
----------

[Cache] Ignore missing annotations.php

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes (different in 3.2)
| 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-->

Avoids the following notices if cache is not warmed up (i.e. `cache:clear --no-warmup` > hit the browser).

```
Warning: include(<base-path>/app/cache/<env>/annotations.php): failed to open stream: No such file or directory

Warning: include(): Failed opening '<base-path>/app/cache/<env>/annotations.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php')
```

Commits
-------

e8f70c75b9 [Cache] Ignore missing annotations.php
2017-05-31 11:18:45 -07:00
Roland Franssen e8f70c75b9 [Cache] Ignore missing annotations.php 2017-05-31 11:18:44 -07:00
Fabien Potencier 9cd68ee77e bug #22993 [DI] Autowiring exception thrown when inlined service is removed (weaverryan)
This PR was squashed before being merged into the 3.3 branch (closes #22993).

Discussion
----------

[DI] Autowiring exception thrown when inlined service is removed

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | yes (on a new & internal method)
| Tests pass?   | yes
| Fixed tickets | #22977
| License       | MIT
| Doc PR        | n/a

We suppress autowiring exceptions if a service is ultimately removed from the container. This fixes a bug where we incorrectly report that a service was NOT removed, when really, it WAS removed. This happens when `ServiceA` is inlined in `ServiceB`... but then `ServiceB` is removed from the container for being unused.

Commits
-------

793b9a001f [DI] Autowiring exception thrown when inlined service is removed
2017-05-31 11:16:22 -07:00
Ryan Weaver 793b9a001f [DI] Autowiring exception thrown when inlined service is removed 2017-05-31 11:16:20 -07:00
Fabien Potencier 5e40e19081 bug #22999 Better DI type deprecation message (weaverryan)
This PR was merged into the 3.3 branch.

Discussion
----------

Better DI type deprecation message

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

This is the most common autowiring deprecation:

```php
public function __construct(UserPasswordEncoder $encoder)
```

You *should* type-hint `UserPasswordEncoderInterface`

Current deprecation message:
> Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won’t be supported in version 4.0. You should rename (or alias) the "security.user_password_encoder.generic" service to "Symfony\Component\Security\Core\Encoder\UserPasswordEncoder" instead.

Updated message:
> Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won't be supported in version 4.0. Try changing the type-hint for argument "$encoder" of method "AppBundle\Service\TestServiceSubscriber::__construct()" to "Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" instead.

This only happens if we detect that there is a service/alias in the container (e.g. `...\UserPasswordEncoderInterface`) for the type-hint (`...\UserPasswordEncoder)`. Otherwise, if there is no correct type-hint in the container, we give the old recommendation (about aliasing).

The only complex case (of giving good directions on *where* to fix things) is with a class that implements `ServiceSubscriberInterface` (where the type-hint is in the `getSusbcribedServices()` method). In that case, the notice is:

> Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won't be supported in version 4.0. Try changing the type-hint for "Symfony\Component\Security\Core\Encoder\UserPasswordEncoder" in "AppBundle\Service\TestServiceSubscriber" to "Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" instead.

Commits
-------

a990d5c558 Improving deprecation message when hitting the "deprecated type" lookup, but an alias is available
2017-05-31 11:14:35 -07:00
Fabien Potencier b13671957b bug #22985 [Config] Allow empty globs (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[Config] Allow empty globs

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

This considers globs as valid even if they return no matches when they have a prefix (and when that prefix exists, according to `$ignoreErrors`).
This means there is an edge-case:
`*.abc` with at least one match is OK, but when it has no match, it falls back to regular import, then usually will fil.
But rewriting this to `./*.abc` resolves the ambiguity and turns this into a glob that won't fail if no matches are found.

This should provide the expected behavior in most cases (but ambiguous described one of course).

Commits
-------

c5b9c1a8c8 [Config] Allow empty globs
2017-05-31 11:07:24 -07:00
Fabien Potencier e87994502c bug #22961 [HttpKernel] Support unknown format in LoggerDataCollector (iltar)
This PR was merged into the 3.3 branch.

Discussion
----------

[HttpKernel] Support unknown format in LoggerDataCollector

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

The new expected format for the compiler log is `CompilerPassClass: Message`. However, this is not enforced by the old logging method as seen in schmittjoh/JMSDiExtraBundle#276

This PR adds the ability to read those lines without crashing with `Uncaught Notice: Undefined offset: 1`.

Please note that I have not tested this in an application so testers are welcome to confirm this fix!

Commits
-------

a8dfbb1180 Support unknown compiler log format
2017-05-31 11:00:08 -07:00
Ryan Weaver a990d5c558 Improving deprecation message when hitting the "deprecated type" lookup, but an alias is available 2017-05-31 13:54:02 -04:00
Fabien Potencier 44f34825a6 bug #22991 [DI] Don't throw Autowire exception for removed service with private __construct (weaverryan)
This PR was merged into the 3.3 branch.

Discussion
----------

[DI] Don't throw Autowire exception for removed service with private __construct

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none (was talking to a user)
| License       | MIT
| Doc PR        | n/a

Suppose you have:

```php
class A
{
    private function construct() {}
}
```

This service will fail to be autowired. But, like other autowiring failures, if this service will ultimately be removed from the container, this exception should be ignored. This fixes that. Unless someone is using the `AutowirePass` directly inside a `try/catch`, there is no BC break (the behavior change is that the exception is now stored, instead of being thrown).

This also clarifies (in the test & phpdoc) that `AutowirePass` always throws `AutowiringFailedException`s.

Thanks!

Commits
-------

2d3e44e11e Fixing a bug where an autowiring exception was thrown even when that service was removed
2017-05-31 10:51:11 -07:00
Fabien Potencier 9724e8b22f bug #22968 [Profiler] Fix text selection & click on file links on exception pages (ogizanagi)
This PR was squashed before being merged into the 3.3 branch (closes #22968).

Discussion
----------

[Profiler] Fix text selection & click on file links on exception pages

| Q             | A
| ------------- | ---
| Branch?       | 3.3 <!-- see comment below -->
| 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 | #22957, #22978 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

I don't really know the purpose of this css rule here, but I admit it's quite frustrating not to be able to select something here.

This PR also prevents the following annoying behavior (selecting text collapses/uncollapses traces):
![mai-30-2017 18-26-29](https://cloud.githubusercontent.com/assets/2211145/26593977/3afbc510-4566-11e7-9114-8934ba6126a2.gif)

About the trick used, I think the browser support is safe enough: https://caniuse.com/#search=window.getSelection

EDIT: new commit added which allows to fix #22978

Commits
-------

8618399e42 [Profiler] Fix clicking on links inside toggle
ff6151b15f [Profiler] Fix text selection on exception pages
2017-05-31 10:44:02 -07:00
Fabien Potencier e33cdc2336 bug #22994 Harden the debugging of Twig filters and functions (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

Harden the debugging of Twig filters and functions

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

Removing the environment and context arguments is now based on Twig metadata rather than on some wild guessing which might go wrong:

- the environment argument may not be typehinted
- the context argument may not be named `$context`
- an argument may be named `$context` without being the special context argument

Commits
-------

63a8aff2c8 Harden the debugging of Twig filters and functions
2017-05-31 10:23:50 -07:00
Christophe Coevoet 63a8aff2c8 Harden the debugging of Twig filters and functions
Removing the environment and context arguments is now based on Twig metadata
rather than on some wild guessing which might go wrong.
2017-05-31 17:20:46 +02:00
Ryan Weaver 2d3e44e11e Fixing a bug where an autowiring exception was thrown even when that service was removed
The specific report was for a service with a private constructor. This also clarifies
that the AutowirePass throws AutowiringFailedException for all situations. And a bug
was fixed in the constructor of AutowiringFailedException
2017-05-31 09:52:17 -04:00
Nicolas Grekas 5473373473 minor #22989 [Cache] Remove extra arg in call to TraceableAdapter::start() (chalasr)
This PR was merged into the 3.3 branch.

Discussion
----------

[Cache] Remove extra arg in call to TraceableAdapter::start()

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

Leftover from previous implementation

Commits
-------

a379319 Remove extra arg in call to TraceableAdapter::start()
2017-05-31 14:44:55 +02:00
Robin Chalas a3793198fa Remove extra arg in call to TraceableAdapter::start() 2017-05-31 13:48:12 +02:00
Iltar van der Berg a8dfbb1180 Support unknown compiler log format 2017-05-31 12:12:10 +02:00
Nicolas Grekas 7587213ef5 bug #22960 [Cache] Fix decoration of TagAware adapters in dev (chalasr)
This PR was merged into the 3.3 branch.

Discussion
----------

[Cache] Fix decoration of TagAware adapters in dev

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

Commits
-------

28e615a Fix decorating TagAware adapters in dev
2017-05-31 11:49:28 +02:00
Nicolas Grekas c5b9c1a8c8 [Config] Allow empty globs 2017-05-31 10:49:17 +02:00
Robin Chalas 28e615a656 Fix decorating TagAware adapters in dev 2017-05-31 10:24:58 +02:00
Maxime Steinhausser 8618399e42 [Profiler] Fix clicking on links inside toggle 2017-05-31 01:27:40 +02:00
Maxime Steinhausser ff6151b15f [Profiler] Fix text selection on exception pages 2017-05-30 18:34:49 +02:00
Fabien Potencier adc39a2f57 bumped Symfony version to 3.3.1 2017-05-29 14:23:02 -07:00
Fabien Potencier 5a7e31c48e Merge pull request #22949 from fabpot/release-3.3.0
released v3.3.0
2017-05-29 14:02:32 -07:00
Fabien Potencier e6eb52c5e0 updated VERSION for 3.3.0 2017-05-29 14:02:12 -07:00
Fabien Potencier 2b22ad5eb1 updated CHANGELOG for 3.3.0 2017-05-29 13:36:48 -07:00
Fabien Potencier 17deeaf42e bumped Symfony version to 3.2.10 2017-05-29 13:10:37 -07:00