Commit Graph

22286 Commits

Author SHA1 Message Date
Nicolas Grekas 8ff449d86c [VarDumper] Fix casting for ReflectionParameter 2015-11-05 10:33:55 +01:00
Christian Flothmann 405d4a8ead trigger deprecation warning when using empty_value
The `empty_value` option is deprecated in the `choice`, `date`, and
`time` form types. Therefore, a deprecation warning must be triggered
when the users configures a value for this option.

The `datetime` form type does not need to be updated as it passes
configured values to the `date` and `time` form types which trigger
deprecation warnings anyway.
2015-11-04 21:57:50 +01:00
Kévin Dunglas 916f9e0671 [PropertyAccess] Test access to dynamic properties 2015-11-04 20:02:36 +01:00
Nicolas Grekas 6fe192601c Merge branch '2.3' into 2.7
* 2.3:
  [DI] Clean a phpdoc
2015-11-04 19:50:51 +01:00
Nicolas Grekas 218200d8f3 minor #16468 [DI] Clean a phpdoc (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[DI] Clean a phpdoc

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

Be carefull when merging into 2.7: the ContainerAwareTrait also needs the same fix

Commits
-------

2030f62 [DI] Clean a phpdoc
2015-11-04 19:47:31 +01:00
Nicolas Grekas 2030f62bb5 [DI] Clean a phpdoc 2015-11-04 19:12:53 +01:00
Kévin Dunglas 352dfb9890 [PropertyAccess] Fix dynamic property accessing. 2015-11-04 16:07:49 +01:00
Nicolas Grekas c24ca431ff Merge branch '2.3' into 2.7
* 2.3:
  [HttpKernel] Clean clock-mock injection, replaced by #16455

Conflicts:
	src/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
2015-11-04 10:24:24 +01:00
Nicolas Grekas 5298940707 minor #16456 [HttpKernel] Clean clock-mock injection, replaced by #16455 (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Clean clock-mock injection, replaced by #16455

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

I really hope this PR is the last one on the clock-mocking topic!

Commits
-------

388534e [HttpKernel] Clean clock-mock injection, replaced by #16455
2015-11-04 10:23:27 +01:00
Nicolas Grekas 388534ecbf [HttpKernel] Clean clock-mock injection, replaced by #16455 2015-11-04 10:02:52 +01:00
Nicolas Grekas 4ccfe49f4a Merge branch '2.3' into 2.7
* 2.3:
  [travis] session.gc_probability=0 to fix transient tests on hhvm

Conflicts:
	.travis.yml
	src/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
2015-11-04 09:13:32 +01:00
Warnar Boekkooi d8d4405e50 [Serializer] GetSetNormalizer shouldn't set/get static methods 2015-11-04 15:11:04 +08:00
Warnar Boekkooi b15bdca96d [Serializer] PropertyNormalizer shouldn't set static properties 2015-11-04 15:01:32 +08:00
Fabien Potencier e53b3b3a78 minor #16428 asset test coverage (eventhorizonpl)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #16428).

Discussion
----------

asset test coverage

Hi,

This PR adds 100% tests code coverage for Asset component.

Best regards,
Michal

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

Commits
-------

5a6c1f2 asset test coverage
2015-11-04 01:23:36 +01:00
Michal Piotrowski 5a6c1f2626 asset test coverage 2015-11-04 01:23:35 +01:00
Fabien Potencier 38a92c825f minor #16443 [travis] session.gc_probability=0 to fix transient tests on hhvm (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] session.gc_probability=0 to fix transient tests on hhvm

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

Should fix tests failing with:
`ps_files_cleanup_dir: opendir(/var/lib/hhvm/sessions) failed: Permission denied (13)`

Commits
-------

b4dd254 [travis] session.gc_probability=0 to fix transient tests on hhvm
2015-11-04 01:15:33 +01:00
Nicolas Grekas b4dd254774 [travis] session.gc_probability=0 to fix transient tests on hhvm 2015-11-03 16:54:52 +01:00
Nicolas Grekas 399b1d5cb0 minor #16441 [Security][2.7] Clean deps (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security][2.7] Clean deps

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

