Commit Graph

23275 Commits

Author SHA1 Message Date
Nicolas Grekas
d85febc5f8 minor #21047 [Config] Improve PHPdoc / IDE autocomplete (ro0NL)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Improve PHPdoc / IDE autocomplete

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| 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-->

The missing pieces for fixing the autocomplete in IDE's (tested in `PhpStorm 2016.3.2`).

Each method seems to be found now for the framework bundle configuration 😱

Actually uses #20923 where needed, but i think we should go with it consistently.

Relates to https://github.com/symfony/symfony/pull/20290#issuecomment-257303145

Commits
-------

3f3c6e0 [Config] Improve PHPdoc / IDE autocomplete
2016-12-28 09:11:03 +01:00
Nicolas Grekas
dc35187259 bug #21069 [Debug] Fixed cast of stream (lyrixx)
This PR was merged into the 3.2 branch.

Discussion
----------

[Debug] Fixed cast of stream

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

---

Reproducer:

```
$socket = stream_socket_server("tcp://0:9911", $e1, $e2, STREAM_SERVER_LISTEN);
dump($socket);
```

Commits
-------

814ba5c [Debug] Fixed cast of stream
2016-12-28 08:41:43 +01:00
Roland Franssen
8215dbdb31 [HttpFoundation] Validate/cast cookie expire time 2016-12-27 23:08:58 +00:00
Robin Chalas
a7ebe9c1a4
[TwigBridge] Fix upgrade/changelog notes 2016-12-27 20:04:23 +01:00
Grégoire Pineau
814ba5c477 [Debug] Fixed cast of stream
Reproducer:

