Commit Graph

26933 Commits

Author SHA1 Message Date
Fabien Potencier
a5a03aab9e Merge branch '3.1'
* 3.1:
  fixed bad merge
  Fix PHP 7.1 related failures
  [VarDumper] Fix for 7.1
  fixed CS
  Added class existence check if is_subclass_of() fails in compiler passes
  Fix the DBAL session handler version check for Postgresql
2016-07-19 12:47:02 +02:00
Fabien Potencier
00f1b7bb09 Merge branch '3.0' into 3.1
* 3.0:
  fixed bad merge
2016-07-19 12:46:42 +02:00
Fabien Potencier
b2f3a8b520 fixed bad merge 2016-07-19 12:46:18 +02:00
Fabien Potencier
ad7db01e1c Merge branch '3.0' into 3.1
* 3.0:
  Fix PHP 7.1 related failures
  [VarDumper] Fix for 7.1
  fixed CS
  Added class existence check if is_subclass_of() fails in compiler passes
  Fix the DBAL session handler version check for Postgresql
2016-07-19 12:45:57 +02:00
Fabien Potencier
89bb250b5c Merge branch '2.8' into 3.0
* 2.8:
  Fix PHP 7.1 related failures
  [VarDumper] Fix for 7.1
  fixed CS
  Added class existence check if is_subclass_of() fails in compiler passes
  Fix the DBAL session handler version check for Postgresql
2016-07-19 12:44:15 +02:00
Fabien Potencier
15ab32bf9b Merge branch '2.7' into 2.8
* 2.7:
  Fix PHP 7.1 related failures
  [VarDumper] Fix for 7.1
2016-07-19 12:40:24 +02:00
Fabien Potencier
37cd583e78 bug #19384 Fix PHP 7.1 related failures (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix PHP 7.1 related failures

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

PHP 7.1 triggers notices on previously silent implicit type changes.

Commits
-------

07467ed Fix PHP 7.1 related failures
2016-07-19 12:36:45 +02:00
Nicolas Grekas
07467ed3a3 Fix PHP 7.1 related failures 2016-07-19 10:44:18 +02:00
Fabien Potencier
37b299bb3e bug #19379 [VarDumper] Fix for PHP 7.1 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix for PHP 7.1

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

Tests fail on 7.1 otherwise

Commits
-------

