Commit Graph

26561 Commits

Author SHA1 Message Date
Fabien Potencier
a4ce063029 Revert "feature #18977 [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor() (chalasr)"
This reverts commit 86eb7a3339, reversing
changes made to 856c9f6024.
2016-06-21 08:31:10 +02:00
Fabien Potencier
f2ee67feae Revert "minor #19030 [PropertyAccess] add missing argument PHPdoc (xabbuh)"
This reverts commit 3844fb982f, reversing
changes made to e188cd75b5.
2016-06-21 08:31:05 +02:00
Fabien Potencier
8868e0e1df minor #19116 [Debug] fix resource type test on HHVM (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Debug] fix resource type test on HHVM

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

Commits
-------

2d03ee8 [Debug] fix resource type test on HHVM
2016-06-20 18:09:00 +02:00
Christian Flothmann
2d03ee807f [Debug] fix resource type test on HHVM 2016-06-20 17:51:36 +02:00
Fabien Potencier
693a832892 feature #19090 [Console] Add ConsoleLogger::hasErrored() (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] Add ConsoleLogger::hasErrored()

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

So that it's easy to `exit(1)` whenever any messages have been logged at error levels.

Commits
-------

cfc578a [Console] Add ConsoleLogger::hasErrored()
2016-06-20 13:17:38 +02:00
Fabien Potencier
84d31fa50d minor #19115 [FrameworkBundle] fix argument type docblock (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] fix argument type docblock

| 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/18502#discussion_r67659523
| License       | MIT
| Doc PR        |

Commits
-------

c4e440c [FrameworkBundle] fix argument type docblock
2016-06-20 13:05:28 +02:00
Christian Flothmann
c4e440c73e [FrameworkBundle] fix argument type docblock 2016-06-20 12:19:51 +02:00
Fabien Potencier
92d80c93b3 minor #19111 [Console] simplified tests (fabpot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] simplified tests

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

Commits
-------

85e5060 [Console] simplified tests
2016-06-20 08:56:47 +02:00
Fabien Potencier
85e5060fa1 [Console] simplified tests 2016-06-20 08:34:10 +02:00
Fabien Potencier
88cf87ea64 minor #19097 [Console] Test SymfonyStyle::ask() output (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] Test SymfonyStyle::ask() output

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

Now that we can test an interactive command that uses SymfonyStyle (after #18999), we should test their output.

Commits
-------

e870758 [Console] Test SymfonyStyle::ask() output
2016-06-20 06:58:14 +02:00
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
Robin Chalas
e870758dae
[Console] Test SymfonyStyle::ask() output 2016-06-18 11:47:37 +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
Nicolas Grekas
cfc578add1 [Console] Add ConsoleLogger::hasErrored() 2016-06-17 19:29:15 +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