Commit Graph

37434 Commits

Author SHA1 Message Date
Nicolas Grekas
c06454827d fix tests 2019-08-01 12:14:38 +02:00
Nicolas Grekas
1ad26825dc minor #32846 [PhpUnitBridge] Fix deprecation assertInternalType (jderusse)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Fix deprecation assertInternalType

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

This PR fixes PhpUnit deprecation :
> assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(), assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(), assertIsResource(), assertIsString(), assertIsScalar(), assertIsCallable(), or assertIsIterable() instead

- update all tests to use `assertIsX` instead of `assertInternalType('x'`
- adds methods `assertIsX` in `ForwardCompatTestTraitForV5`

Commits
-------

4c8442462a Fix assertInternalType deprecation in phpunit 9
2019-08-01 11:17:11 +02:00
Jérémy Derussé
4c8442462a
Fix assertInternalType deprecation in phpunit 9 2019-08-01 09:40:28 +02:00
Nicolas Grekas
4af1fd66c3 minor #32843 Micro-typo fix (BenMorel)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #32843).

Discussion
----------

Micro-typo fix

Commits
-------

9e2d683423 Micro-typo fix
2019-08-01 00:45:58 +02:00
Benjamin Morel
9e2d683423 Micro-typo fix 2019-08-01 00:45:52 +02:00
Nicolas Grekas
629d21736d [Cache] fix cs 2019-08-01 00:26:30 +02:00
Nicolas Grekas
5fa9ed40e7 minor #32842 Make tests support phpunit 8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Make tests support phpunit 8

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

Having `void` on setUp/tearDown is **really** painful /cc @sebastianbergmann FYI

This works around the issue by adding a new trait to the phpunit-bridge: `SetUpTearDownTrait`.
Another reason why the bridge is so useful...

With this change, we should have the same codebase be able to run under phpunit 4.8 (used with PHP5.5) up to phpunit 8.2 (used with PHP7.4).

🤞 🤕

One more step towards PHP 7.4 support.

Commits
-------

81af97f398 Make tests support phpunit 8
2019-08-01 00:10:00 +02:00
Nicolas Grekas
81af97f398 Make tests support phpunit 8 2019-07-31 23:55:24 +02:00
Nicolas Grekas
f0c666925a minor #32289 Allow Travis CI to build on PHP 7.4 (phansys)
This PR was merged into the 3.4 branch.

Discussion
----------

Allow Travis CI to build on PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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
-------

1ca61d3aec Allow Travis CI to build on PHP 7.4
2019-07-31 19:02:45 +02:00
Javier Spagnoletti
1ca61d3aec Allow Travis CI to build on PHP 7.4 2019-07-31 18:59:46 +02:00
Nicolas Grekas
bcfc7a4ada minor #32828 [Form] update type of form $name arguments (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] update type of form $name arguments

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

An alternative to #32821: where a string is expected, passing an int is fine, per PHP casting rules.

Commits
-------

6d4dcadd66 [Form] update type of form $name arguments
2019-07-31 17:02:16 +02:00
Nicolas Grekas
dfce45bf2e Fix travis script 2019-07-31 14:40:56 +02:00
Nicolas Grekas
6d4dcadd66 [Form] update type of form $name arguments 2019-07-31 13:55:54 +02:00
Yonel Ceruto
e4082fa6fa minor #32826 [Debug] minor fix for wrong method name case (Tobias Weichart)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] minor fix for wrong method name case

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

