Commit Graph

27525 Commits

Author SHA1 Message Date
Nicolas Grekas
167c14f248 minor #19998 [DI] Fix expectedException annotation (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[DI] Fix expectedException annotation

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

@paradajozsef FYI, phpunit (at least v4.8 we have to use for PHP 5.5 compat) doesn't resolve use statements in `expectedException` annotations. Thanks for the fix btw.

Commits
-------

663bd74 [DI] Fix expectedException annotation
2016-09-21 09:55:51 +02:00
Nicolas Grekas
663bd74d9f [DI] Fix expectedException annotation 2016-09-21 08:09:36 +02:00
Fabien Potencier
fba0638568 Merge branch '3.1'
* 3.1:
  fixed fixtures
2016-09-20 14:44:13 -07:00
Fabien Potencier
d86fc12365 Merge branch '2.8' into 3.1
* 2.8:
  fixed fixtures
2016-09-20 14:44:00 -07:00
Fabien Potencier
cd1ec1190f fixed fixtures 2016-09-20 14:43:39 -07:00
Fabien Potencier
8f8f4344eb minor #19994 [DependencyInjection] Env parameterbag fix: use the correct exception class. (paradajozsef)
This PR was squashed before being merged into the 3.2-dev branch (closes #19994).

Discussion
----------

[DependencyInjection] Env parameterbag fix: use the correct exception class.

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

Small fix after #19681 No description needed imo. :)

Commits
-------

b016c60 [DependencyInjection] Env parameterbag fix: use the correct exception class.
2016-09-20 14:34:30 -07:00
Paráda József
b016c6029b [DependencyInjection] Env parameterbag fix: use the correct exception class. 2016-09-20 14:34:27 -07:00
Nicolas Grekas
93c0e8adc2 Merge branch '3.1'
* 3.1:
  [VarDumper] Fix extra whitespace
2016-09-20 15:18:26 +02:00
Nicolas Grekas
e42ab5267b Merge branch '2.8' into 3.1
* 2.8:
  [VarDumper] Fix extra whitespace
2016-09-20 15:18:09 +02:00
Nicolas Grekas
00f87aca3a Merge branch '2.7' into 2.8
* 2.7:
  [VarDumper] Fix extra whitespace
2016-09-20 15:16:16 +02:00
Nicolas Grekas
ca0fdf8977 minor #19988 [VarDumper] Fix extra whitespace (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix extra whitespace

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| Tests pass?   | yes
| License       | MIT

Commits
-------

0d9dacc [VarDumper] Fix extra whitespace
2016-09-20 15:15:54 +02:00
Nicolas Grekas
0d9dacc6db [VarDumper] Fix extra whitespace 2016-09-20 15:04:49 +02:00
Christian Flothmann
06875e0b28 feature #19304 [Yaml] fix parsing multi-line mapping values (xabbuh)
This PR was submitted for the 2.7 branch but it was merged into the 3.2-dev branch instead (closes #19304).

Discussion
----------

[Yaml] fix parsing multi-line mapping values

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

Commits
-------

3954530 [Yaml] fix parsing multi-line mapping values
2016-09-20 10:33:53 +02:00
Christian Flothmann
3954530ba7 [Yaml] fix parsing multi-line mapping values 2016-09-20 10:33:13 +02:00
Fabien Potencier
84229f84fb Merge branch '3.1'
* 3.1:
  [TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25)
  Make redis host configurable in tests
  [Console] Fix empty optionnal options with = separator in argv
2016-09-19 13:29:03 -07:00
Fabien Potencier
826fc39dd2 Merge branch '2.8' into 3.1
* 2.8:
  [TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25)
  [Console] Fix empty optionnal options with = separator in argv
2016-09-19 13:28:39 -07:00
Fabien Potencier
4d2cfd08fb Merge branch '2.7' into 2.8
* 2.7:
  [TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25)
  [Console] Fix empty optionnal options with = separator in argv
2016-09-19 13:28:05 -07:00
Fabien Potencier
79e25a9848 bug #19983 [TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25) (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes (more about removing deprecation notices from newer versions of Twig)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a (see twigphp/Twig#2123)
| License       | MIT
| Doc PR        | n/a

Commits
-------

12350c2 [TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25)
2016-09-19 13:27:49 -07:00
Fabien Potencier
12350c2eb1 [TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25) 2016-09-19 12:59:08 -07:00
Fabien Potencier
36c399f632 feature #19191 [DependencyInjection] Automatically detect the definitions class when possible (Ener-Getick)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[DependencyInjection] Automatically detect the definitions class when possible

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

> Thanks to the features of php 7.0 we can now guess the class of a service created with a factory:
> ```php
> function myFactory(): MyServiceClass
> {
> }
> ```
>
> So I propose to create a new pass to automatically update the services definition when possible. This is particularly useful for autowiring (this way you don't have to copy-paste the class name of the service, especially when this is from a third party library).
>
> What do you think ?

Commits
-------

63afe3c [DependencyInjection] Automatically detect the definitions class when possible
2016-09-19 12:25:58 -07:00
Fabien Potencier
8b7c3d38b3 minor #19974 Make redis host configurable in tests (jakzal)
This PR was squashed before being merged into the 3.1 branch (closes #19974).

Discussion
----------

Make redis host configurable in tests

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

Makes running tests on dockerized environments possible, since we can now export the `REDIS_HOST` environment variable:

```
REDIS_HOST=redis ./phpunit src/Symfony/Component/Cache
```

If this gets merged, in master we can later replace the `SYMFONY__REDIS_HOST` usage in the FrameworkBundle with the new `env(REDIS_HOST)`.

Commits
-------

c87de00 Make redis host configurable in tests
2016-09-19 12:25:04 -07:00
Jakub Zalas
c87de00e9a Make redis host configurable in tests 2016-09-19 12:25:01 -07:00
Fabien Potencier
a7a5c52b06 minor #19969 [Security] AccessDeniedException: rename object to subject (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Security] AccessDeniedException: rename object to subject

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

With this change the name is inline with what we use in the base voter
interface.

Commits
-------

9603ffa AccessDeniedException: rename object to subject
2016-09-19 12:21:55 -07:00
Fabien Potencier
fbc66a94d2 bug #19967 [VarDumper] Fix small ClassStub rendering issues (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[VarDumper] Fix small ClassStub rendering issues

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

Commits
-------

7d0cee1 [VarDumper] Fix small ClassStub rendering issues
2016-09-19 12:20:29 -07:00
Nicolas Grekas
b359263623 minor #19964 fixed a deprecation warning in tests (fabpot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

fixed a deprecation warning in tests

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

Commits
-------

9e1589e fixed a deprecation warning in tests
2016-09-19 13:28:39 +02:00
Nicolas Grekas
904f8edf0c minor #19963 fixed a test that do not pass on a Mac (fabpot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

fixed a test that do not pass on a Mac

| Q             | A
| ------------- | ---
| Branch?       | master (test did not exist before)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    |  no
| Deprecations? |  no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

fb0deaa fixed a test that do not pass onMac
2016-09-19 13:27:26 +02:00
Christian Flothmann
9603ffa458 AccessDeniedException: rename object to subject
With this change the name is inline with what we use in the base voter
interface.
2016-09-19 13:01:06 +02:00
Nicolas Grekas
7d0cee175a [VarDumper] Fix small ClassStub rendering issues 2016-09-19 11:10:05 +02:00
Fabien Potencier
9e1589ec6b fixed a deprecation warning in tests 2016-09-18 21:45:47 -07:00
Fabien Potencier
fb0deaa177 fixed a test that do not pass onMac 2016-09-18 21:41:39 -07:00
Fabien Potencier
a86583d226 feature #19745 [Validator] Added context object method callback to choice validator (Peter Bouwdewijn)
This PR was squashed before being merged into the 3.2-dev branch (closes #19745).

Discussion
----------

[Validator] Added context object method callback to choice validator

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

Commits
-------

835dcf3 [Validator] Added context object method callback to choice validator
2016-09-17 12:51:23 -07:00
Peter Bouwdewijn
835dcf338d [Validator] Added context object method callback to choice validator 2016-09-17 12:51:16 -07:00
Fabien Potencier
2d08be14f5 bug #19946 [Console] Fix parsing optionnal options with empty value in argv (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix parsing optionnal options with empty value in argv

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

If a command takes an option accepting an optional value, passing an empty value to this option will make it parsed as `null`, e.g:

`bin/console dummy --foo ""` gives `['foo' => null]`.
`bin/console dummy --foo=""` gives `['foo' => null]`.

Problems appear when adding an argument with a required value (let's call it `bar`):

`bin/console dummy --foo "" "bar-val"` gives `['foo' => null, 'bar' => 'bar-val']` which is OK.

But:

`bin/console dummy --foo="" "bar-val"`

>  [RuntimeException]
  Not enough arguments (missing: "bar").

The empty value is never considered, as `$argv` just return `"--foo="` for the option, the current implementation doesn't handle the empty value when using an equal as separator, so the `bar` argument value is considered  as the `foo` one, giving a missing required argument at runtime.

This fixes it by explicitly considering the empty value if there is nothing immediately after the equal sign, so args/options correctly take their respective values.

Commits
-------

8952155 [Console] Fix empty optionnal options with = separator in argv
2016-09-17 09:41:34 -07:00
Fabien Potencier
bfe0af5afe feature #19614 [HttpKernel] Use VarDumper in the profiler (wouterj, nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[HttpKernel] Use VarDumper in the profiler

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

/cc @javiereguiluz @nicolas-grekas As you're the main maintainers of the changed features.

Summary
---

 * The `varToString()` method is deprecated in favor of `cloneVar()` (using the VarCloner) and `dump()` (using the VarDumper).

   This allows to show more detailed and better formatted data in the profiler.

 * The `Data` class of VarDumper is made serializable, to reduce the size of the stored profiler data.

Screenshots
---

![sf-profiler-dumper](https://cloud.githubusercontent.com/assets/749025/17651142/9bcddc14-6260-11e6-80f6-81b84c82c0a3.png)

Further Improvements
---

 * Change the dump colors (I've now implemented a very basic light theme, but my colorskills are close to zero, so a proper designer should look at it)

Commits
-------

eddecbd [HttpKernel] Use VarDumper in the Logs&Events panels of the profiler
41a7649 [HttpKernel] Use VarDumper in the profiler
2016-09-17 08:50:05 -07:00
Nicolas Grekas
eddecbd112 [HttpKernel] Use VarDumper in the Logs&Events panels of the profiler 2016-09-17 16:23:22 +02:00
WouterJ
41a76494ec [HttpKernel] Use VarDumper in the profiler 2016-09-17 16:23:20 +02:00
Robin Chalas
8952155f92
[Console] Fix empty optionnal options with = separator in argv 2016-09-17 14:42:06 +02:00
Fabien Potencier
c21bed7fed feature #19480 [Config] Fix (Yaml|Xml)ReferenceDumper for nested prototypes (ogizanagi)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Config] Fix (Yaml|Xml)ReferenceDumper for nested prototypes

| 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 tries to fix the nested prototypes case for the `YamlReferenceDumper` and `XmlReferenceDumper`.

### Before
```yml
cms_pages:

    # Prototype
    page:                 []
```

### After

```yml
cms_pages:

    # Prototype
    page:

        # Prototype
        locale:
            title:                ~ # Required
            path:                 ~ # Required
```

~~However, the `YamlReferenceDumperTest::testDumper` is marked as skipped, due to another unsupported prototype usage, but that's another issue (the `connections` key). Thus, the bug fix must be tested manually :/ (I'd recommend to merge #19570 first)~~

Commits
-------

1e80510 [Config] Fix YamlReferenceDumper for nested prototypes
2016-09-16 08:01:32 -07:00
Nicolas Grekas
f532322fe3 bug #19950 [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str() (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Parse source link maps using json_decode() instead of parse_str()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | updated code exists only on master
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19807
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/6944

Because `parse_str()` turns some characters into underscores in keys (e.g. `.`).

Commits
-------

9b174fb [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str()
2016-09-16 15:58:28 +02:00
Nicolas Grekas
9b174fb0c1 [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str() 2016-09-16 15:37:46 +02:00
Nicolas Grekas
2b0df634fb bug #19949 [HttpKernel] Fixed DumpDataCollector destruct (jeremyFreeAgent)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[HttpKernel] Fixed DumpDataCollector destruct

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

Commits
-------

642379f [HttpKernel] Fixed DumpDataCollector destruct
2016-09-16 14:48:39 +02:00
Jérémy Romey
642379f800 [HttpKernel] Fixed DumpDataCollector destruct 2016-09-16 13:29:24 +01:00
Fabien Potencier
c6f6e05e37 minor #19940 [Yaml] Port of #19922 for 3.2 (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Yaml] Port of #19922 for 3.2

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes
| License       | MIT

The command has been moved in 3.2 so the new path is unmerged.

Commits
-------

017e88b [Yaml] Port of #19922 for 3.2
2016-09-15 10:50:15 -07:00
Fabien Potencier
1bcade56e6 feature #19681 [DI] Allow injecting ENV parameters at runtime using %env(MY_ENV_VAR)% (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[DI] Allow injecting ENV parameters at runtime using %env(MY_ENV_VAR)%

| Q             | A
| ------------- | ---
| Branch?       | master
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |  #10138, #7555, #16403, #18155
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/6918

This is an alternative approach to #18155 for injecting env vars into container configurations.

With this PR, anywhere parameters are allowed, one can use `%env(ENV_VAR)%` to inject a dynamic env var. Additionally, if one sets a value to such parameters in e.g. the `parameter.yml` file (`env(ENV_VAR): foo`), this value will be used as a default value when the env var is not defined. If no default value is specified, an `EnvVarNotFoundException` will be thrown at runtime.

Unlike previous attempts that also used parameters (#16403), the implementation is compatible with DI extensions: before being dumped, env vars are resolved to uniquely identifiable string placeholders that can get through DI extensions manipulations. When dumped, these unique placeholders are replaced by dynamic calls to a getEnv method..

ping @magnusnordlander @dzuelke @fabpot

Commits
-------

bac2132 [DI] Allow injecting ENV parameters at runtime using %env(MY_ENV_VAR)% syntax
2016-09-15 10:44:52 -07:00
Maxime STEINHAUSSER
1e8051081c [Config] Fix YamlReferenceDumper for nested prototypes 2016-09-15 16:03:09 +02:00
Robin Chalas
017e88b6a1
[Yaml] Port of #19922 for 3.2 2016-09-15 01:17:14 +02:00
Fabien Potencier
835176c932 Merge branch '3.1'
* 3.1:
  added a comment about a workaround
  [Finder] no PHP warning on empty directory iteration
  [HttpKernel] Fixed the nullable support for php 7.1 and below
  fixed CS
  [Form] Fix typo in doc comment
  Fix version constraint
  [Config] Handle open_basedir restrictions in FileLocator
  Fixed bad merge
  [DoctrineBridge][PropertyInfo] Treat Doctrine decimal type as string
  [bugfix] [Console] Set `Input::$interactive` to `false` when command is executed with `--quiet` as verbosity level
  Use JSON_UNESCAPED_SLASHES for lint commands output
  Fixed collapsed ChoiceType options attributes
  [FrameworkBundle] Remove cache clearer default value in config
  Consider the umask setting when dumping a file.
  Fixed the nullable support for php 7.1 and below
  Make ReflectionExtractor compatible with ReflectionType changes in PHP 7.1
2016-09-14 15:49:28 -07:00
Fabien Potencier
ad7bc0322a Merge branch '2.8' into 3.1
* 2.8:
  added a comment about a workaround
  [Finder] no PHP warning on empty directory iteration
  fixed CS
2016-09-14 15:47:38 -07:00
Fabien Potencier
0ae3838dc6 Merge branch '2.7' into 2.8
* 2.7:
  added a comment about a workaround
  [Finder] no PHP warning on empty directory iteration
  fixed CS
2016-09-14 15:47:13 -07:00
Fabien Potencier
47657e55d2 feature #19197 [Serializer][FrameworkBundle] Add a CSV encoder (dunglas)
This PR was squashed before being merged into the 3.2-dev branch (closes #19197).

Discussion
----------

[Serializer][FrameworkBundle] Add a CSV encoder

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

Usage:

```php
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;

$serializer = new Serializer(array(new ObjectNormalizer()), array(new CsvEncoder()));
// or $serializer = $container->get('serializer'); when using the full stack framework
$serializer->encode($something, 'csv');
$serializer->decode(<<<'CSV'
id,name
1,Kévin
CSV
, 'csv');
```

CSV files must contain a header line with property names as keys.

ping @clementtalleu @Simperfit @gorghoa

Commits
-------

e71f5be [Serializer][FrameworkBundle] Add a CSV encoder
2016-09-14 15:14:31 -07:00