Commit Graph

21651 Commits

Author SHA1 Message Date
Fabien Potencier
a80b45de51 feature #11394 [Routing] support for array values in route defaults (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Routing] support for array values in route defaults

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

As pointed out in symfony/symfony-docs#4017, the ``XmlFileLoader`` was not capable of defining array default values.

- [x] array values
- [x] integer values
- [x] float values
- [x] boolean

Commits
-------

120b35c [Routing] data type support for defaults
2016-06-23 15:25:46 +02:00
Christian Flothmann
120b35c410 [Routing] data type support for defaults
As pointed out in symfony/symfony-docs#4017, the XmlFileLoader was not
capable of defining array default values. Additionally, this commit
adds support for handling associative arrays, boolean, integer, float
and string data types.
2016-06-23 14:28:23 +02:00
Grégoire Pineau
078e27f139 [Workflow] Added initial set of files 2016-06-23 14:28:20 +02:00
Fabien Potencier
17d59a7c66 added the first more-or-less working version of the Workflow component 2016-06-23 14:28:15 +02:00
Fabien Potencier
9af416d096 feature #19151 [VarDumper] Add support for XmlReader objects (Taluu)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[VarDumper] Add support for XmlReader objects

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

Commits
-------

3779ee4 [VarDumper] Add support for XmlReader objects
2016-06-23 13:55:51 +02:00
Fabien Potencier
43f9514db5 feature #18471 [Console] Add Lockable trait (geoffrey-brier)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] Add Lockable trait

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

Hi there,