d422939 [VarDumper] Fix for 7.1
2016-07-18 16:29:02 +02:00
Fabien Potencier
583a45d91f feature #19276 [ClassLoader] Add ClassCollectionLoader::inline() to generate inlined-classes files (nicolas-grekas)
This PR was squashed before being merged into the 3.2-dev branch (closes #19276).

Discussion
----------

[ClassLoader] Add ClassCollectionLoader::inline() to generate inlined-classes files

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

Unfortunately, can't be tested because the method relies too much on side effects.
Coupled with https://github.com/sensiolabs/SensioDistributionBundle/pull/272, allows inlining `ClassCollectionLoader` itself into the `bootstrap.php.cache` file.

Commits
-------

88fdcea [ClassLoader] Add ClassCollectionLoader::inline() to generate inlined-classes files
2016-07-18 14:56:02 +02:00
Nicolas Grekas
88fdceadd4 [ClassLoader] Add ClassCollectionLoader::inline() to generate inlined-classes files 2016-07-18 14:55:56 +02:00
Nicolas Grekas
d422939f6c [VarDumper] Fix for 7.1 2016-07-18 14:55:17 +02:00
Fabien Potencier
00ab2d661f bug #19342 Added class existence check if is_subclass_of() fails in compiler passes (SCIF)
This PR was merged into the 2.8 branch.

Discussion
----------

Added class existence check if is_subclass_of() fails in compiler passes

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

If you create an event subscriber and make typo in file name it will cause next error:

```
  [InvalidArgumentException]
  Service "event.notification_subscriber" must implement interface "Symfony\Component\EventDispatcher\EventSubscriberInterface".
```

That's because of `is_subclass_of()` fails on class absentee. I made error message more clear.

Commits
-------

72db6e7 Added class existence check if is_subclass_of() fails in compiler passes
2016-07-18 13:36:17 +02:00
Christophe Coevoet
88aff45c4d Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
  Fix the DBAL session handler version check for Postgresql
2016-07-18 11:48:43 +02:00
Fabien Potencier
56c720693d feature #19325 [FrameworkBundle] Allow to specify a domain when updating translations (antograssiot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Allow to specify a domain when updating translations

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

The MR add the `--domain` option to the `translation:update` console command
When working with large number of domains, this helps to reduce the noise in the diff when updating only a translation file.

Commits
-------

a8f3a93 [FrameworkBundle] Allow to specify a domain when updating translations
2016-07-18 11:47:07 +02:00
Fabien Potencier
1376e14e7e fixed CS 2016-07-18 11:42:57 +02:00
Fabien Potencier
28029a2ed1 bug #19369 Fix the DBAL session handler version check for Postgresql (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix the DBAL session handler version check for Postgresql

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

https://github.com/symfony/symfony/pull/19048 broken the DBAL session handler when using Postgresql by using method which does not exist on the main DBAL Connection class.

Commits
-------

e98c584 Fix the DBAL session handler version check for Postgresql
2016-07-18 11:41:50 +02:00
Alexander Zhuravlev
72db6e7068 Added class existence check if is_subclass_of() fails in compiler passes 2016-07-18 19:09:40 +12:00
antograssiot
a8f3a93874 [FrameworkBundle] Allow to specify a domain when updating translations 2016-07-18 06:58:23 +02:00
Nicolas Grekas
cbd1915a2e Merge branch '3.1'
* 3.1:
  [VarDumper] Fix dumping jsons casted as arrays
  PassConfig::getMergePass is not an array
  Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)"
  [Serializer] Include the format in the cache key
  Fix the retrieval of the last username when using forwarding
  [Yaml] Fix PHPDoc of the Yaml class
  [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods
  Update getAbsoluteUri() for query string uris

Conflicts:
	src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
	src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
2016-07-17 16:08:33 +02:00
Nicolas Grekas
17de127281 Merge branch '3.0' into 3.1
* 3.0:
  [VarDumper] Fix dumping jsons casted as arrays
  PassConfig::getMergePass is not an array
  Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)"
  Fix the retrieval of the last username when using forwarding
  [Yaml] Fix PHPDoc of the Yaml class
  [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods
  Update getAbsoluteUri() for query string uris

Conflicts:
	src/Symfony/Component/Yaml/Yaml.php
2016-07-17 16:02:08 +02:00
Nicolas Grekas
8a2d5cd1df Merge branch '2.8' into 3.0
* 2.8:
  [VarDumper] Fix dumping jsons casted as arrays
  PassConfig::getMergePass is not an array
  Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)"
  Fix the retrieval of the last username when using forwarding
  [Yaml] Fix PHPDoc of the Yaml class
  [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods
  Update getAbsoluteUri() for query string uris
2016-07-17 15:54:30 +02:00
Nicolas Grekas
7a57903fd8 Merge branch '2.7' into 2.8
* 2.7:
  [VarDumper] Fix dumping jsons casted as arrays
  PassConfig::getMergePass is not an array
  Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)"
  Fix the retrieval of the last username when using forwarding
  [Yaml] Fix PHPDoc of the Yaml class
  [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods
  Update getAbsoluteUri() for query string uris
2016-07-17 11:06:15 +02:00
Nicolas Grekas
45907598bc bug #19368 [VarDumper] Fix dumping jsons casted as arrays (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix dumping jsons casted as arrays

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

Commits
-------

56549e7 [VarDumper] Fix dumping jsons casted as arrays
2016-07-17 11:05:05 +02:00
Nicolas Grekas
56549e7a70 [VarDumper] Fix dumping jsons casted as arrays 2016-07-16 15:16:34 +02:00
Christophe Coevoet
e98c5841da Fix the DBAL session handler version check for Postgresql 2016-07-15 19:07:32 +02:00
Fabien Potencier
d303b9dffe minor #19343 PassConfig::getMergePass is not an array (aschempp)
This PR was squashed before being merged into the 2.7 branch (closes #19343).

Discussion
----------

PassConfig::getMergePass is not an array

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

Just a minor glitch my IDE noticed :-)

Commits
-------

edbefac PassConfig::getMergePass is not an array
2016-07-14 11:24:46 +02:00
Andreas Schempp
edbefacdd1 PassConfig::getMergePass is not an array 2016-07-14 11:24:45 +02:00
Fabien Potencier
482e185daf Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)"
This reverts commit a0cdcb0ffb, reversing
changes made to 9c8a3e9563.
2016-07-13 12:53:11 +02:00
Fabien Potencier
30997a4005 bug #19334 [Security] Fix the retrieval of the last username when using forwarding (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Fix the retrieval of the last username when using forwarding

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