Minor replacement of wrong case for function name, needs to be fixed in 3.4 as hinten [here](https://github.com/symfony/symfony/pull/32812#discussion_r308815666).

Commits
-------

8b2d67b minor fix for wrong case
2019-07-31 07:51:26 -04:00
Tobias Weichart
8b2d67bb3d minor fix for wrong case 2019-07-31 08:13:25 +01:00
Nicolas Grekas
f1cb4b59b9 bug #32767 [Yaml] fix comment in multi line value (soufianZantar)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] fix comment in multi line value

| Q             | A
| ------------- | ---
| Branch?       |  4.3 and lower <!-- see below -->
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32667    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->
Comments after blank lines are read as value in yaml.

```
`$yaml = <<<YAML
parameters:
    abc

# Comment
YAML;

var_dump(Symfony\Component\Yaml\Yaml::parse($yaml));`
```

**Result before fix:**

```
array(1) {
  ["parameters"]=>
  string(13) "abc
# Comment"
}
```
**Result after fix:**

```
array(1) {
  ["parameters"]=>
  string(3) "abc"
}
```

Commits
-------

dd945e375c fix(yml): fix comment in milti line value
2019-07-30 19:38:11 +02:00
Nicolas Grekas
1143b02188 bug #32790 [HttpFoundation] Fix getMaxFilesize (bennyborn)
This PR was squashed before being merged into the 3.4 branch (closes #32790).

Discussion
----------

[HttpFoundation] Fix `getMaxFilesize`

When checking for the maximum size of an uploaded file you can't just rely on `upload_max_filesize` since the request might also exceed `post_max_size`. Also discussed in contao/contao#498

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

Commits
-------

54107bac33 [HttpFoundation] Fix `getMaxFilesize`
2019-07-30 19:35:47 +02:00
Benny Born
54107bac33 [HttpFoundation] Fix getMaxFilesize 2019-07-30 19:35:39 +02:00
Nicolas Grekas
b706372cd4 bug #32796 [Cache] fix warning on PHP 7.4 (jpauli)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix warning on PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not all, still some missing I cant find
| Fixed tickets |
| License       | MIT
| Doc PR        |

Some fixes in tests for PHP 7.4

Commits
-------

3324505b51 [Cache] fix warning on PHP 7.4
2019-07-30 19:32:00 +02:00
Julien Pauli
3324505b51 [Cache] fix warning on PHP 7.4 2019-07-30 19:30:37 +02:00
Nicolas Grekas
3f431860c6 bug #32806 [Console] fix warning on PHP 7.4 (rez1dent3)
This PR was submitted for the 4.3 branch but it was squashed and merged into the 3.4 branch instead (closes #32806).

Discussion
----------

[Console] fix warning on PHP 7.4

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

In php 7.4rc, accessing an array by key, sometimes causes an error.
Rarely this error occurs on php 7.2.

```bash
ErrorException: Trying to access array offset on value of type int

/app/vendor/symfony/console/Input/ArrayInput.php:135
/app/vendor/symfony/console/Input/Input.php:55
/app/vendor/symfony/console/Application.php:208
/app/vendor/symfony/console/Application.php:149
/app/vendor/laravel/framework/src/Illuminate/Console/Application.php:90
/app/vendor/laravel/framework/src/Illuminate/Console/Application.php:182
/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:275
/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/PendingCommand.php:136
/app/vendor/orchestra/testbench-core/src/Database/MigrateProcessor.php:73
/app/vendor/orchestra/testbench-core/src/Database/MigrateProcessor.php:44
/app/vendor/orchestra/testbench-core/src/Concerns/WithLoadMigrationsFrom.php:27
```

Commits
-------

5f451e6f70 [Console] fix warning on PHP 7.4
2019-07-30 19:22:34 +02:00
Babichev Maxim
5f451e6f70 [Console] fix warning on PHP 7.4 2019-07-30 19:22:29 +02:00
Nicolas Grekas
5c67a67a61 bug #32809 Don't add object-value of static properties in the signature of container metadata-cache (arjenm)
This PR was merged into the 3.4 branch.

Discussion
----------

Don't add object-value of static properties in the signature of container metadata-cache

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | No ticket created, see below
| License       | MIT

Running bin/console cache:clear can take a very long time and/or uses explosive amounts of memory if large protected/public static objects are available in classes for which metadata will be generated during the 'container dump'.

I.e. in \Symfony\Component\HttpKernel\Kernel::dumpContainer eventually a call to \Symfony\Component\Config\ResourceCheckerConfigCache::write is done. That writes a serialized version of the $metadata.
In that serialize a call to \Symfony\Component\Config\Resource\ReflectionClassResource::generateSignature for each service will eventually do a print_r on the class's (default) properties.

Class properties can also be (public/protected) static. PHP Reflection doesn't differentiate between those in that context. And _those_ static objects can also have non-scalar values, including objects.

If such an object is very large, for instance a service that references the Container (with many services, some also referencing the container, etc), the print_r will run into very deep recursions. I.e. it will either take "forever" or use so much memory the OOM killer is activated (it got to 25GB...).

This scenario only triggers when a cache existed prior to running cache:clear, i.e. when 'isFresh' is called. When first removing the cache dir (or running cache:clear with --no-warmup) and than running cache:clear does not trigger the behavior, apparently the hash is created in a saver time in that scenario.

This sample project offers code that will prime a static property into a service (the trick is having a command with such a class-reference/service):
https://github.com/arjenm/symfony-service-recursion
Add a var_dump to the `$defaults = $class->getDefaultProperties();` in \Symfony\Component\Config\Resource\ReflectionClassResource::generateSignature to see it in effect.
The first cache:clear will show a few null's; the second run - without removing the cache - will show a container instead of null.
Its still a tiny container, so it'll not trigger serious issues.

This PR prevents an object "default value" for a property from being fed to 'print_r'. Since normally an object-property should be null on a "fresh" look at a non-instantiated class it should be save to use (i.e. no BC).

Commits
-------

a80e56c460 Don't add value of (default/static) objects to the signature
2019-07-30 18:55:42 +02:00
Arjen van der Meijden
a80e56c460 Don't add value of (default/static) objects to the signature 2019-07-30 11:52:27 +02:00
Soufian EZ ZANTAR
dd945e375c fix(yml): fix comment in milti line value 2019-07-30 10:09:15 +02:00
Nicolas Grekas
67631723d2 bug #30096 [DI] Fix dumping Doctrine-like service graphs (bis) (weaverryan, nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix dumping Doctrine-like service graphs (bis)

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

Dumping the container while accounting for circular references is hard :)

Commits
-------

a37f3e0807 [DI] Fix dumping Doctrine-like service graphs (bis)
ee491444f4 Failing test case for complex near-circular situation + lazy
2019-07-29 19:27:15 +02:00
Nicolas Grekas
a37f3e0807 [DI] Fix dumping Doctrine-like service graphs (bis) 2019-07-29 18:30:31 +02:00
Tobias Schultze
de490b463c bug #32799 [HttpKernel] do not stopwatch sections when profiler is disabled (Tobion)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] do not stopwatch sections when profiler is disabled

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

the toolbar and profiler panel disable to profiler which then does not set the X-Debug-Token. so when the header does not exist, do not call the stopwatch methods with `null` which violates the contract and does not make sense. found with #32242

Commits
-------

8718cd1b15 [HttpKernel] do not stopwatch sections when profiler is disabled
2019-07-29 17:57:04 +02:00
Tobias Schultze
aefc7f54d7 minor #32793 [Stopwatch] fix some phpdocs (Tobion)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] fix some phpdocs

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Fix phpdocs found in #32242

Commits
-------

66dc9069aa [Stopwatch] fix some phpdocs
2019-07-29 17:18:44 +02:00
Tobias Schultze
8718cd1b15 [HttpKernel] do not stopwatch sections when profiler is disabled
the toolbar and profiler panel disable to profiler which then does not set the X-Debug-Token. so when the header does not exist, do not call the stopwatch methods with null which violates the contract and does not make sense
2019-07-29 16:31:29 +02:00
Tobias Schultze
66dc9069aa [Stopwatch] fix some phpdocs 2019-07-29 15:17:57 +02:00
Ryan Weaver
ee491444f4 Failing test case for complex near-circular situation + lazy 2019-07-28 17:16:57 +02:00
Fabien Potencier
2113e67715 minor #32789 drop 4.2 branch from pull request template (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

drop 4.2 branch from pull request template

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

Commits
-------

48e7b14611 drop 4.2 branch from pull request template
2019-07-28 09:36:52 +02:00
Christian Flothmann
48e7b14611
drop 4.2 branch from pull request template 2019-07-28 09:20:12 +02:00
Fabien Potencier
43e5e97989 bumped Symfony version to 3.4.31 2019-07-27 20:27:05 +02:00
Fabien Potencier
4d911e98e1
Merge pull request #32784 from fabpot/release-3.4.30
released v3.4.30
2019-07-27 19:14:21 +02:00
Fabien Potencier
dc59b6f158 updated VERSION for 3.4.30 2019-07-27 19:14:06 +02:00
Fabien Potencier
b9cccd1ded update CONTRIBUTORS for 3.4.30 2019-07-27 19:14:05 +02:00
Fabien Potencier
d4a9278da5 updated CHANGELOG for 3.4.30 2019-07-27 19:13:44 +02:00
Nicolas Grekas
5dc8bc0520 [VarDumper] cs fix 2019-07-26 13:29:23 +02:00
Christian Flothmann
da6aca66f5 minor #32728 relax some assertions to make tests forward compatible (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

relax some assertions to make tests forward compatible

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

Commits
-------

c0eed67aa8 relax some assertions to make tests forward compatible
2019-07-24 21:56:41 +02:00
Christian Flothmann
c0eed67aa8 relax some assertions to make tests forward compatible 2019-07-24 21:39:07 +02:00
Christian Flothmann
83e7b45b6d fix typo 2019-07-24 20:15:30 +02:00
Christian Flothmann
b33389266a minor #32724 [FrameworkBundle] make tests forward compatible with DI 4.4 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] make tests forward compatible with DI 4.4

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

Commits
-------

affede122b make tests forward compatible with DI 4.4
2019-07-24 19:12:37 +02:00
Christian Flothmann
affede122b make tests forward compatible with DI 4.4 2019-07-24 18:59:53 +02:00
Robin Chalas
1ce527a0ea bug #32503 Fix multiSelect ChoiceQuestion when answers have spaces (IceMaD)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix multiSelect ChoiceQuestion when answers have spaces

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

Probleme is explained in the issue

Commits
-------

9104ef1d74 Fix multiSelect ChoiceQuestion when answers have spaces
2019-07-24 17:12:34 +02:00
IceMaD
9104ef1d74 Fix multiSelect ChoiceQuestion when answers have spaces 2019-07-24 16:46:41 +02:00
Nicolas Grekas
639041cefd bug #32688 [Yaml] fix inline handling when dumping tagged values (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] fix inline handling when dumping tagged values

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

Commits
-------

07590aeb95 fix inline handling when dumping tagged values
2019-07-24 16:39:08 +02:00
Christian Flothmann
07590aeb95 fix inline handling when dumping tagged values 2019-07-24 15:01:31 +02:00
Fabien Potencier
3f652f161b bug #32644 [WebProfileBundle] Avoid getting right to left style (Arman-Hosseini)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfileBundle] Avoid getting right to left style

| Q             | A
| ------------- | ---
| Branch?       | >= 3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

162819fef3 Avoid getting right to left style
2019-07-24 12:33:03 +02:00