Commit Graph

26549 Commits

Author SHA1 Message Date
Fabien Potencier
414a4b4233 feature #19079 [Debug] Do not quote numbers in stack trace (c960657)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Debug] Do not quote numbers in stack trace

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

In the debug output from the exception handler, integers and floats are quoted. This adds unnecessary noise to the error page and is just wrong.

Fixing this requires introduces two new type descriptions in the output from getTrace(), so the change is not fully backwards compatible.

Commits
-------

fb10b33 [Debug] Do not quote numbers in stack trace
2016-06-19 12:27:18 +02:00
Christian Schmidt
fb10b33e8e [Debug] Do not quote numbers in stack trace 2016-06-18 22:40:40 +02:00
Fabien Potencier
afed2f888d feature #19012 [Console] progress bar fix (TomasVotruba, fabpot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] progress bar fix

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

This is #16490 where I've simplified the code as much as possible and added a test for the bug we're trying to fix.

The main change is the renaming of the `TerminalDimensionsProvider` to just `Terminal`. The new class can probably be useful to add more about the terminal.

Commits
-------

2f81247 switched to use COLUMNS and LINES env vars to change terminal dimensions
bf7a5c5 fixed logic
a589635 deprecated some Console Application methods
8f206c8 fixed CS, simplified code
b030c24 [Console] ProgressBar - adjust to the window width (static)
2016-06-17 19:52:18 +02:00
Fabien Potencier
40f4c57eb3 feature #19047 [Cache] Add tags based invalidation + TagAwareRedisAdapter (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Cache] Add tags based invalidation + TagAwareRedisAdapter

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

Commits
-------

19764af [Cache] Add tags based invalidation + TagAwareRedisAdapter
2016-06-17 19:46:12 +02:00
Fabien Potencier
2f81247005 switched to use COLUMNS and LINES env vars to change terminal dimensions 2016-06-17 19:36:07 +02:00
Fabien Potencier
bf7a5c58a9 fixed logic 2016-06-17 19:36:07 +02:00
Fabien Potencier
a589635643 deprecated some Console Application methods 2016-06-17 19:36:07 +02:00
Fabien Potencier
8f206c86d7 fixed CS, simplified code 2016-06-17 19:36:07 +02:00
Tomas Votruba
b030c24263 [Console] ProgressBar - adjust to the window width (static) 2016-06-17 19:36:07 +02:00
Fabien Potencier
7ccfdb4016 feature #17644 Deprecate using Form::isValid() with an unsubmitted form (Ener-Getick)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Deprecate using Form::isValid() with an unsubmitted form

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #7737
| License       | MIT
| Doc PR        | not yet

> I'm calling out for you to decide how to resolve the inconsistency between the Form::isValid() method and the ``valid`` variable available in the template:
>
> - ``isValid()`` returns ``false`` if a form was not submitted. This way it is possible to write concise controller code:
>
> ```php
> $form = $this->createForm(...);
> $form->handleRequest($request);
> if ($form->isValid()) {
>     // only executed if the form is submitted AND valid
> }
> ```
>
> - ``valid`` contains ``true`` if a form was not submitted. This way it is possible to rely on this variable for error styling of a form.
>
> ```twig
> <div{% if not form.vars.valid %} class="error"{% endif %}>
> ```
>
> We have two alternatives for resolving this problem:
>
> 1. Leave the inconsistency as is.
> 2. Make ``isValid()`` return ``true`` if a form was not submitted (consistent with ``valid``)
> 3. Revert to the 2.2 behavior of throwing an exception if ``isValid()`` is called on a non-submitted form (not consistent with ``valid``).
>
> Both 2. and 3. will require additional code in the controller:
>
> ```php
> $form = $this->createForm(...);
> $form->handleRequest($request);
> if ($form->isSubmitted() && $form->isValid()) {
>     // only executed if the form is submitted AND valid
> }
> ```
>
> What do you think?

This PR implements the option 3 as it was the most chosen in #7737

Commits
-------

2c3a7cc Deprecate using Form::isValid() with an unsubmitted form
2016-06-17 19:33:12 +02:00
Ener-Getick
2c3a7cc532
Deprecate using Form::isValid() with an unsubmitted form 2016-06-17 18:23:40 +02:00
Nicolas Grekas
19764af74f [Cache] Add tags based invalidation + TagAwareRedisAdapter 2016-06-17 17:55:45 +02:00
Fabien Potencier
22f7ed7d9e bug #19088 [Routing] treat fragment after resolving query string params (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Routing] treat fragment after resolving query string params

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