```
$socket = stream_socket_server("tcp://0:9911", $e1, $e2, STREAM_SERVER_LISTEN);
dump($socket);
```
2016-12-27 18:23:46 +01:00
ShinDarth
700344a993 [Console] minor addition to #20817 for branch 3.2 2016-12-27 16:50:49 +01:00
Roland Franssen
3f3c6e0e53 [Config] Improve PHPdoc / IDE autocomplete 2016-12-27 15:12:49 +00:00
Grégoire Pineau
18dfef1e2b [Debug] Wrap call to ->log in a try catch block
If something goes wrong in the logger, the application ends up
with a blank page. Let's display the original exception.
2016-12-27 15:50:31 +01:00
Nicolas Grekas
ee69018bf4 bug #21010 [Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes (SpacePossum)
This PR was squashed before being merged into the 2.7 branch (closes #21010).

Discussion
----------

[Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes

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

When trying to call a method on an anonymous class (with or without methods) the `UndefinedMethodFatalErrorHandler` tries to iterate `null`.

For ref.: https://3v4l.org/l26u1

Commits
-------

ed713ae [Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
2016-12-27 14:43:30 +01:00
SpacePossum
ed713aef2b [Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes 2016-12-27 14:43:27 +01:00
Nicolas Grekas
aed6f86782 fix merge 2016-12-27 14:36:53 +01:00
Nicolas Grekas
d28384274a bug #20991 [cache] Bump RedisAdapter default timeout to 5s (Nicofuma)
This PR was merged into the 3.1 branch.

Discussion
----------

[cache] Bump RedisAdapter default timeout to 5s

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

Bump RedisAdapter timeout to 5s because (at least with Predis) 0 means 0s

Commits
-------

eaca2a4 [cache] Bump RedisAdapter timeout to 5s
2016-12-27 14:22:57 +01:00
Tristan Darricau
eaca2a4509 [cache] Bump RedisAdapter timeout to 5s
Bump RedisAdapter timeout to 5s because (at least with Predis) 0 means 0s
2016-12-27 14:21:58 +01:00
Fabien Potencier
7808b675fc fixed @return when returning this or static 2016-12-27 11:52:11 +01:00
Fabien Potencier
f4a635957e Merge branch '3.1' into 3.2
* 3.1:
  fixed @return when returning this or static
  override property constraints in child class
  removed unneeded comment
  [Console] improved code coverage of Command class
  [FrameworkBundle] Make TemplateController working without the Templating component
  Only count on arrays or countables to avoid warnings in PHP 7.2
2016-12-27 11:44:30 +01:00
Grégoire Pineau
8227593604 [SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService 2016-12-27 11:44:08 +01:00
Fabien Potencier
4c453f617d Merge branch '2.8' into 3.1
* 2.8:
  fixed @return when returning this or static
  override property constraints in child class
  removed unneeded comment
  [Console] improved code coverage of Command class
  [FrameworkBundle] Make TemplateController working without the Templating component
  Only count on arrays or countables to avoid warnings in PHP 7.2
2016-12-27 11:43:25 +01:00
Fabien Potencier
9a64d83436 Merge branch '2.7' into 2.8
* 2.7:
  fixed @return when returning this or static
  override property constraints in child class
  [Console] improved code coverage of Command class
  Only count on arrays or countables to avoid warnings in PHP 7.2
2016-12-27 11:39:57 +01:00
Fabien Potencier
eeb9192cf3 minor #21054 Fix @return statements to use $this or static when relevant (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix @return statements to use $this or static when relevant

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

see #20290

Commits
-------

3c0693d fixed @return when returning this or static
2016-12-27 11:38:09 +01:00
Nicolas Grekas
59dc976caf bug #20959 [FrameworkBundle] Ignore AnnotationException exceptions in the AnnotationsCacheWarmer (fancyweb)
This PR was squashed before being merged into the 3.2 branch (closes #20959).

Discussion
----------

[FrameworkBundle] Ignore AnnotationException exceptions in the AnnotationsCacheWarmer

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

I ran into a case that led to an `AnnotationException` in the `AnnotationsCacheWarmer`. I deduced that these exceptions should be ignored to not break the cache warming process.

The case :
* You have a controller in your `AppBundle\Controller\` directory.
* You have an annotation in this controller that will never be found (because you made a mistake in the class / annotation name) or not every time : for example your controller is only used in dev env and it uses an annotation that is defined in a vendor bundle that is only under the `require-dev` key in your `composer.json` because you don't need it in your production deployment. So in production, your controller exists but will never be used. However the vendor bundle does not exist.
* You dump your autoload files with composer using the `--optimize` option.
* You end up with an `AnnotationException`.

Why :
* In the [`FrameworkExtension`](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L189), the `**Bundle\Controller\` pattern is added as an "annotated class to compile".
* In the [`AddClassesToCachePass`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php#L50), all the classes defined in the `autoload_classmap.php` file are matched against the previous pattern.
* Your controller will match. So even if you don't use it at all in your application, the annotation will still be read and the exception will be thrown.

Commits
-------

6749569 [FrameworkBundle] Ignore AnnotationException exceptions in the AnnotationsCacheWarmer
2016-12-27 10:59:18 +01:00
Thomas Calvet
67495693a4 [FrameworkBundle] Ignore AnnotationException exceptions in the AnnotationsCacheWarmer 2016-12-27 10:59:17 +01:00
Fabien Potencier
3c0693de23 fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
Fabien Potencier
085171fc50 bug #20795 [FrameworkBundle] Allow multiple transitions with the same name (Padam87)
This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] Allow multiple transitions with the same name

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

Commits
-------

7c86e16 [FrameworkBundle] Allow multiple transactions with the same name
2016-12-26 21:42:16 +01:00
Fabien Potencier
2e0b61eaff bug #20859 Avoid warning in PHP 7.2 because of non-countable data (wouterj)
This PR was merged into the 2.7 branch.

Discussion
----------

Avoid warning in PHP 7.2 because of non-countable data

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

Recently, the "[Counting of non-countable objects][1]" RFC was merged in PHP 7.2-dev. This means `count()` now causes a warning when passing anything that's not countable (e.g. `null` or `''`).

As PHP does not lazily execute conditions, `FormUtil::isEmtpy($data) || 0 === count($data)` will cause *both* conditions to be executed. This means `count($data)` errors when `$data` is empty.

Splitting it up in 2 statements avoids the warning being triggered in PHP 7.2.

See https://travis-ci.org/symfony-cmf/content-bundle/jobs/181815895 for a failing test caused by this bug.

 [1]: https://wiki.php.net/rfc/counting_non_countables

Commits
-------

94253e8 Only count on arrays or countables to avoid warnings in PHP 7.2
2016-12-26 12:09:56 +01:00
Christian Flothmann
8b281fe401 override property constraints in child class 2016-12-25 18:58:48 +01:00
Fabien Potencier
e5ce4c9383 removed unneeded comment 2016-12-23 22:13:36 +01:00
Fabien Potencier
a4ac1a785e minor #20817 [Console] improved code coverage of Command class (ShinDarth)
This PR was squashed before being merged into the 2.7 branch (closes #20817).

Discussion
----------

[Console] improved code coverage of Command class

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

This PR increases the code coverage of the Command class from ``86.82%`` to ``96.90%``.

Commits
-------

d393113 [Console] improved code coverage of Command class
2016-12-23 21:36:17 +01:00
ShinDarth
d39311385f [Console] improved code coverage of Command class 2016-12-23 21:36:12 +01:00
Fabien Potencier
f1d8575d38 bug #21034 [FrameworkBundle] Make TemplateController working without the Templating component (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle] Make TemplateController working without the Templating component

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

The template controller was missed during #15502. Btw I've added some tests for this controller.

Commits
-------

89ccbc4 [FrameworkBundle] Make TemplateController working without the Templating component
2016-12-23 21:28:53 +01:00
Christian Flothmann
a3788e7ce6 Merge branch '3.1' into 3.2
* 3.1:
  use HHVM 3.15 to run tests
  [TwigBridge] fix Twig 2.x compatibility
  removed some PHP CS Fixer rules
  Improve language
  [Console] SymfonyStyle: Escape trailing backslashes in user texts
  Mention the community review guide
  [Form] fix group sequence based validation
  [Console] Fix question formatting using SymfonyStyle::ask()
2016-12-23 18:05:10 +01:00
Christian Flothmann
e1d2426d56 Merge branch '2.8' into 3.1
* 2.8:
  use HHVM 3.15 to run tests
  [TwigBridge] fix Twig 2.x compatibility
  removed some PHP CS Fixer rules
  Improve language
  [Console] SymfonyStyle: Escape trailing backslashes in user texts
  Mention the community review guide
  [Form] fix group sequence based validation
  [Console] Fix question formatting using SymfonyStyle::ask()
2016-12-23 17:43:44 +01:00
Christian Flothmann
8a27d79a10 Merge branch '2.7' into 2.8
* 2.7:
  use HHVM 3.15 to run tests
  [TwigBridge] fix Twig 2.x compatibility
  removed some PHP CS Fixer rules
  Improve language
  [Console] SymfonyStyle: Escape trailing backslashes in user texts
  Mention the community review guide
  [Form] fix group sequence based validation
  [Console] Fix question formatting using SymfonyStyle::ask()
2016-12-23 17:32:24 +01:00
Kévin Dunglas
89ccbc450c
[FrameworkBundle] Make TemplateController working without the Templating component 2016-12-23 16:30:22 +01:00
Arthur de Moulins
4dc4f694ca remove is_writable check on filesystem cache 2016-12-23 13:05:40 +01:00
Christian Flothmann
08e5747ce1 [TwigBridge] fix Twig 2.x compatibility 2016-12-23 12:20:51 +01:00
Fabien Potencier
0bb7eafba0 bug #20970 [Console] Fix question formatting using SymfonyStyle::ask() (chalasr, ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix question formatting using SymfonyStyle::ask()

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

Given
```php
$io = new SymfonyStyle($input, $output);
$io->ask('Do you want to use Foo\\Bar <comment>or</comment> Foo\\Baz\\?', 'Foo\\Bar');
```

Before output
![before](http://image.prntscr.com/image/af3806f866654deda2dec79b50d1ffa2.png)

After output
![after](http://image.prntscr.com/image/59c031d9e02949cebeae7a4734c7043f.png)

Commits
-------

e189183 [Console] SymfonyStyle: Escape trailing backslashes in user texts
9d46712 [Console] Fix question formatting using SymfonyStyle::ask()
2016-12-22 13:18:06 +01:00
Fabien Potencier
072393d924 Merge branch '3.1' into 3.2
* 3.1:
  [HttpKernel] Continuation of #20599 for 3.1
2016-12-22 11:30:54 +01:00
Tarjei Huse
1255786811 Improve language
I suspect the file has been updated from the Danish translation and thus some of the sentences sound weird in Norwegian. Here's a suggested update.
2016-12-22 11:26:53 +01:00
Roland Franssen
c245f87a47 [HttpKernel] Continuation of #20599 for 3.1 2016-12-20 17:35:30 +00:00
Nicolas Grekas
411afbe854 Fix merge 2016-12-19 22:16:36 +01:00
Nicolas Grekas
c34af41cf8 Merge branch '3.1' into 3.2
* 3.1:
  Fix merge
  [TwigBundle][#20799] fix merge
2016-12-19 21:55:39 +01:00
Nicolas Grekas
6fddb75ef5 Fix merge 2016-12-19 21:36:15 +01:00
Christian Flothmann
98c835d9be [TwigBundle][#20799] fix merge 2016-12-19 19:45:07 +01:00
Fabien Potencier
2f24e690f6 bug #20975 [Form] fix group sequence based validation (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] fix group sequence based validation

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

Commits
-------

fb91f74 [Form] fix group sequence based validation
2016-12-19 17:50:42 +01:00
Fabien Potencier
93a00b0eca Merge branch '3.1' into 3.2
* 3.1:
  fixed tests
2016-12-19 17:19:24 +01:00
Fabien Potencier
e618ff3ecb fixed tests 2016-12-19 17:18:40 +01:00
Fabien Potencier
ab520a13c6 fixed tests 2016-12-19 17:17:38 +01:00
Fabien Potencier
0a9e391f36 fixed obsolete getMock() usage 2016-12-19 17:09:34 +01:00
Fabien Potencier
3f96468942 Merge branch '3.1' into 3.2
* 3.1:
  fixed obsolete getMock() usage
  fixed obsolete getMock() usage
  fixed obsolete getMock() usage
  [WebProfilerBundle] Display multiple HTTP headers in WDT
  do not remove the Twig ExceptionController service
  removed obsolete condition
  do not try to register incomplete definitions
2016-12-19 17:07:36 +01:00
Fabien Potencier
a3058245db fixed obsolete getMock() usage 2016-12-19 17:00:11 +01:00
Fabien Potencier
7ae26ed5f1 Merge branch '2.8' into 3.1
* 2.8:
  fixed obsolete getMock() usage
  fixed obsolete getMock() usage
  [WebProfilerBundle] Display multiple HTTP headers in WDT
  do not remove the Twig ExceptionController service
  removed obsolete condition
  do not try to register incomplete definitions
2016-12-19 16:53:49 +01:00
Fabien Potencier
0f9a7287c3 fixed obsolete getMock() usage 2016-12-19 16:48:05 +01:00
Fabien Potencier
84e75a78b3 Merge branch '2.7' into 2.8
* 2.7:
  fixed obsolete getMock() usage
  [WebProfilerBundle] Display multiple HTTP headers in WDT
2016-12-19 16:38:44 +01:00
Fabien Potencier
71d059cad1 fixed obsolete getMock() usage 2016-12-19 16:22:46 +01:00
Maxime Steinhausser
e189183689 [Console] SymfonyStyle: Escape trailing backslashes in user texts 2016-12-19 11:07:02 +01:00
Nicolas Grekas
cbf766bcc4 Merge branch '3.1' into 3.2
* 3.1:
  [HttpKernel] Fix ClientTest cookie format assertions
2016-12-18 22:40:57 +01:00
Nicolas Grekas
20190c3861 [HttpKernel] Fix ClientTest cookie format assertions 2016-12-18 21:52:30 +01:00
Roland Franssen
257a856f9f [WebProfilerBundle] Display multiple HTTP headers in WDT 2016-12-18 15:34:37 +00:00
Christian Flothmann
fb91f74b34 [Form] fix group sequence based validation 2016-12-17 23:43:59 +01:00
Christian Flothmann
c9e560f1b7 do not remove the Twig ExceptionController service 2016-12-17 22:15:07 +01:00
Fabien Potencier
faf2370a3d removed obsolete condition 2016-12-17 19:04:40 +01:00
Fabien Potencier
c7f9baf8f4 Merge branch '2.7' into 2.8
* 2.7:
  do not try to register incomplete definitions
2016-12-17 19:00:59 +01:00
Fabien Potencier
3e874dc878 bug #20799 [TwigBundle] do not try to register incomplete definitions (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] do not try to register incomplete definitions

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

Commits
-------

2c9dc66 do not try to register incomplete definitions
2016-12-17 18:59:13 +01:00
Robin Chalas
9d46712103
[Console] Fix question formatting using SymfonyStyle::ask() 2016-12-17 14:04:43 +01:00
Nicolas Grekas
b9a74f35ba Merge branch '3.1' into 3.2
* 3.1:
  [Security] Fix test
  [Validator] phpize default option values
  test for the Validator component to be present
  [Serializer] Fix MaxDepth annotation exceptions
  [DependencyInjection] Fix on-invalid attribute type in xsd
  [FrameworkBundle] Fix PHP form templates on translatable attributes
  [VarDumper] Fix dumping by-ref variadics
  [Validator] add Indonesian translation
  fixed CS
  [config] Fix issue when key removed and left value only
  [HttpFoundation] Fix cookie to string conversion for raw cookies
  [Console] fixed BC issue with static closures
  [Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
2016-12-17 11:46:44 +01:00
Nicolas Grekas
f4b3b87ef7 Merge branch '2.8' into 3.1
* 2.8:
  [Security] Fix test
  [Validator] phpize default option values
  test for the Validator component to be present
  [DependencyInjection] Fix on-invalid attribute type in xsd
  [FrameworkBundle] Fix PHP form templates on translatable attributes
  [VarDumper] Fix dumping by-ref variadics
  [Validator] add Indonesian translation
  fixed CS
  [config] Fix issue when key removed and left value only
  [Console] fixed BC issue with static closures
  [Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
2016-12-17 11:46:00 +01:00
Nicolas Grekas
55da229acb Merge branch '2.7' into 2.8
* 2.7:
  [Validator] phpize default option values
  test for the Validator component to be present
  [DependencyInjection] Fix on-invalid attribute type in xsd
  [FrameworkBundle] Fix PHP form templates on translatable attributes
  [VarDumper] Fix dumping by-ref variadics
2016-12-17 11:44:20 +01:00
Nicolas Grekas
8aeed88179 [Security] Fix test 2016-12-17 11:40:05 +01:00
Fabien Potencier
0a4a92b05b bug #20961 [Validator] phpize default option values (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] phpize default option values

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

This makes the behavior for default constraints inline with the behavior
when the option is given explicitly.

Commits
-------

d65679b [Validator] phpize default option values
2016-12-17 08:46:09 +01:00
Fabien Potencier
2344c2204b bug #20934 [FrameworkBundle] Fix PHP form templates on translatable attributes (ro0NL)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix PHP form templates on translatable attributes

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

Separated from #20365

Commits
-------

10806e0 [FrameworkBundle] Fix PHP form templates on translatable attributes
2016-12-17 08:43:35 +01:00
Christian Flothmann
d65679b302 [Validator] phpize default option values
This makes the behavior for default constraints inline with the behavior
when the option is given explicitly.
2016-12-16 16:54:54 +01:00
Christian Flothmann
fb9b08396b test for the Validator component to be present 2016-12-16 14:02:12 +01:00
Maxime Steinhausser
999f769ba5 [Serializer] Fix MaxDepth annotation exceptions 2016-12-15 20:58:01 +01:00
Maxime Steinhausser
e66d3da91a [DependencyInjection] Fix on-invalid attribute type in xsd 2016-12-15 15:48:03 +01:00
Roland Franssen
10806e056e [FrameworkBundle] Fix PHP form templates on translatable attributes 2016-12-15 14:04:46 +00:00
Nicolas Grekas
28ec36140d [VarDumper] Fix dumping by-ref variadics 2016-12-15 08:56:57 +01:00
Christian Flothmann
2c9dc66665 do not try to register incomplete definitions 2016-12-15 08:06:17 +01:00
Fabien Potencier
8de22de869 bug #20749 [FrameworkBundle] Smarter default for framework.annotations (ogizanagi)
This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] Smarter default for framework.annotations

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yesish (could be considered as a minor BC break)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

`framework.annotations` default should be true only if `doctrine/annotations` is installed.

Indeed, in https://github.com/symfony/symfony/pull/20097, the dependency on `doctrine/annotations` was removed from the framework bundle.
Thus, an application can break (not talking from one actually relying on annotations) as soon as it uses the framework bundle without the `framework.annotations` key explicitly set to `false` (I had the case in a fixture application in the testsuite of a package).

Commits
-------

e38be09 [FrameworkBundle] framework.annotations default should be true only if doctrine/annotations is installed
2016-12-14 09:14:24 +01:00
Fabien Potencier
839c0836ee Merge branch '2.7' into 2.8
* 2.7:
  [Validator] add Indonesian translation
  fixed CS
  [config] Fix issue when key removed and left value only
  [Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
2016-12-14 09:13:10 +01:00
Indra Gunawan
ca4c35164f [Validator] add Indonesian translation 2016-12-14 09:12:43 +01:00
Fabien Potencier
482e9edc50 bug #20734 [Security] AbstractVoter->supportsAttribute gives false positive if attribute is zero (0) (martynas-foodpanda)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] AbstractVoter->supportsAttribute gives false positive if attribute is zero (0)

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

Issue is easy to reproduce with test giving negative data set.
0 should not pass as supported attribute for any set of attributes but it does as in_array in the method does not use flag 'strict' set to true.

As this is abstract voter and is used by users with their code flag 'strict' should be set to true.
Since is there in 2.7 and 2.8 (LTS) IMHO it should be fixed.

Commits
-------

8306530 [Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
2016-12-14 09:11:55 +01:00
Fabien Potencier
92423e77ac fixed CS 2016-12-14 09:03:29 +01:00
Michael Lee
b587a7294f [config] Fix issue when key removed and left value only
When a key attribute is mapped and the key is removed from the value array, if
only 'value' element is left in the array, it should replace its wrapper
array.

Assume the original value array is as follows (key attribute is 'id').

```php
array(
    'things' => array(
        array('id' => 'option1', 'value' => 'value1'),
        array('id' => 'option2', 'value' => 'value2')
    )
)
```

After normalized, the above shall be converted to the following array.

```php
array(
    'things' => array(
        'option1' => 'value1',
        'option2' => 'value2'
    )
)
```

It's also possible to mix 'value-only' and 'none-value-only' elements in
the array:

```php
array(
    'things' => array(
        array('id' => 'option1', 'value' => 'value1'),
        array('id' => 'option2', 'value' => 'value2', 'foo' => 'foo2')
    )
)
```

The above shall be converted to the following array.
```php
array(
    'things' => array(
        'option1' => 'value1',
        'option2' => array('value' => 'value2','foo' => 'foo2')
    )
)
```

The 'value' element can also be array:

```php
array(
    'things' => array(
        array(
            'id' => 'option1',
            'value' => array('foo'=>'foo1', 'bar' => 'bar1')
        )
    )
)
```
The above shall be converted to the following array.
```php
array(
    'things' => array(
        'option1' => array('foo' => 'foo1', 'bar' => 'bar1')
    )
)
```

When using VariableNode for value element, it's also possible to mix
different types of value elements:
```php
array(
    'things' => array(
        array('id' => 'option1', 'value' => array('foo'=>'foo1', 'bar' => 'bar1')),
        array('id' => 'option2', 'value' => 'value2')
    )
)
```

The above shall be converted to the following array.
```php
array(
    'things' => array(
        'option1' => array('foo'=>'foo1', 'bar' => 'bar1'),
        'option2' => 'value2'
    )
)
```

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15270
| License       | MIT
| Doc PR        | n/a
2016-12-14 09:02:51 +01:00
Roland Franssen
5e899cd2a7 [HttpFoundation] Fix cookie to string conversion for raw cookies 2016-12-14 08:17:13 +01:00
Robin Chalas
c88bc899d4
Fix misresolved parameters in debug:config on 3.2 2016-12-13 20:36:21 +01:00
Adam Prager
7c86e1609b [FrameworkBundle] Allow multiple transactions with the same name 2016-12-13 19:14:16 +01:00
Fabien Potencier
917eacac25 bug #20847 [Console] fixed BC issue with static closures (araines)
This PR was squashed before being merged into the 2.8 branch (closes #20847).

Discussion
----------

[Console] fixed BC issue with static closures

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

Static closures were unable to be used in Command::setCode since #14431.  This change fixes the BC break and ensures static closures can still be used.

Edit: It seems the inability to bind static closures was considered a feature in PHP5 but was considered a bug by PHP7.  As such, the tests need to work around this fact - but the code can remain the same.  This code change can be tidied/removed once Symfony is PHP7+ only.

Discussion here:
https://bugs.php.net/bug.php?id=64761
https://bugs.php.net/bug.php?id=68792

Commits
-------

3247308 [Console] fixed BC issue with static closures
2016-12-13 18:12:26 +01:00
Andy Raines
3247308c50 [Console] fixed BC issue with static closures 2016-12-13 18:12:25 +01:00
Kévin Dunglas
01b7e6c737
[TwigBundle] Config is now a hard dependency 2016-12-13 17:42:40 +01:00
Fabien Potencier
6f46d5d776 Merge branch '3.1' into 3.2
* 3.1:
  [Console] Review Application docblocks
  bumped Symfony version to 3.1.9
  updated VERSION for 3.1.8
  updated CHANGELOG for 3.1.8
  bumped Symfony version to 2.8.16
  updated VERSION for 2.8.15
  updated CHANGELOG for 2.8.15
  bumped Symfony version to 2.7.23
  updated VERSION for 2.7.22
  update CONTRIBUTORS for 2.7.22
  updated CHANGELOG for 2.7.22
  Update PHP CS Fixer config file
2016-12-13 16:32:03 +01:00
Fabien Potencier
298452da31 Merge branch '2.8' into 3.1
* 2.8:
  [Console] Review Application docblocks
  bumped Symfony version to 2.8.16
  updated VERSION for 2.8.15
  updated CHANGELOG for 2.8.15
  bumped Symfony version to 2.7.23
  updated VERSION for 2.7.22
  update CONTRIBUTORS for 2.7.22
  updated CHANGELOG for 2.7.22
  Update PHP CS Fixer config file
2016-12-13 16:31:15 +01:00
Fabien Potencier
e221ac9df7 Merge branch '2.7' into 2.8
* 2.7:
  [Console] Review Application docblocks
  bumped Symfony version to 2.7.23
  updated VERSION for 2.7.22
  update CONTRIBUTORS for 2.7.22
  updated CHANGELOG for 2.7.22
  Update PHP CS Fixer config file
2016-12-13 16:30:11 +01:00
Fabien Potencier
7f85f6dc1e minor #20813 [Console] Review Application docblocks (ogizanagi)
This PR was squashed before being merged into the 2.7 branch (closes #20813).

Discussion
----------

[Console] Review Application docblocks

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

~I know there must be a lot of other places in the core where there is some repeated or useless informations in docblocks, but everytime I dig into the `Application` class, I see this, and I don't want to repeat things for consistency when adding new methods 😅  (for instance in #20808, the `setCatchThrowables / areThrowablesCaught ` methods do not need a docblock description IMHO).~

~This PR adapts docblocks where:~

- ~A docblock description is not required, as everything can be expressed in the `@return / @param` argument (the case mentioned above)~
- ~Information is redundant between description and tags, and the context does not have to be reminded again:~

```diff

    /**
     * Adds an array of command objects.
     *
     * If a Command is not enabled it will not be added.
     *
-     * @param Command[] $commands An array of commands
+     * @param Command[] $commands
     */
    public function addCommands(array $commands)
    {
        foreach ($commands as $command) {
            $this->add($command);
        }
    }
```

Commits
-------

d8c18cc [Console] Review Application docblocks
2016-12-13 16:27:53 +01:00
Maxime STEINHAUSSER
d8c18cc3cd [Console] Review Application docblocks 2016-12-13 16:27:52 +01:00
Vincent HADJEDJ
7e4573bcfb [Cache] Improve performances into foreach (PhpFilesAdapter) 2016-12-13 16:09:48 +01:00
Fabien Potencier
c41cfcb897 bumped Symfony version to 3.2.2 2016-12-13 14:40:27 +01:00
Fabien Potencier
d884a521f3 updated VERSION for 3.2.1 2016-12-13 14:19:46 +01:00
Fabien Potencier
8bf83cc0b0 bumped Symfony version to 3.1.9 2016-12-13 14:18:12 +01:00
Fabien Potencier
25b40ff90c updated VERSION for 3.1.8 2016-12-13 13:52:10 +01:00
Robin van der Vleuten
4e6086f7db Add support for REDIS_URL environment variables. 2016-12-13 13:50:44 +01:00