Commit Graph

30229 Commits

Author SHA1 Message Date
Fabien Potencier
dd8e50baa1 minor #21994 Use PHP functions as array_map callbacks when possible (javiereguiluz)
This PR was merged into the 2.7 branch.

Discussion
----------

Use PHP functions as array_map callbacks when possible

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

We already do that in 99% of the cases ... but there were 3 occurrences where we didn't do it.

Commits
-------

405bd4cc81 Use PHP functions as array_map callbacks when possible
2017-03-14 12:43:03 -07:00
Fabien Potencier
d1e591edd8 feature #21935 [FrameworkBundle][Workflow] Add a way to register a guard expression in the configuration (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Workflow] Add a way to register a guard expression in the configuration

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

---

Many people already asked for this feature so ... here we go 🎉

---

Usage:
```yml
            transitions:
                journalist_approval:
                    guard: "is_fully_authenticated() and has_role('ROLE_JOURNALIST') or is_granted('POST_EDIT', subject)"
                    from: wait_for_journalist
                    to: approved_by_journalist
                publish:
                    guard: "subject.isPublic()"
                    from: approved_by_journalist
                    to: published
```

Commits
-------

ab3b12d6dc [FrameworkBundle][Workflow] Add a way to register a guard expression in the configuration
2017-03-14 12:04:20 -07:00
Fabien Potencier
6166260d6e feature #21080 [FrameworkBundle][Monolog] Added a new way to follow logs (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Monolog] Added a new way to follow logs

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

----