Commits
-------

d51ab88 [Security][2.7] Clean deps
2015-11-03 15:25:10 +01:00
Nicolas Grekas 5d8ce715f1 Merge branch '2.3' into 2.7
* 2.3:
  [HttpKernel] Fix time-sensitive test case
  [travis] Fail early when an invalid composer.json is found
2015-11-03 15:24:30 +01:00
Nicolas Grekas 27f7be6322 minor #16439 [HttpKernel] Fix time-sensitive test case (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Fix time-sensitive test case

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

Fixes these kind of failures:
```
1) Symfony\Component\HttpKernel\Tests\Fragment\FragmentHandlerTest::testRender
Expectation failed for method name is equal to <string:render> when invoked zero or more times

Parameter 1 for invocation Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface::render('/', Symfony\Component\HttpFoundation\Request Object (...), Array (...)) does not match expected value.

Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
             'SERVER_PROTOCOL' => 'HTTP/1.1'
-            'REQUEST_TIME' => 1446551470
+            'REQUEST_TIME' => 1446551469
             'PATH_INFO' => ''
             'REQUEST_METHOD' => 'GET'
```

Commits
-------

c188b35 [HttpKernel] Fix time-sensitive test case
2015-11-03 15:23:57 +01:00
Nicolas Grekas d51ab88541 [Security][2.7] Clean deps 2015-11-03 15:07:35 +01:00
Nicolas Grekas c188b35b18 [HttpKernel] Fix time-sensitive test case 2015-11-03 14:01:13 +01:00
Nicolas Grekas 88b84b1a13 minor #16437 [Security] Fix composer.json (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Fix composer.json

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

Commits
-------

39420e1 [Security] Fix composer.json
2015-11-03 12:41:58 +01:00
Nicolas Grekas 39420e1eb9 [Security] Fix composer.json 2015-11-03 12:34:55 +01:00
Nicolas Grekas c4a31787a8 minor #16341 [travis] Fail early when an invalid composer.json is found (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] Fail early when an invalid composer.json is found

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

It happens :)

Commits
-------

437e268 [travis] Fail early when an invalid composer.json is found
2015-11-03 09:49:28 +01:00
Fabien Potencier d3008b420a removed @covers annotations in tests 2015-11-02 21:25:31 +01:00
Fabien Potencier db54164a87 Merge branch '2.3' into 2.7
* 2.3:
  removed all @covers annotations
  [PropertyAccess] Major performance improvement
2015-11-02 21:20:53 +01:00
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 6d0e05cd1d added the new Composer exclude-from-classmap option 2015-10-30 13:13:17 -07:00
Fabien Potencier 05c2ecc124 Merge branch '2.3' into 2.7
* 2.3:
  added the new Composer exclude-from-classmap option
  fix expected argument type docblock
  Set back libxml settings after testings.
  fixed Twig deprecation notices
2015-10-30 13:10:21 -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 dd9d076a0b JsonDescriptor - encode container params only once 2015-10-29 22:04:12 +01: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
Tobias Schultze 7f62133939 fix php requirement in 2.7 2015-10-29 15:10:52 +01:00
Tobias Schultze 9ea4bce052 Merge branch '2.3' into 2.7 2015-10-29 11:45:39 +01: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 713adb3938 added missing quotes in YAML files 2015-10-27 21:31:00 -07:00
Fabien Potencier 5f707a64d0 Merge branch '2.3' into 2.7
* 2.3:
  added missing quotes in YAML files
  [HttpKernel] Add `@group time-sensitive` on some transient tests
  [DoctrineBridge] Fix issue which prevent the profiler to explain a query
  Use mb_detect_encoding with $strict = true
  don't allow to install the split Security packages
  bumped Symfony version to 2.3.35
  updated VERSION for 2.3.34
  update CONTRIBUTORS for 2.3.34
  updated CHANGELOG for 2.3.34
2015-10-27 21:15:55 -07: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