When using forwarding to render the login page (which is not the default), the info are stored in the subrequest attributes rather than the session. ``getLastAuthenticationError`` was handling this properly but ``getLastUsername`` was not checking the attributes.
This fixes it by checking the attributes (I'm checking them before the session, to be consistent with ``getLastAuthenticationError``)

Commits
-------

e041365 Fix the retrieval of the last username when using forwarding
2016-07-13 10:42:38 +02:00
Fabien Potencier
cf691fb51f bug #19352 [Serializer] Include the format in the cache key (dunglas)
This PR was squashed before being merged into the 3.1 branch (closes #19352).

Discussion
----------

[Serializer] Include the format in the cache key

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

Attributes to normalize can vary by format. For instance in API Platform normalized attributes aren't the same in JSON-LD (all attributes) and HAL (relations are not serialized in the document body).
This PR fixes that.

Commits
-------

282eb9c [Serializer] Include the format in the cache key
2016-07-13 10:40:10 +02:00
Kévin Dunglas
282eb9c410 [Serializer] Include the format in the cache key 2016-07-13 10:40:09 +02:00
Christian Flothmann
031b85029e Merge branch '3.1'
* 3.1:
  [DoctrineBridge] add missing error code
2016-07-12 10:09:12 +02:00
Christophe Coevoet
e04136524c Fix the retrieval of the last username when using forwarding 2016-07-11 11:55:50 +02:00
Kévin Dunglas
c221908fc4
feature #19277 [Serializer] Argument objects (theofidry, dunglas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Serializer] Argument objects

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

Assuming with have the two following entities:

```php
namespace AppBundle\Entity;

class Dummy
{
    public function __construct(int $id, string $name, string $email, AnotherDummy $anotherDummy)
    {
        $this->id = $id;
        $this->name = $name;
        $this->email = $email;
        $this->anotherDummy = $anotherDummy;
    }
}

class AnotherDummy
{
    public function __construct(int $id, string $uuid, bool $isEnabled)
    {
        $this->id = $id;
        $this->uuid = $uuid;
        $this->isEnabled = $isEnabled;
    }
}
```

Doing the following will fail:

```php
$serializer->denormalize(
    [
        'id' => $i,
        'name' => 'dummy',
        'email' => 'du@ex.com',
        'another_dummy' => [
            'id' => 1000 + $i,
            'uuid' => 'azerty',
            'is_enabled' => true,
        ],
    ],
    \AppBundle\Entity\Dummy::class
);
```

with a type error, because the 4th argument passed to `Dummy::__construct()` will be an array. The following patch checks if the type of the argument is an object, and if it is tries to denormalize that object as well.

I'm not sure if it's me missing something or this is a use case that has been omitted (willingly or not), but if it's a valuable patch I would be happy to work on finishing it.

Commits
-------

988eba1 fix tests
98bcb91 Merge pull request #1 from dunglas/theofidry-feature/param-object
7b5d55d Prevent BC in instantiateObject
e437e04 fix reflection type
3fe9802 revert CS
5556fa5 fix
d4cdb00 fix CS
93608dc Add deprecation message
f46a176 Apply patch
f361e52 fix tests
4884a2e f1
e64e999 Address comments
e99a90b Add tests
7bd4ac5 Test
2016-07-11 09:50:44 +02:00
Fabien Potencier
b38d8d987c minor #19331 [Form][#16809] add missing pad property (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Form][#16809] add missing pad property

| 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/16809#discussion_r70184261
| License       | MIT
| Doc PR        |

Commits
-------

647e6ba [#16809] add missing pad property
2016-07-11 09:22:18 +02:00
Fabien Potencier
414d9efd02 minor #19333 [DoctrineBridge] add missing error code (xabbuh)
This PR was merged into the 3.1 branch.

Discussion
----------

[DoctrineBridge] add missing error code

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

Commits
-------

1ea90c3 [DoctrineBridge] add missing error code
2016-07-11 09:21:18 +02:00
Christian Flothmann
5922d715d8 minor #19327 [Yaml] Fix PHPDoc of the Yaml class (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #19327).

Discussion
----------

[Yaml] Fix PHPDoc of the Yaml class

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

The YAML dumper is able to serialize any PHP type, not just arrays.

Commits
-------

a3fd991 [Yaml] Fix PHPDoc of the Yaml class
2016-07-11 09:20:57 +02:00
Kévin Dunglas
a3fd991c4b [Yaml] Fix PHPDoc of the Yaml class 2016-07-11 09:20:55 +02:00
Christian Flothmann
1ea90c3e14 [DoctrineBridge] add missing error code 2016-07-10 22:39:03 +02:00
Christian Flothmann
647e6ba660 [#16809] add missing pad property 2016-07-10 22:13:20 +02:00
Théo FIDRY
988eba11b6
fix tests 2016-07-10 18:16:12 +01:00
Théo FIDRY
98bcb91d13 Merge pull request #1 from dunglas/theofidry-feature/param-object
Prevent BC in instantiateObject
2016-07-10 17:56:24 +01:00
Kévin Dunglas
7b5d55d5f0
Prevent BC in instantiateObject 2016-07-10 18:25:31 +02:00
Fabien Potencier
500c2cd694 bug #19321 [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #19321).

Discussion
----------

[HttpFoundation] Add OPTIONS and TRACE to the list of safe methods

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

According to [RFC 7231](https://tools.ietf.org/html/rfc7231#section-8.1.3) `OPTIONS` and `TRACE` are safe methods.

Commits
-------

1404607 [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods
2016-07-10 11:40:50 +02:00
Kévin Dunglas
1404607072 [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods 2016-07-10 11:40:48 +02:00
Fabien Potencier
8b6d74e1e7 bug #19317 [BrowserKit] Update Client::getAbsoluteUri() for query string only URIs (georaldc)
This PR was merged into the 2.7 branch.

Discussion
----------

[BrowserKit] Update Client::getAbsoluteUri() for query string only URIs

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

This PR allows BrowserKit to treat a value containing only query string parameters the same way anchor/hash values are treated when passed as a URI argument to the getAbsoluteUri() method. Helps when encountering sites that force a redirect with a location header value containing only a query string.

Commits
-------

965408f Update getAbsoluteUri() for query string uris
2016-07-10 11:39:24 +02:00
Fabien Potencier
0fc2b622e8 feature #19322 [HttpFoundation] Add Request::isMethodIdempotent method (dunglas)
This PR was squashed before being merged into the 3.2-dev branch (closes #19322).

Discussion
----------

[HttpFoundation] Add Request::isMethodIdempotent method

| 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        | n/a

Addd a new method in the spirit of `isMethodSafe` to know if the current method is idempotent according to RFCs.

Commits
-------

44df6a4 [HttpFoundation] Add Request::isMethodIdempotent method
2016-07-10 11:37:41 +02:00
Kévin Dunglas
44df6a4677 [HttpFoundation] Add Request::isMethodIdempotent method 2016-07-10 11:37:40 +02:00
Nicolas Grekas
36ec08563e Merge branch '3.1'
* 3.1:
  [HttpKernel] fixed internal subrequests having an if-modified-since-header
  [Security] Fix deprecated usage of DigestAuthenticationEntryPoint::getKey() in DigestAuthenticationListener
  [Validator] Added additional MasterCard range to the CardSchemeValidator
  Make the exception message more clear.
  [Form] fixed bug - name in ButtonBuilder
  [DoctrineBridge] added missing error code for constraint.
  [ClassLoader] Fix declared classes being computed when not needed
  [varDumper] Fix missing usage of ExceptionCaster::$traceArgs
2016-07-10 10:06:43 +02:00