If you want to try this PR, you can use [my fork](https://github.com/lyrixx/symfony-standard/tree/server-log):
```bash
git clone https://github.com/lyrixx/symfony-standard -b server-log symfony-se-logs
cd symfony-se-logs
composer install
bin/console server:start
bin/console server:log
```
and from anywhere `curl http://0:8000`

---

Basically, it's a new way to view and filter real time logs, from the CLI.

![screenshot13](https://cloud.githubusercontent.com/assets/408368/21898198/52fa8c3c-d8ec-11e6-98db-6b3a6f8fe50d.png)

Commits
-------

ac92375ddb [FrameworkBundle][Monolog] Added a new way to follow logs
2017-03-14 11:58:53 -07:00
Fabien Potencier
dc0eba77f6 minor #21875 Rename TimeZoneTransformer into TimezoneTransformer (lepiaf)
This PR was submitted for the 3.2 branch but it was merged into the 3.3-dev branch instead (closes #21875).

Discussion
----------

Rename TimeZoneTransformer into TimezoneTransformer

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

Commits
-------

dba163950b Rename TimeZoneTransformer into TimezoneTransformer
2017-03-14 11:55:51 -07:00
Thierry Thuon
dba163950b Rename TimeZoneTransformer into TimezoneTransformer 2017-03-14 11:55:49 -07:00
Fabien Potencier
26198cf60a bug #21981 [Console] Use proper line endings in BufferedOutput (julienfalque)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Use proper line endings in BufferedOutput

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

`BufferOutput` should be consistent with `StreamOutput` when writing newlines.

I faced an issue using this class in tests where the expected output was platform dependent (using `PHP_EOL` too).

Commits
-------

33946e69c0 Use proper line endings
2017-03-14 11:38:54 -07:00
Javier Eguiluz
405bd4cc81 Use PHP functions as array_map callbacks when possible 2017-03-14 12:32:10 +01:00
Nicolas Grekas
71b2c3a52e minor #21993 [Validator] revert wrong Phpdoc change (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] revert wrong Phpdoc change

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

Commits
-------

86e8afa [Validator] revert wrong Phpdoc change
2017-03-14 09:43:35 +01:00
Christian Flothmann
86e8afaea0 [Validator] revert wrong Phpdoc change 2017-03-14 09:04:19 +01:00
Nicolas Grekas
27dbfda18e Merge branch '3.2'
* 3.2:
  [FrameworkBundle] Fix cleaning of test dirs
2017-03-14 08:58:07 +01:00
Nicolas Grekas
efa74c5eab Merge branch '2.8' into 3.2
* 2.8:
  [FrameworkBundle] Fix cleaning of test dirs
2017-03-14 08:56:22 +01:00
Nicolas Grekas
6b4cfd6a25 Merge branch '2.7' into 2.8
* 2.7:
  [FrameworkBundle] Fix cleaning of test dirs
2017-03-14 08:55:42 +01:00
Nicolas Grekas
ac89b1c548 minor #21972 [FrameworkBundle] Fix cleaning of test dirs (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix cleaning of test dirs

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

I spent an hour or two today debugging a non existent issue that was related to a non removed temporary file.
Let's cleanup properly now in the base WebTestCase.

Commits
-------

4842c86 [FrameworkBundle] Fix cleaning of test dirs
2017-03-14 08:31:41 +01:00
Nicolas Grekas
8141d1757f bug #21983 [HttpKernel] Resolve real class when failing on proxies (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Resolve real class when failing on proxies

| 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/issues/21969
| License       | MIT
| Doc PR        | n/a

__Before__
> The controller for URI "/" is not callable. Method "home" on class "SymfonyProxy_f6aad6c251e61ad4ae1fc5a561578cae" should be public and non-abstract.

__After__
> The controller for URI "/" is not callable. Method "home" on class "Actions" should be public and non-abstract.

Commits
-------

e34e29a [HttpKernel] Resolve real class when failing on proxies
2017-03-14 08:30:58 +01:00
Nicolas Grekas
f2ae2ed75d bug #21986 Stop relying on the $mode argument (greg0ire)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Stop relying on the $mode argument

When registering the error handler, simple-phpunit might be used, and in
that case, the bootstrap process will not have environment variables
defined inside phpunit.xml.dist . This means `$mode` might differ when
registering the error handler, and when an error is triggered.
This raises a question: should the $mode argument be removed to avoid
similar errors in the future?

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

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

0d180d5 Stop relying on the $mode argument
2017-03-14 08:29:25 +01:00
Nicolas Grekas
4842c86324 [FrameworkBundle] Fix cleaning of test dirs 2017-03-13 22:39:55 +01:00
Grégoire Paris
0d180d5994
Stop relying on the $mode argument
When registering the error handler, simple-phpunit might be used, and in
that case, the bootstrap process will not have environment variables
defined inside phpunit.xml.dist . This means `$mode` might differ when
registering the error handler, and when an error is triggered.
This raises a question: should the $mode argument be removed to avoid
similar errors in the future?
2017-03-13 12:11:00 +01:00
Robin Chalas
e34e29a621 [HttpKernel] Resolve real class when failing on proxies 2017-03-13 10:10:30 +01:00
Julien Falque
33946e69c0
Use proper line endings 2017-03-13 08:27:40 +01:00
Nicolas Grekas
40d133c29a Merge branch '3.2'
* 3.2:
  [VarDumper] ExceptionCaster robustness fix
2017-03-12 17:08:03 +01:00
Nicolas Grekas
567652621a Merge branch '2.8' into 3.2
* 2.8:
  [VarDumper] ExceptionCaster robustness fix
2017-03-12 17:07:05 +01:00
Nicolas Grekas
9fb17b4499 Merge branch '2.7' into 2.8
* 2.7:
  [VarDumper] ExceptionCaster robustness fix
2017-03-12 17:01:59 +01:00
Nicolas Grekas
6831b984e1 [VarDumper] ExceptionCaster robustness fix 2017-03-12 17:00:52 +01:00
Nicolas Grekas
dc52a3f85c Merge branch '3.2'
* 3.2:
  [VarDumper] Add missing isset() checks in some casters
  [VarDumper] Add missing isset() checks in some casters
  [Form] Choice type int values (BC Fix)
  bumped Symfony version to 3.2.7
  updated VERSION for 3.2.6
  updated CHANGELOG for 3.2.6
  Use PHPUnit 5.4 instead of 5.3
  [PropertyAccess] Use ArrayAdapter in debug mode
  bumped Symfony version to 3.2.6
  updated VERSION for 3.2.5
  updated CHANGELOG for 3.2.5
  cached files rely on umask
2017-03-12 16:46:41 +01:00
Fabien Potencier
5eae2c7005 feature #21978 [DoctrineBridge][Routing] Require PSR-11 container instead of Symfony container (enumag)
This PR was squashed before being merged into the 3.3-dev branch (closes #21978).

Discussion
----------

[DoctrineBridge][Routing] Require PSR-11 container instead of Symfony container

| 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 changed classes can easily use PSR-11 container instead of normal symfony container.

I didn't change any classes that have the `$container` property as protected (for example `Symfony\Bundle\FrameworkBundle\Translation\Translator`) because I'm unsure whether that would be considered a BC break. Let me know if you want me to change such classes as well.

Commits
-------

0043653ea8 [DoctrineBridge][Routing] Require PSR-11 container instead of Symfony container
2017-03-12 08:32:33 -07:00
Jáchym Toušek
0043653ea8 [DoctrineBridge][Routing] Require PSR-11 container instead of Symfony container 2017-03-12 08:32:31 -07:00
Nicolas Grekas
7062e7408a Merge branch '2.8' into 3.2
* 2.8:
  [VarDumper] Add missing isset() checks in some casters
  [Form] Choice type int values (BC Fix)
2017-03-12 16:26:38 +01:00
Fabien Potencier
3c37037138 Merge branch '2.7' into 2.8
* 2.7:
  [Form] Choice type int values (BC Fix)
2017-03-12 08:18:05 -07:00
Nicolas Grekas
d1cadf0dfa bug #21976 [VarDumper] Add missing isset() checks in some casters (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Add missing isset() checks in some casters

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

870c26f [VarDumper] Add missing isset() checks in some casters
2017-03-11 09:32:51 +01:00
Nicolas Grekas
7cbbd8fad4 bug #21973 [VarDumper] Add missing isset() checks in some casters (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[VarDumper] Add missing isset() checks in some casters

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

As spotted by @lyrixx, this is what's causing high mem use on 3.2.
Fix coming to 2.7 (which has very different code base, thus dedicated PR).

Commits
-------

8f0edfb [VarDumper] Add missing isset() checks in some casters
2017-03-11 09:18:47 +01:00
Nicolas Grekas
870c26f39b [VarDumper] Add missing isset() checks in some casters 2017-03-11 09:16:36 +01:00
Nicolas Grekas
8f0edfb10f [VarDumper] Add missing isset() checks in some casters 2017-03-10 23:26:11 +01:00
Fabien Potencier
641092fa16 bug #21957 [Form] Choice type int values (BC Fix) (mcfedr)
This PR was squashed before being merged into the 2.7 branch (closes #21957).

Discussion
----------

[Form] Choice type int values (BC Fix)

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

#21267 unnecessarily forced all choice values to be strings, this was a BC braking change.

Everything can work fine if they are strings or ints. specifically the issue was because `array_flip` is used on the `choices` array, but this function will work fine with ints as well as strings.

Normally, when using HTML forms all data comes as strings, but the `symfony/form` component has use cases beyond this, specifically, I use it with JSON data, where valid values for a `ChoiceType` might not be strings.

Commits
-------

ed211e9c74 [Form] Choice type int values (BC Fix)
2017-03-10 11:10:40 -08:00
Fred Cox
ed211e9c74 [Form] Choice type int values (BC Fix) 2017-03-10 11:10:39 -08:00
Fabien Potencier
dd7c72728a minor #21965 [DependencyInjection Remove duplicated code (GuilhemN)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection Remove duplicated code

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| 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        |

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Arrays are already supported by `YamlFileLoader::resolveServices()` so there's no need to duplicate code.

Commits
-------

1bac3d722d [DependencyInjection Remove duplicated code
2017-03-10 11:07:15 -08:00
Fabien Potencier
e57af1d0f9 minor #21964 [PropertyInfo] Move CHANGELOG.md to the root (GuilhemN)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[PropertyInfo] Move CHANGELOG.md to the root

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| 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        |

Moves the CHANGELOG of the PropertyInfo Component from the DependencyInjection subdirectory to the component's root.

Commits
-------

d5d3f4285b [PropertyInfo] Move CHANGELOG.md to the root
2017-03-10 11:06:28 -08:00
Fabien Potencier
5af9315684 bumped Symfony version to 3.2.7 2017-03-10 10:53:31 -08:00
Fabien Potencier
b0f8a7fa4b Merge pull request #21966 from fabpot/release-3.2.6
released v3.2.6
2017-03-10 10:35:48 -08:00
Fabien Potencier
762dbb13c3 updated VERSION for 3.2.6 2017-03-10 10:35:31 -08:00
Fabien Potencier
f89b9e7894 updated CHANGELOG for 3.2.6 2017-03-10 10:30:45 -08:00
Guilhem Niot
1bac3d722d
[DependencyInjection Remove duplicated code 2017-03-10 18:41:49 +01:00
Guilhem Niot
d5d3f4285b
[PropertyInfo] Move CHANGELOG.md to the root 2017-03-10 18:23:09 +01:00
Grégoire Pineau
ab3b12d6dc [FrameworkBundle][Workflow] Add a way to register a guard expression in the configuration 2017-03-10 11:19:28 +01:00
Grégoire Pineau
aaa1437e3d feature #21950 [Workflow] Added fluent interface to the DefinitionBuilder (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Workflow] Added fluent interface to the DefinitionBuilder

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

---

It seems more logic to me to have this fluent interface.

Commits
-------

4c8963c6ff [Workflow] Added fluent interface to the DefinitionBuilder
2017-03-10 10:57:48 +01:00
Grégoire Pineau
b385ef1625 feature #21933 [FrameworkBundle][Workflow] Add a way to enable the AuditTrail Logger (lyrixx)
This PR was squashed before being merged into the 3.3-dev branch (closes #21933).

Discussion
----------

[FrameworkBundle][Workflow] Add a way to enable the AuditTrail Logger

| 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 will increase the visibility of the Listener. We could encourage people to use at least  `%kernel.debug%` value.

---

Note for the merge: There are two commits, this is done on purpose (2 different things, but easier to do only one PR)

Commits
-------

633c0393b3 [Workflow] Added the workflow name in log generated by AuditTrailListener
b786bccb3a [FrameworkBundle][Workflow] Add a way to enable the AuditTrail Logger
2017-03-10 10:44:46 +01:00
Grégoire Pineau
4c8963c6ff [Workflow] Added fluent interface to the DefinitionBuilder 2017-03-10 10:37:28 +01:00
Nicolas Grekas
b77d97a6a3 bug #21937 [DependencyInjection] Handle void return types in closure-proxy (pierredup)
This PR was squashed before being merged into the 3.3-dev branch (closes #21937).

Discussion
----------

[DependencyInjection] Handle void return types in closure-proxy

| 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

I recently got an error when registering an event listener that specifies a `void` return type. Dumping the container generates a closure proxy that always returns a value, which then conflicts with the return type hint.

E.G the following code is generated (some class names removed for readability)

```
$instance->addListener('kernel.view', /** @closure-proxy ... */ function (...\GetResponseForControllerResultEvent $event): void {
    return ${($_ = isset($this->services[listener']) ? $this->services['listener'] : $this->get('listener')) && false ?: '_'}->onKernelView($event);
}, 128);
```

This then causes the error `A void function must not return a value in ...`

So void return types should be handled by removing the `return` inside the closure

Commits
-------

a5c5ad1 [DependencyInjection] Handle void return types in closure-proxy
2017-03-10 10:24:40 +01:00
Pierre du Plessis
a5c5ad1db1 [DependencyInjection] Handle void return types in closure-proxy 2017-03-10 10:24:38 +01:00
Fabien Potencier
063c8c347e bug #21930 [Cache] Cached files rely on umask (4rthem)
This PR was merged into the 3.2 branch.

Discussion
----------

[Cache] Cached files rely on umask

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

Commits
-------

865a6af153 cached files rely on umask
2017-03-09 15:58:00 -08:00
Nicolas Grekas
add5793e5f bug #21946 Use PHPUnit 5.4 instead of 5.3 (j0k3r)
This PR was merged into the 3.2 branch.

Discussion
----------

Use PHPUnit 5.4 instead of 5.3

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

PHPUnit 5.3 doesn't have the forward compatibility layer for PHPUnit 6 so that `PHPUnit\Framework\TestCase` can be used instead of `PHPUnit_Framework_TestCase`.

This generates an error when upgrading to Symfony 3.2.5 without forcing the `SYMFONY_PHPUNIT_VERSION` const:

```
Class 'PHPUnit\Framework\TestCase' not found in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php on line 25
```

This was introduced by c9684ad31f (from https://github.com/symfony/symfony/pull/21564) in 3.2.5

(Discussion started on Slack: https://symfony-devs.slack.com/archives/support/p1489058629011510)

Commits
-------

fca16ba Use PHPUnit 5.4 instead of 5.3
2017-03-09 14:20:22 +01:00