Commit Graph

31381 Commits

Author SHA1 Message Date
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
Kévin Dunglas
47d5e6b82c
[PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string 2017-05-31 12:58:03 +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
Dariusz
8c3c0fe65e CS: adjust chaining indentation 2017-05-31 11:30:46 +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
Fabien Potencier
78c08f2faa Merge pull request #22947 from fabpot/release-3.2.9
released v3.2.9
2017-05-29 12:32:17 -07:00
Fabien Potencier
a948880ecb updated VERSION for 3.2.9 2017-05-29 12:32:04 -07:00
Fabien Potencier
17fd48cdfe updated CHANGELOG for 3.2.9 2017-05-29 12:31:58 -07:00
Fabien Potencier
af6b25b28c bumped Symfony version to 2.8.22 2017-05-29 12:30:05 -07:00
Fabien Potencier
17002cbb4b Merge pull request #22946 from fabpot/release-2.8.21
released v2.8.21
2017-05-29 12:15:13 -07:00
Fabien Potencier
ecf57807c8 updated VERSION for 2.8.21 2017-05-29 12:14:58 -07:00
Fabien Potencier
1140ae1930 updated CHANGELOG for 2.8.21 2017-05-29 12:14:50 -07:00
Fabien Potencier
aa04f35092 bumped Symfony version to 2.7.29 2017-05-29 12:14:01 -07:00
Fabien Potencier
a2bb2ddfbb Merge pull request #22945 from fabpot/release-2.7.28
released v2.7.28
2017-05-29 12:04:29 -07:00
Fabien Potencier
a13a17ad04 updated VERSION for 2.7.28 2017-05-29 12:04:18 -07:00
Fabien Potencier
1d51bbd384 update CONTRIBUTORS for 2.7.28 2017-05-29 12:04:10 -07:00
Fabien Potencier
e7436af7a6 updated CHANGELOG for 2.7.28 2017-05-29 12:04:03 -07:00
Fabien Potencier
1fba4d6020 Merge branch '3.2' into 3.3
* 3.2:
  [Form] fix guesed value param type in docblock
2017-05-29 11:50:47 -07:00
Fabien Potencier
538591c21f Merge branch '2.8' into 3.2
* 2.8:
  [Form] fix guesed value param type in docblock
2017-05-29 11:50:38 -07:00
Fabien Potencier
2c84ac23b4 Merge branch '2.7' into 2.8
* 2.7:
  [Form] fix guesed value param type in docblock
2017-05-29 11:50:29 -07:00
Fabien Potencier
84b50f13b3 minor #22939 [Form] fix guesed value param type in docblock (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] fix guesed value param type in docblock

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

43636ba630 [Form] fix guesed value param type in docblock
2017-05-29 11:43:25 -07:00
Fabien Potencier
c82fe60168 Merge branch '3.3' into 3.4
* 3.3:
  [Config] Fallback to regular import when glob fails
2017-05-29 11:41:56 -07:00
Fabien Potencier
f7b09e9bbf bug #22940 [Config] Fallback to regular import when glob fails (nicolas-grekas)
This PR was submitted for the master branch but it was merged into the 3.3 branch instead (closes #22940).

Discussion
----------

[Config] Fallback to regular import when glob fails

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

Fixes a BC break as reported in linked issue.

Commits
-------

7b4066e8ab [Config] Fallback to regular import when glob fails
2017-05-29 11:41:33 -07:00
Nicolas Grekas
7b4066e8ab [Config] Fallback to regular import when glob fails 2017-05-29 11:41:32 -07:00