Commit Graph

17765 Commits

Author SHA1 Message Date
Fabien Potencier 30bd397366 minor #16414 removed all @covers annotations (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

removed all @covers annotations

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

Some unit tests have a `@covers` PHPUnit annotations. Most of them were added a very long time ago, but since then, we did not use them anymore and the existing ones are not maintained (see #16413). So, I propose to remove them all.

Commits
-------

1e0af36 removed all @covers annotations
2015-11-02 19:22:02 +01:00
Fabien Potencier 1e0af36c7d removed all @covers annotations 2015-11-01 14:17:24 -08:00
Fabien Potencier 3b2d0100ac bug #16294 [PropertyAccess] Major performance improvement (dunglas)
This PR was squashed before being merged into the 2.3 branch (closes #16294).

Discussion
----------

[PropertyAccess] Major performance improvement

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

This PR improves performance of the PropertyAccess component of ~70%.

The two main changes are:

* caching the `PropertyPath` initialization
* caching the guessed access strategy

This is especially important for the `ObjectNormalizer` (Symfony Serializer) and the JSON-LD normalizer ([API Platform](https://api-platform.com)) because they use the `PropertyAccessor` class in large loops (ex: normalization of a list of entities).

Here is the Blackfire comparison: https://blackfire.io/profiles/compare/c42fd275-2b0c-4ce5-8bf3-84762054d31e/graph

The code of the benchmark I've used (with Symfony 2.3 as dependency):

```php
<?php

require 'vendor/autoload.php';

class Foo
{
    private $baz;
    public $bar;

    public function getBaz()
    {
        return $this->baz;
    }

    public function setBaz($baz)
    {
        $this->baz = $baz;
    }
}

use Symfony\Component\PropertyAccess\PropertyAccess;

$accessor = PropertyAccess::createPropertyAccessor();

$start = microtime(true);

for ($i = 0; $i < 10000; ++$i) {
    $foo = new Foo();
    $accessor->setValue($foo, 'bar', 'Lorem');
    $accessor->setValue($foo, 'baz', 'Ipsum');
    $accessor->getValue($foo, 'bar');
    $accessor->getValue($foo, 'baz');
}

echo 'Time: '.(microtime(true) - $start).PHP_EOL;
```

This PR also adds an optional support for Doctrine cache to keep access information across requests and improve the overall application performance (even outside of loops).

Commits
-------

284dc75 [PropertyAccess] Major performance improvement
2015-10-30 15:37:44 -07:00
Kévin Dunglas 284dc75796 [PropertyAccess] Major performance improvement 2015-10-30 15:36:27 -07:00
Fabien Potencier ebd55fcb38 minor #16397 added the new Composer exclude-from-classmap option (annesosensio)
This PR was merged into the 2.3 branch.

Discussion
----------

added the new Composer exclude-from-classmap option

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

65bef75 added the new Composer exclude-from-classmap option
2015-10-30 13:03:18 -07:00
Anne-Sophie Bachelard 65bef75bef added the new Composer exclude-from-classmap option 2015-10-30 12:48:51 -07:00
Fabien Potencier cd6351f2cd bug #16331 fixed Twig deprecation notices (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

fixed Twig deprecation notices

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

To avoid deprecation notices when upgrading to Twig 1.23.

Commits
-------

1bdd127 fixed Twig deprecation notices
2015-10-30 10:50:46 -07:00
Fabien Potencier f59286bbc1 minor #16373 [HttpFoundation] fix expected argument type docblock (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] fix expected argument type docblock

| Q             | A
| ------------- | ---
| Fixed tickets |
| License       | MIT

Commits
-------

1c01ebc fix expected argument type docblock
2015-10-29 15:36:51 -07:00
Christian Flothmann 1c01ebc48d fix expected argument type docblock 2015-10-29 19:47:17 +01:00
Fabien Potencier eed6a68f91 minor #16380 Set back libxml settings after testings. (SpacePossum)
This PR was merged into the 2.3 branch.

Discussion
----------

Set back libxml settings after testings.

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

Tests that change the `libxml_use_internal_errors` should set back the flag to the previous setting when done testing.

Commits
-------

29d6969 Set back libxml settings after testings.
2015-10-29 11:36:05 -07:00
Possum 29d696944c Set back libxml settings after testings. 2015-10-29 11:26:44 +01:00
Tobias Schultze e62d98ef30 minor #16370 [HttpFoundation] don't call constructors on Mongo mock objects (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] don't call constructors on Mongo mock objects

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

Calling the parent constructor of the mocked `Mongo` class tries to
connect to a local MongoDB server which fails in case no local server
was configured.

Similarly, when the parent constructor of the mocked `MongoCollection`
class is called it performs checks on the passed arguments which fails
again when a connection was not established successfully before.

Commits
-------

6541b8b don't call constructors on Mongo mock objects
2015-10-28 22:52:08 +01:00
Christian Flothmann 6541b8b726 don't call constructors on Mongo mock objects
Calling the parent constructor of the mocked `Mongo` class tries to
connect to a local MongoDB server which fails in case no local server
was configured.

Similarly, when the parent constructor of the mocked `MongoCollection`
class is called it performs checks on the passed arguments which fails
again when a connection was not established successfully before.
2015-10-28 22:19:48 +01:00
Fabien Potencier 87c08d5fe5 added missing quotes in YAML files 2015-10-27 21:13:05 -07:00
Fabien Potencier 373dacda40 minor #16362 [HttpKernel] Add `@group time-sensitive` on some transient tests (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Add `@group time-sensitive` on some transient tests

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

Commits
-------

6a7d270 [HttpKernel] Add `@group time-sensitive` on some transient tests
2015-10-27 20:50:59 -07:00
Nicolas Grekas 6a7d270820 [HttpKernel] Add `@group time-sensitive` on some transient tests 2015-10-28 04:01:13 +01:00
Fabien Potencier bca80ae820 bug #16306 [DoctrineBridge] Fix issue which prevent the profiler to explain a query (Baachi)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16306).

Discussion
----------

[DoctrineBridge] Fix issue which prevent the profiler to explain a query

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

We currently develop a application which only use the doctrine/dbal and not the orm. And we run into a issue that the profiler can't explained any query.
This is because the `SQLLogger` will pass `null` instead of an empty array. And the `sanitizeQuery` method will currently transform this to `array(null)` which leads to an error.

I created an fork, so everyone can reproduce this.
https://github.com/Baachi/symfony-standard

Commits
-------

3490e98 [DoctrineBridge] Fix issue which prevent the profiler to explain a query
2015-10-27 19:18:52 -07:00
Baachi 3490e98226 [DoctrineBridge] Fix issue which prevent the profiler to explain a query 2015-10-27 19:18:52 -07:00
Fabien Potencier c7e772c8d8 bug #16359 Use mb_detect_encoding with $strict = true (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Use mb_detect_encoding with $strict = true

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

Otherwise, UTF-8 can be returned for non-UTF8 strings...
See e.g. https://3v4l.org/oMMnX

Commits
-------

e6c89f1 Use mb_detect_encoding with $strict = true
2015-10-27 19:13:23 -07:00
Fabien Potencier dd9de5be75 bug #16144 [Security] don't allow to install the split Security packages (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] don't allow to install the split Security packages

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

Currently, you would be able to install the Security component fromm
Symfony 2.3 together with one of the split packages from a higher
Symfony vesion like this:

```json
{
    "require": {
        "symfony/symfony": "2.3.*",
        "symfony/security-core": "~2.7"
    }
}
```

However, you will end up with classes being present twice.

This must be reverted after merging up in the `2.7` branch.

Commits
-------

0d14064 don't allow to install the split Security packages
2015-10-27 18:53:37 -07:00
Nicolas Grekas e6c89f15e4 Use mb_detect_encoding with $strict = true 2015-10-28 00:14:24 +01:00
Christian Flothmann 0d140642e0 don't allow to install the split Security packages
Currently, you would be able to install the Security component fromm
Symfony 2.3 together with one of the split packages from a higher
Symfony vesion like this:

```json
{
    "require": {
        "symfony/symfony": "2.3.*",
        "symfony/security-core": "~2.7"
    }
}
```

However, you will end up with classes being present twice.

This must be reverted after merging up in the `2.7` branch.
2015-10-27 21:57:16 +01:00
Fabien Potencier acf9d7e65c bumped Symfony version to 2.3.35 2015-10-27 11:54:58 -07:00
Fabien Potencier d1d97bc91c Merge pull request #16356 from fabpot/release-2.3.34
released v2.3.34
2015-10-27 18:11:03 +01:00
Fabien Potencier 3a8e49d840 updated VERSION for 2.3.34 2015-10-27 09:29:44 -07:00
Fabien Potencier e94dedb81d update CONTRIBUTORS for 2.3.34 2015-10-27 09:29:43 -07:00
Fabien Potencier 2de47709c1 updated CHANGELOG for 2.3.34 2015-10-27 09:29:35 -07:00
Fabien Potencier 95ff0bc5fd minor #16353 fixed YAML files missing quotes when a string starts with @ (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

fixed YAML files missing quotes when a string starts with @

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

Commits
-------

e36fea8 fixed YAML files missing quotes when a string starts with @
2015-10-27 08:33:53 -07:00
Nicolas Grekas 437e268036 [travis] Fail early when an invalid composer.json is found 2015-10-27 16:22:59 +01:00
Fabien Potencier e8ba93b0d2 minor #16320 [Translation][Csv loader] remove unnecessary statements, for better readability. (aitboudad)
This PR was merged into the 2.3 branch.

Discussion
----------

[Translation][Csv loader] remove unnecessary statements, for better readability.

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

Commits
-------

47b8c3e [Translation][Csv file] remove unnecessary statements, for better readability.
2015-10-27 08:09:41 -07:00
Fabien Potencier e36fea8a63 fixed YAML files missing quotes when a string starts with @ 2015-10-26 13:58:42 +01:00
Fabien Potencier 2d588710ff minor #16309 [Form] remove type check in FormRegistry::getType (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] remove type check in FormRegistry::getType

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

remove validation of `FormRegistry::getType` as `FormRegistry::hasType` does not validate either. So `hasType` currently triggers a PHP warning with a wrong argument.
also developers do not work with the registry directly anyway but through the factory. and the factory already validates the value. So this validation is useless in reality.

Commits
-------

d37b9e6 [Form] remove validation of FormRegistry::getType as FormRegistry::hasType does not validate either
2015-10-25 17:34:32 +01:00
Fabien Potencier ef242afedc minor #16329 [Routing] mark internal classes (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Routing] mark internal classes

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

These classes are an implementation detail of the PhpMatcherDumper that should not be relied upon.

Commits
-------

f1d3e87 [Routing] mark internal classes
2015-10-25 17:28:48 +01:00
Fabien Potencier 1bdd127938 fixed Twig deprecation notices 2015-10-24 22:26:02 +02:00
Nicolas Grekas 7456a8a112 minor #16327 [travis] Reduce composer.json merge conflicts on per-components tests (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] Reduce composer.json merge conflicts on per-components tests

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

json_decoding then re-encoding doesn't preserve the exact structure and leads to merge conflicts when testing deps=2.8. Simpler by-replace injection works better here. This fixes the issue happening on master right now.

Commits
-------

425eb8c [travis] Reduce composer.json merge conflicts on per-components tests
2015-10-24 17:19:59 +02:00
Tobias Schultze f1d3e87a12 [Routing] mark internal classes 2015-10-24 14:07:54 +02:00
Nicolas Grekas 425eb8c5b7 [travis] Reduce composer.json merge conflicts on per-components tests 2015-10-23 18:38:57 +02:00
Tobias Schultze 297a017f2e bug #16288 [Process] Inherit env vars by default in PhpProcess (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Inherit env vars by default in PhpProcess

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

This is the cause of our failures on Windows, where the SYSTEMROOT env var is mandatory for mcrypt_create_iv to work.
I don't know why the browserkit client is run with no env inheritance and this looks like a bug.
Same for PhpProcess emptying the env by default, this looks like a bug, esp. since the parent `Process` class defaults to inheriting the env.
Tests are not broken by this change.

Commits
-------

ab8cc29 [Process] Inherit env vars by default in PhpProcess
2015-10-23 14:28:10 +02:00
Abdellatif Ait boudad 47b8c3ef3e [Translation][Csv file] remove unnecessary statements, for better readability. 2015-10-23 09:44:09 +00:00
Fabien Potencier 73d9dab69f bug #16302 [DoctrineBridge] Fix required guess of boolean fields (enumag)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16302).

Discussion
----------

[DoctrineBridge] Fix required guess of boolean fields

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

Commits
-------

b21d498 [DoctrineBridge] Fix required guess of boolean fields
2015-10-23 09:39:54 +02:00
Jáchym Toušek b21d498fd3 [DoctrineBridge] Fix required guess of boolean fields 2015-10-23 09:39:54 +02:00
Tobias Schultze d0e88caacb minor #16310 Remove dead code in the PropertyPath constructor (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Remove dead code in the PropertyPath constructor

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

Custom singulars have been removed from the component before merging it in Symfony, but the code parsing them was only removed partially.

Commits
-------

ad4d0eb Remove dead code in the PropertyPath constructor
2015-10-22 22:30:16 +02:00
Tobias Schultze 594d8be44b minor #16315 [DI] don't use array_map to resolve services (hadriengem)
This PR was merged into the 2.3 branch.

Discussion
----------

[DI] don't use array_map to resolve services

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

Commits
-------

0249f2f [DI] don't use array_map to resolve services
2015-10-22 22:22:48 +02:00
hadriengem 0249f2f295 [DI] don't use array_map to resolve services 2015-10-22 17:08:54 +02:00
Christophe Coevoet ad4d0eb79a Remove dead code in the PropertyPath constructor
Custom singulars have been removed from the component before merging it
in Symfony, but the code parsing them was only removed partially.
2015-10-22 09:58:49 +02:00
Tobias Schultze d37b9e699d [Form] remove validation of FormRegistry::getType as FormRegistry::hasType does not validate either
also developers do not work with the registry directly anyway but through the factory. and the factory already validates the value.
2015-10-22 02:46:43 +02:00
Nicolas Grekas ab8cc29814 [Process] Inherit env vars by default in PhpProcess 2015-10-20 18:32:03 +02:00
Fabien Potencier 613910bc9f bug #16177 [HttpFoundation] Fixes /0 subnet handling in IpUtils (ultrafez)
This PR was squashed before being merged into the 2.3 branch (closes #16177).

Discussion
----------

[HttpFoundation] Fixes /0 subnet handling in IpUtils

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

Fixes bug #16055. For IP addresses with CIDR subnet length 0, the IP address must be valid - IPs with subnet masks greater than zero are implicitly validated due to the use of `ip2long` and `substr_compare` (although it's not particularly robust - there could be some future work to improve this here).

Commits
-------

d9ac571 [HttpFoundation] Fixes /0 subnet handling in IpUtils
2015-10-19 13:54:32 +02:00
Alex Silcock d9ac57123d [HttpFoundation] Fixes /0 subnet handling in IpUtils 2015-10-19 13:54:29 +02:00
Fabien Potencier 66c99a0b95 minor #16238 [Form] Remove unneeded catch and re-throw in DateTimeToStringTransformer (MisatoTremor)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16238).

Discussion
----------

[Form] Remove unneeded catch and re-throw in DateTimeToStringTransformer

| Q             | A
| ------------- | ---
| Fixed tickets | #16237
| License       | MIT

Also fixed PHPDoc param for ``transform``.

Commits
-------

2c9b283 [Form] Simplify DateTimeToStringTransformer Avoid unneeded catch and re-throw of the same exception.
2015-10-19 13:40:25 +02:00