The implementation from #12979 led to a conflict with #18280 which was merged in the meantime.

Commits
-------

7475aa8 treat fragment after resolving query string params
2016-06-17 16:25:43 +02:00
Christian Flothmann
7475aa8a48 treat fragment after resolving query string params 2016-06-17 16:10:03 +02:00
Fabien Potencier
6f05632bc2 bug #19029 [YAML] Fixed parsing problem with nested DateTime lists (jkphl)
This PR was squashed before being merged into the 3.2-dev branch (closes #19029).

Discussion
----------

[YAML] Fixed parsing problem with nested DateTime lists

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

___

Without this fix, DateTime-aware parsing of a YAML source containing nested lists of dates result in an error. Consider this:

```php
$data = ['date' => ['annivesary' => new \DateTime('now')]];
$yaml = Yaml::dump($data);
var_dump($yaml);

$parsed = Yaml::parse($yaml, Yaml::PARSE_DATETIME);
print_r($parsed);
```

Everything is fine, result is:

```
string(48) "date:
    annivesary: 2016-06-11T11:26:30+02:00
"
Array
(
    [date] => Array
        (
            [annivesary] => DateTime Object
                (
                    [date] => 2016-06-11 11:26:30.000000
                    [timezone_type] => 1
                    [timezone] => +02:00
                )

        )

)
```

But making the `anniversary` a list of dates

```php
$data = ['date' => ['annivesary' => [new \DateTime('now')]]];
$yaml = Yaml::dump($data);
var_dump($yaml);

$parsed = Yaml::parse($yaml, Yaml::PARSE_DATETIME);
print_r($parsed);
```

will result in:

```
string(50) "date:
    annivesary: [2016-06-11T12:00:05+02:00]
"
PHP Warning:  strpos() expects parameter 1 to be string, object given in [...]\vendor\symfony\yaml\Inline.php on line 382
PHP Catchable fatal error:  Object of class DateTime could not be converted to string in [...]\vendor\symfony\yaml\Inline.php on line 386
```

(I didn't capture the error messages with the most recent master branch, so line numbers differ somewhat)

Commits
-------

52384cf [YAML] Fixed parsing problem with nested DateTime lists
2016-06-16 21:29:32 +02:00
Joschi Kuphal
52384cf2e5 [YAML] Fixed parsing problem with nested DateTime lists 2016-06-16 21:29:29 +02:00
Fabien Potencier
61e5ddc106 feature #12979 [Router] added appending of new optional document fragment (rodnaph)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Router] added appending of new optional document fragment

added a new optional parameter to the generate method for the document fragment. when specified this is appended to generated urls.

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

Commits
-------

6d79a56 [Routing] adds _fragment special option to url generation for document fragment
2016-06-16 18:09:07 +02:00
Fabien Potencier
4742962c74 feature #18710 [Console] Simplify simulation of user inputs in CommandTester (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] Simplify simulation of user inputs in CommandTester

| 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        | https://github.com/symfony/symfony-docs/pull/6623

After @javiereguiluz pointed it in #17470, I open this PR to simplify the simulation of user inputs for testing a Command.
It would be done by calling `CommandTester::setUserInputs()` with an array of inputs as argument, and so make the CommandTester creating an input stream from the inputs set by the developer, then call `QuestionHelper::setInputStream` and assign it to the helperSet of the command, sort as all is done automatically in one call.

Depends on #18999

Commits
-------

c7ba38a [Console] Set user inputs from CommandTester
2016-06-16 16:59:22 +02:00
Nicolas Grekas
dbee09298c minor #19073 Fix the missing colon in get/setInputStream deprecation warning (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Fix the missing colon in get/setInputStream deprecation warning

| 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/19072#discussion_r67310243
| License       | MIT
| Doc PR        | ~

Commits
-------

0d6dc8e Fix the missing colon in get/setInputStream deprecation warning
2016-06-16 11:28:17 +02:00
Robin Chalas
0d6dc8efca Fix the missing colon in get/setInputStream deprecation warning 2016-06-16 11:23:07 +02:00
Nicolas Grekas
000595867a minor #19072 [Console] remove BC breaking argument (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] remove BC breaking argument

| 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/pull/18999#discussion_r67304012
| License       | MIT
| Doc PR        |

Commits
-------

f574330 remove BC breaking argument
2016-06-16 11:20:08 +02:00
Christian Flothmann
f574330be4 remove BC breaking argument 2016-06-16 10:59:45 +02:00
Nicolas Grekas
a627bbac05 Merge branch '3.1'
* 3.1:
  Fix merge
2016-06-16 10:34:19 +02:00
Nicolas Grekas
33636c7330 Merge branch '3.0' into 3.1
* 3.0:
  Fix merge
2016-06-16 10:34:05 +02:00
Nicolas Grekas
22a1105f42 Fix merge 2016-06-16 10:33:40 +02:00
Nicolas Grekas
9a6bc4bc31 Merge branch '3.1'
* 3.1:
  Tweak merge
  update tests to use the new error assertion helper
  [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev
  update tests to use the new error assertion helper

Conflicts:
	src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
2016-06-16 10:32:17 +02:00
Nicolas Grekas
4a15e665ba minor #19067 [3.1] update tests to use the new error assertion helper (xabbuh)
This PR was merged into the 3.1 branch.

Discussion
----------

[3.1] update tests to use the new error assertion helper

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

Commits
-------

9c7512b update tests to use the new error assertion helper
2016-06-16 10:28:45 +02:00
Nicolas Grekas
aaa40390dc Merge branch '3.0' into 3.1
* 3.0:
  Tweak merge
  update tests to use the new error assertion helper
  [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev
2016-06-16 10:27:44 +02:00
Nicolas Grekas
8da9a387d7 Tweak merge 2016-06-16 10:27:19 +02:00
Nicolas Grekas
bd39ce84b6 Merge branch '2.8' into 3.0
* 2.8:
  update tests to use the new error assertion helper
  [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev

Conflicts:
	src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
	src/Symfony/Component/Yaml/Tests/ParserTest.php
2016-06-16 10:25:06 +02:00
Nicolas Grekas
f8937bd8b8 minor #19066 [2.8] update tests to use the new error assertion helper (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8] update tests to use the new error assertion helper

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

Commits
-------

e5cf4d4 update tests to use the new error assertion helper
2016-06-16 10:19:53 +02:00
Christian Flothmann
e5cf4d424b update tests to use the new error assertion helper 2016-06-16 10:10:24 +02:00
Robin Chalas
c7ba38a7c2 [Console] Set user inputs from CommandTester
Rename getInputStream() to getStream(), taking inputs as argument

Make createStream static, typehint  as array
2016-06-16 09:44:16 +02:00
Nicolas Grekas
8ed6f40a24 Merge branch '2.7' into 2.8
* 2.7:
  [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev
2016-06-16 09:28:05 +02:00
Nicolas Grekas
d810648c24 minor #19070 [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[ci] Upgrade to symfony/phpunit-bridge >=3.2@dev

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

c12b666 [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev
2016-06-16 09:27:46 +02:00
Nicolas Grekas
c12b66664f [ci] Upgrade to symfony/phpunit-bridge >=3.2@dev 2016-06-16 09:20:06 +02:00
Fabien Potencier
9759a359f5 feature #18999 [Console] Centralize input stream in base Input class (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] Centralize input stream in base Input class

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

Actually we have two classes that have an `inputStream` property with its getter+setter:
the QuestionHelper ('question' helper) and the SymfonyQuestionHelper (used via SymfonyStyle, that inherits the inputStream from the QuestionHelper class).

This situation makes command testing really hard.
ATM we can't test a command that uses `SymfonyStyle::ask` without ugly hacks, and we can't find a generic way to set the inputs passed to a command from the CommandTester, as it need to be done on a specific helper that may not be the one used by the command (SymfonyStyle case).

What I propose here is to add a `stream` property (and its getter+setter) to the abstract `Symfony\Component\Console\Input\Input` class.

For now I just made the two helpers setting their `inputStream` from `Input::getStream`, as both QuestionHelper and SymfonyQuestionHelper classes have an `ask` method that takes the command Input as argument.
In a next time (4.0), we could remove the `getInputStream` and `setInputStream` methods from the QuestionHelper class (this only deprecates them in favor of Input `setStream` and `getStream`).

This would close PR #18902 (trying to make interactive command testing with SymfonyStyle easier).
This would also make PR #18710 widely better by setting the input stream in a generic way (working for both helpers without caring about if they are used and which one is used).

Please give me your opinions.

Commits
-------

54d3d63 Centralize input stream in base Input class
2016-06-16 08:25:44 +02:00
Nicolas Grekas
614d6ba55c Minor tweaks 2016-06-16 07:42:39 +02:00
Nicolas Grekas
57213a164c minor #19068 [PHPUnitBridge] PHP 5.3 compatibility (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[PHPUnitBridge] PHP 5.3 compatibility

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

e65ec65 [PHPUnitBridge] PHP 5.3 compatibility
2016-06-16 07:39:00 +02:00
Christian Flothmann
9c7512bf39 update tests to use the new error assertion helper 2016-06-16 07:34:55 +02:00
Christian Flothmann
e65ec65515 [PHPUnitBridge] PHP 5.3 compatibility 2016-06-16 07:31:00 +02:00
Nicolas Grekas
3a3801a07c Merge branch '3.1'
* 3.1:
  [TwigBridge] Add missing type hint to TwigRenderer
  [HttpFoundation] Fix UPSERT for PgSql >= 9.5
  [Form] fixed DateTime transformers
  [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't
  bumped Symfony version to 3.1.2
  updated VERSION for 3.1.1
  updated CHANGELOG for 3.1.1
  [Form] fixed EntityType test with query_builder option

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/PropertyAccess/PropertyAccessor.php
2016-06-16 07:23:20 +02:00
Nicolas Grekas
969e3b1ded Merge branch '3.0' into 3.1
* 3.0:
  [TwigBridge] Add missing type hint to TwigRenderer
  [HttpFoundation] Fix UPSERT for PgSql >= 9.5
  [Form] fixed DateTime transformers
  [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't
  [Form] fixed EntityType test with query_builder option

Conflicts:
	src/Symfony/Component/HttpFoundation/Cookie.php
2016-06-16 07:20:30 +02:00
Nicolas Grekas
d2786ad21a Merge branch '2.8' into 3.0
* 2.8:
  [HttpFoundation] Fix UPSERT for PgSql >= 9.5
  [Form] fixed DateTime transformers
  [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't
  [Form] fixed EntityType test with query_builder option

Conflicts:
	src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php
	src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php
2016-06-16 07:18:30 +02:00
Nicolas Grekas
8060715778 Merge branch '2.7' into 2.8
* 2.7:
  [HttpFoundation] Fix UPSERT for PgSql >= 9.5
  [Form] fixed DateTime transformers
  [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't
2016-06-16 07:02:45 +02:00
Nicolas Grekas
37d39c6be9 bug #19062 [HttpFoundation] Fix UPSERT for PgSql >= 9.5 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] Fix UPSERT for PgSql >= 9.5

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

Commits
-------

ff1f5f8 [HttpFoundation] Fix UPSERT for PgSql >= 9.5
2016-06-16 06:56:55 +02:00
Nicolas Grekas
4d8d083207 minor #19065 [TwigBridge] Add missing type hint to TwigRenderer (enumag)
This PR was merged into the 3.0 branch.

Discussion
----------

[TwigBridge] Add missing type hint to TwigRenderer

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

Commits
-------

dd481d2 [TwigBridge] Add missing type hint to TwigRenderer
2016-06-16 06:55:53 +02:00
Jáchym Toušek
dd481d2233 [TwigBridge] Add missing type hint to TwigRenderer 2016-06-15 23:06:35 +02:00
Fabien Potencier
e9e0975f22 feature #19060 [ExpressionLanguage] Add a way to hook on each node when dumping the AST (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[ExpressionLanguage] Add a way to hook on each node when dumping the AST

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

This is an iteration over #19013 to allow writing dumpers that can decorate dumps (e.g. add HTML tags based on each node type to do syntax highlighting).

Commits
-------

66d23db [ExpressionLanguage] Add a way to hook on each node when dumping the AST
2016-06-15 18:22:57 +02:00
Fabien Potencier
5e9f58f2fe feature #18880 [PhpUnitBridge] add a triggered errors assertion helper (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[PhpUnitBridge] add a triggered errors assertion helper

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

In the past, we updated the test code several times that made sure that deprecation messages are triggered. I think we should move this code to a reusable class in the PhpUnitBridge to make it available everywhere and to be able to change a single method in case we need to update the logic.

Commits
-------

b5c2095 add a triggered errors assertion helper
2016-06-15 18:21:42 +02:00