Since the 2.6 the `LockHandler` class was added to ease concurrency problems. There was a nice post about [using it in your commands](http://symfony.com/blog/new-in-symfony-2-6-lockhandler).

From my humble experience, I find it a bit unpleasant/time consuming to always copy/paste the same code. So here is my proposal:

Before:

```php
class UpdateContentsCommand extends Command
{
    protected function configure()
    {
        // ...
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        // create the lock
        $lock = new LockHandler('update:contents');
        if (!$lock->lock()) {
            $output->writeln('The command is already running in another process.');

            return 0;
        }

      // Your code

        $lock->release();
    }
}
```

After:

```php
class MyCommand extends Command
{
    use LockableTrait;

    protected function execute(InputInterface $input, OutputInterface $output)
    {
         if (!$this->lock()) {
             // Here you can handle locking errors
         }
        // Your code
        // The lock release is still optionnal
         $this->release();
    }
}
```
In addition, you can optionally pass two arguments:
- a string argument to change the lock name
- a boolean argument to indicate if you want to wait until the requested lock is released

Commits
-------

b57a83f [Console] Add Lockable trait
2016-06-23 13:46:59 +02:00
Geoffrey Brier
b57a83fce6 [Console] Add Lockable trait 2016-06-23 13:42:36 +02:00
Robin Chalas
33402ea747 Add Yaml LintCommand
Add tests

Fix tests & YamlLintCommand help formatting

fabbot fixes

Use Generator to iterate over the filesystem

Move STDIN related code in a method
Use RecursiveIteratorIterator::LEAVES_ONLY rather than SELF_FIRST
Stop using the Finder component when available (Make findFiles() private)
Re-add FrameworkBundle YamlLintCommandTest
Use CommandTester::getStatusCode() rather than assign execute()

Re-add feature for bundle directories, Test it
2016-06-23 13:12:38 +02:00
Baptiste Clavié
3779ee4b31 [VarDumper] Add support for XmlReader objects 2016-06-23 11:26:38 +02:00
Fabien Potencier
e949d348b1 feature #19143 Response headers fix (fabpot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Response headers fix

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

To fix the inconsistency mentioned in #16171, I think the "best" solution would be to add `private` when cache-control is not set, which was the intention but was forgotten.

I propose to make the fix in 3.2 only as it might be a BC break.

Commits
-------

66afa01 [HttpFoundation] added private by default when setting Cache-Control to no-cache
2016-06-23 09:34:16 +02:00
Robin Chalas
a0b4ae724c
Reference changes that ease command testing in 3.2 2016-06-22 21:54:18 +02:00
Fabien Potencier
66afa01057 [HttpFoundation] added private by default when setting Cache-Control to no-cache 2016-06-22 15:19:50 +02:00
Steffen Roßkamp
f7669bedbf [Form] Add a DateInterval form type
Also add dateinterval widget to twig templates.
2016-06-22 13:52:09 +02:00
Fabien Potencier
24e08e9657 feature #18466 [Bridge][Twig] Optionally pass dumper into DumpExtension (CarsonF)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Bridge][Twig] Optionally pass dumper into DumpExtension

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

Allow the dumper to be passed into `DumpExtension` constructor. This allows a different dumper to be used or even just `HtmlDumper` with a non-default configuration, such as different styles.

Note: The dumper's output is ignored.

Commits
-------

d8c0f1d [Bridge][Twig] Optionally pass dumper into DumpExtension
2016-06-22 09:21:58 +02:00
Ener-Getick
d17c1a9734 [DependencyInjection] Sort the CompilerPass by priority 2016-06-21 21:44:32 +02:00
Nicolas Grekas
fce02990f2 bug #19129 Avoid phpunit 5.4 warnings on getMock (master) (iltar)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Avoid phpunit 5.4 warnings on getMock (master)

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

Avoids calling `getMock()` in phpunit 5.4 which will trigger a warning (and thus failing test suite) when used by developers as this TestCase is an extension point.

_in the other branches (opposed to #19128), this was not in the `Test` namespace yet but in `Tests`. Therefore I've only added this in the master as changed by @WouterJ in e938361cf71f78ae5affd454debfca24c31a3cd7._

Commits
-------

eb8c27e Avoid phpunit 5.4 warnings on getMock
2016-06-21 15:40:34 +02:00
Iltar van der Berg
eb8c27e882 Avoid phpunit 5.4 warnings on getMock 2016-06-21 10:07:44 +02:00
Fabien Potencier
26eca5d8c9 bug #19126 [PhpUnitBridge] use call_user_func() for PHP 5.3 compatibility (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[PhpUnitBridge] use call_user_func() for 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        |

Not all callables can be called directly on PHP 5.3 (for example, `array('className', 'methodName')` does not work).

Commits
-------

8549e05 use call_user_func() for PHP 5.3 compatibility
2016-06-21 09:23:35 +02:00
Christian Flothmann
8549e05755 use call_user_func() for PHP 5.3 compatibility
Not all callables can be called directly on PHP 5.3 (for example,
`array('className', 'methodName')` does not work).
2016-06-21 09:14:25 +02:00
Fabien Potencier
a41f359e51 fixed CS 2016-06-21 08:43:40 +02:00
Fabien Potencier
0691506b1b Merge branch '3.1'
* 3.1:
  fixed CS
  fixed CS
  fixed CS
  fixed CS
  tweaked default CS fixer config
  [HttpKernel] Dont close the output stream in debug
  move HttpKernel component to require section
  Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284
  [Session] fix PDO transaction aborted under PostgreSQL
  [Console] Use InputInterface inherited doc as possible
  Mention generating absolute urls in UPGRADE files and CHANGELOG
  parse embedded mappings only if value is a string
  add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support
  FormBuilderInterface: fix getForm() return type.
  [YAML] Fixed parsing problem with nested DateTime lists
  Fixed typo in PHPDoc
2016-06-21 08:41:01 +02:00
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
a39afd001f fixed CS 2016-06-21 08:06:14 +02:00
Fabien Potencier
9cbec2c4fa Merge branch '3.0' into 3.1
* 3.0:
  fixed CS
  fixed CS
  fixed CS
  tweaked default CS fixer config
  [HttpKernel] Dont close the output stream in debug
  move HttpKernel component to require section
  Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284
  [Session] fix PDO transaction aborted under PostgreSQL
  [Console] Use InputInterface inherited doc as possible
  Mention generating absolute urls in UPGRADE files and CHANGELOG
  add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support
  FormBuilderInterface: fix getForm() return type.
  Fixed typo in PHPDoc
2016-06-21 07:59:09 +02:00
Fabien Potencier
be0b8f088f fixed CS 2016-06-21 07:58:59 +02:00
Fabien Potencier
9800cdd8f4 Merge branch '2.8' into 3.0
* 2.8:
  fixed CS
  fixed CS
  tweaked default CS fixer config
  [HttpKernel] Dont close the output stream in debug
  move HttpKernel component to require section
  Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284
  [Session] fix PDO transaction aborted under PostgreSQL
  [Console] Use InputInterface inherited doc as possible
  Mention generating absolute urls in UPGRADE files and CHANGELOG
  add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support
  FormBuilderInterface: fix getForm() return type.
  Fixed typo in PHPDoc
2016-06-21 07:48:46 +02:00
Fabien Potencier
90151ef5c5 fixed CS 2016-06-21 07:43:49 +02:00
Fabien Potencier
548f3d0339 Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
  tweaked default CS fixer config
  [HttpKernel] Dont close the output stream in debug
  move HttpKernel component to require section
  Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284
  [Session] fix PDO transaction aborted under PostgreSQL
  [Console] Use InputInterface inherited doc as possible
  add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support
  FormBuilderInterface: fix getForm() return type.
  Fixed typo in PHPDoc
2016-06-21 07:36:02 +02:00
Fabien Potencier
7cc3ca59d0 fixed CS 2016-06-20 18:47:20 +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
a0cdcb0ffb bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Dont close the reponse stream in debug

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

Because it's `terminate`'s job to clean the state, not the `Response`'s,
and because the current behavior prevents getting any output on trailing errors on FPM especially.

Commits
-------

2fbc200 [HttpKernel] Dont close the output stream in debug
2016-06-20 13:19: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
Christian Flothmann
c4e440c73e [FrameworkBundle] fix argument type docblock 2016-06-20 12:19:51 +02:00
Nicolas Grekas
2fbc2008e5 [HttpKernel] Dont close the output stream in debug 2016-06-20 10:21:56 +02:00
Christian Flothmann
138d0cb493 move HttpKernel component to require section 2016-06-20 09:57:16 +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
9df08fac89 bug #19101 [Session] fix PDO transaction aborted under PostgreSQL (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

[Session] fix PDO transaction aborted under PostgreSQL

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

Fixes the transactional concurrency error handling for PostgreSQL which does not allow to execute further queries in a transaction with an error.
Because of the loop, look at the diff with whitespace ignored to see the difference: https://github.com/symfony/symfony/pull/19101/files?w=1

Commits
-------

f8eefa0 [Session] fix PDO transaction aborted under PostgreSQL
2016-06-19 14:22:58 +02:00
Fabien Potencier
6a8a113fb9 bug #18501 [HttpFoundation] changed MERGE queries (hjkl)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] changed MERGE queries

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

Changed the MERGE queries for Oracle and SQL Server to use question mark parameter markers so they work with emulation disabled or enabled - fixes #17284

Commits
-------

ebf3a2f Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284
2016-06-19 12:25:18 +02:00
Fabien Potencier
41fd5a1f7d minor #19094 [Console] Use InputInterface inherited doc as possible (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Use InputInterface inherited doc as 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        | ~

In classes implementing `InputInterface`, the methods doc blocks are duplicated from the interface.
Sometimes descriptions are different from the interface's ones and, sometimes, the class doc is clearer. So I tried to keep always the most adapted one.

Commits
-------

b604be7 [Console] Use InputInterface inherited doc as possible
2016-06-19 12:24:22 +02:00
Christian Schmidt
fb10b33e8e [Debug] Do not quote numbers in stack trace 2016-06-18 22:40:40 +02:00
Tobias Schultze
7eab67fbb5 minor #19085 FormBuilderInterface: fix getForm() return type. (taueres)
This PR was merged into the 2.7 branch.

Discussion
----------

FormBuilderInterface: fix getForm() return type.

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

FormBuilderInterface->getForm() should depend on abstractions and
not implementations as a return type.

Commits
-------

3fa081c FormBuilderInterface: fix getForm() return type.
2016-06-18 22:20:36 +02:00
hjkl
ebf3a2ffc8 Fixed oci and sqlsrv merge queries when emulation is disabled - fixes #17284 2016-06-18 20:15:19 +01:00
Tobias Schultze
f8eefa0748 [Session] fix PDO transaction aborted under PostgreSQL 2016-06-18 19:15:36 +02:00
Robin Chalas
b604be7084
[Console] Use InputInterface inherited doc as possible 2016-06-18 12:04:12 +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