Commit Graph

32771 Commits

Author SHA1 Message Date
Nicolas Grekas
1d02ef2ccb Merge branch '3.4' into 4.2
* 3.4:
  [TwigBridge] fix tests
2019-04-12 15:50:35 +02:00
Nicolas Grekas
33c6681585 [TwigBridge] fix tests 2019-04-12 15:39:20 +02:00
Fabien Potencier
69b43fa8a8 bug #30993 [FrameworkBundle] Fix for Controller DEPRECATED when using composer --optimized (aweelex)
This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] Fix for Controller DEPRECATED  when using composer --optimized

| Q | A |
| --- | --- |
| Branch? | 4.2 |
| Bug fix? | Yes |
| New feature? | No |
| BC breaks? | No |
| Deprecations? | No |
| Tests pass? | Yes |
| Fixed tickets | --- |
| License | MIT |

Using `composer --optimize-autoload` causes `console cache:clear` (without warmup) to give DEPRECATED error, that stays in profiler.

I moved `@trigger_error` from beggining of the file to Controller __consctruct method.

Commits
-------

2ae2fd800d [FrameworkBundle] Fix Controller deprecated when using composer --optimized
2019-04-12 11:01:41 +02:00
Nicolas Grekas
ebe9ccf0cc Merge branch '3.4' into 4.2
* 3.4:
  Catch empty deprecation.log silently (fixes #31050)
2019-04-11 13:58:13 +02:00
Matthias Althaus
291c73a290 Catch empty deprecation.log silently (fixes #31050) 2019-04-11 13:43:50 +02:00
Nicolas Grekas
9399cb99a5 Merge branch '3.4' into 4.2
* 3.4:
  minor: the meaning of the data breach was not correct
  Optimize SVGs
  property normalizer should also pass format and context to isAllowedAttribute
2019-04-11 13:27:41 +02:00
Nicolas Grekas
5f4c27f0de minor #31067 Optimize SVGs (MartijnCuppens)
This PR was merged into the 3.4 branch.

Discussion
----------

Optimize SVGs

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

Used [svgo](https://github.com/svg/svgo) to optimize the svgs. I kept the `viewBox` attribute to keep the aspects when SVGs are rescaled.

I also added `insert_final_newline = false` to the `.editorconfig` file because the newlines are removed from the SVGs and there's only one line left.

Commits
-------

4614cea9d2 Optimize SVGs
2019-04-11 13:23:48 +02:00
Nicolas Grekas
2a1137a05c bug #31071 property normalizer should also pass format and context to isAllowedAttribute (dbu)
This PR was merged into the 3.4 branch.

Discussion
----------

property normalizer should also pass format and context to isAllowedAttribute

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | found while working on https://github.com/symfony/symfony/pull/30888
| License       | MIT
| Doc PR        | -

the context and format are optional parameters to `isAllowedAttribute`, but should be forwarded. due to this omission, the PropertyNormalizer was ignoring the 'attributes' context option (and does in version 4 also ignore the 'ignore_attributes' context option - that one is a property on the normalizer class in version 3 and therefore not ignored here)

Commits
-------

13e2fb735d property normalizer should also pass format and context to isAllowedAttribute
2019-04-11 13:03:39 +02:00
Hamza Amrouche
97ac9bae11 minor: the meaning of the data breach was not correct 2019-04-11 12:48:53 +02:00
Martijn Cuppens
4614cea9d2 Optimize SVGs 2019-04-11 11:48:14 +02:00
Pablo Ogando Ferreira
93dabbc96a CS Fixes: Not double split with one array argument 2019-04-11 09:45:22 +02:00
David Buchmann
13e2fb735d property normalizer should also pass format and context to isAllowedAttribute 2019-04-11 07:44:34 +02:00
Fabien Potencier
9ee6fc15e1 fixed bad merge 2019-04-10 21:42:23 +02:00
Fabien Potencier
b13a23fe45 Merge branch '3.4' into 4.2
* 3.4:
  Show more accurate message in profiler when missing stopwatch
  CS Fixes: Not double split with one array argument
  Remove redundant animation prefixes
  Remove redundant `box-sizing` prefixes
  Rework firewall access denied rule
  fixed CS
  Fix missing $extraDirs when open_basedir returns
2019-04-10 18:20:36 +02:00
Fabien Potencier
32c448f639 minor #31064 CS Fixes: Not double split with one array argument (rubenrua)
This PR was merged into the 3.4 branch.

Discussion
----------

CS Fixes: Not double split with one array argument

| Q             | A
| ------------- | ---
| Branch?       |  3.4  (master from #31063)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | None
| License       | MIT
| Doc PR        | None

Keep to use the same CS in all the Symfony code base.

Use:
```php
$resolver->setDefaults([
    'compound' => false
]);
```

Instead of:
```php
$resolver->setDefaults(
    [
        'compound' => false,
    ]
);
```

Keep the double split when the method has two or more arguments.

I miss a PSR with this rule.

Commits
-------

a56bf552ad CS Fixes: Not double split with one array argument
2019-04-10 18:18:38 +02:00
Fabien Potencier
f7cd81d805 bug #31059 Show more accurate message in profiler when missing stopwatch (linaori)
This PR was squashed before being merged into the 3.4 branch (closes #31059).

Discussion
----------

Show more accurate message in profiler when missing stopwatch

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

This adds a message to the profiler if the stopwatch component is not installed, instead of suggesting to check if debug is enabled (even if it is enabled).

I had to add a method in the collector to expose the value collected, which in theory adds a feature. Is there perhaps a way to expose this collected data _without_ a "BC break"? I don't think it breaks anything, though it does make the dependencies on the http-kernel a bit strict. The other solution is to ignore if it's null and only act if it's a boolean (feature detection).

Commits
-------

326aa86d6a Show more accurate message in profiler when missing stopwatch
2019-04-10 18:17:42 +02:00
Lynn
326aa86d6a Show more accurate message in profiler when missing stopwatch 2019-04-10 18:17:31 +02:00
rubenrua
a56bf552ad CS Fixes: Not double split with one array argument
Keep to use the same CS in all the Symfony code base.

Use:
```php
$resolver->setDefaults([
    'compound' => false
]);
```

Instead of:
```php
$resolver->setDefaults(
    [
        'compound' => false,
    ]
);
```

Keep the double split when the method has two or more arguments.

I miss a PSR with this rule.
2019-04-10 18:00:48 +02:00
Fabien Potencier
98e0975113 bug #31026 [Serializer] Add default object class resolver (jdecool)
This PR was squashed before being merged into the 4.2 branch (closes #31026).

Discussion
----------

[Serializer] Add default object class resolver

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

The commit 1d8b5af3f0 introduce a BC break because before that commit the `extractAttributes` the `$object` can be a string which contain the fully qualified name of an object.

To fix the BC break and preserve the new feature, I suggest to create a default object class resolver if it is not set by the developer.

Commits
-------

dd5b8f16f5 [Serializer] Add default object class resolver
2019-04-10 13:09:12 +02:00
Jérémy DECOOL
dd5b8f16f5 [Serializer] Add default object class resolver 2019-04-10 13:09:05 +02:00
Martijn Cuppens
3655bcfaf7
Remove redundant animation prefixes
CSS animations can be used safely without any prefixes
2019-04-10 12:58:43 +02:00
Fabien Potencier
de53bd6c67 bug #31031 [Serializer] MetadataAwareNameConverter: Do not assume that property names are strings (soyuka)
This PR was merged into the 4.2 branch.

Discussion
----------

[Serializer]  MetadataAwareNameConverter: Do not assume that property names are strings

| Q             | A
| ------------- | ---
| Branch?       | 4.2 (class introduced in v4.2.3)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/api-platform/core/pull/2709
| License       | MIT
| Doc PR        | n/a

When this class was introduced, there was an assumption made about the type of `propertyNames` and therefore a `: ?string` return type was introduced in the fallbacks/normalization private methods. Because symfony doesn't use strict mode yet (compatibility issues with php IIRC), when using a non-string property name (for example the integer `0` which is a valid property name in an array), it will convert the integer to a string.
This is not good, especially if you have a name converter that returns the given property name (ie no transformation) you'll have it's type changed which isn't correct.

I've discovered this bug while working on adding this name converter in api platform (https://github.com/api-platform/core/pull/2709).

Commits
-------

af1e136ca0 MetadataAwareNameConverter: Do not assume that property names are strings
2019-04-10 12:55:09 +02:00
Martijn Cuppens
0cf3227011 Remove redundant box-sizing prefixes 2019-04-10 12:45:20 +02:00
Fabien Potencier
fd1408b138 bug #30423 [Security] Rework firewall's access denied rule (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Rework firewall's access denied rule

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

Follow tickets provided above to reproduce bugs. (there are also some project examples)

~~In addition, I'm looking for someone who knows an answer to [this](https://github.com/symfony/symfony/issues/30099#issuecomment-468693492) regarding rework in this PR.~~

Commits
-------

5790859275 Rework firewall access denied rule
2019-04-10 08:03:21 +02:00
Nicolas Grekas
c7a504c822 [VarExporter] support PHP7.4 __serialize & __unserialize 2019-04-09 22:09:28 +02:00
Dmytro
5790859275 Rework firewall access denied rule 2019-04-09 18:04:58 +03:00
soyuka
af1e136ca0 MetadataAwareNameConverter: Do not assume that property names are strings 2019-04-09 10:07:40 +02:00
Nicolas Grekas
75b1157633 bug #31020 [VarExporter] fix exporting classes with private constructors (nicolas-grekas)
This PR was merged into the 4.2 branch.

Discussion
----------

[VarExporter] fix exporting classes with private constructors

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

Reported by @theofidry

Commits
-------

e354d54e7e [VarExporter] fix exporting classes with private constructors
2019-04-08 22:31:56 +02:00
Nicolas Grekas
e354d54e7e [VarExporter] fix exporting classes with private constructors 2019-04-08 20:04:40 +02:00
Fabien Potencier
b93d2bf941 fixed CS 2019-04-08 18:15:54 +02:00
Florian Morello
e238c893e9 Fix missing $extraDirs when open_basedir returns 2019-04-08 18:14:48 +02:00
Fabien Potencier
c248646e59 bug #30852 [Console] fix buildTableRows when Colspan is use with content too long (Raulnet)
This PR was merged into the 4.2 branch.

Discussion
----------

[Console] fix buildTableRows when Colspan is use with content too long

| Q             | A
| ------------- | ---
| Branch?       |  4.2 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    ( new test added  TableTest::testWithColspanAndMaxWith)
| Fixed tickets |  https://github.com/symfony/symfony/issues/30701
| License       | MIT
| Doc PR        | no

<!-- fix for keeping ColumnMaxwith when Content is too long

Commits
-------

1cf9659b5f fix buildTableRows when Colspan is use with content too long
2019-04-08 16:23:48 +02:00
Fabien Potencier
f794e41544 minor #31005 [Serializer] take setIgnoredAttributes() deprecation into account (xabbuh)
This PR was merged into the 4.2 branch.

Discussion
----------

[Serializer] take setIgnoredAttributes() deprecation into account

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

Commits
-------

4134be127a take setIgnoredAttributes() deprecation into account
2019-04-08 16:14:28 +02:00
Raulnet
1cf9659b5f fix buildTableRows when Colspan is use with content too long 2019-04-08 15:40:54 +02:00
David Buchmann
37891525f7 [serializer] validate that the specified callbacks and max_depth_handler are actually callable 2019-04-08 15:09:58 +02:00
Christian Flothmann
4134be127a take setIgnoredAttributes() deprecation into account 2019-04-08 13:47:38 +02:00
Christian Flothmann
ec41d76624 Merge branch '3.4' into 4.2
* 3.4:
  [Serializer] Respect ignored attributes in cache key of normalizer
  fix resetting the COLUMN environment variable
  Fix TestRunner compatibility to PhpUnit 8
  prevent mixup of the object to populate
2019-04-08 13:36:05 +02:00
Fabien Potencier
7a3060a867 bug #30907 [Serializer] Respect ignored attributes in cache key of normalizer (dbu)
This PR was squashed before being merged into the 3.4 branch (closes #30907).

Discussion
----------

[Serializer] Respect ignored attributes in cache key of normalizer

EUFOSSA

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

Do not share the attributes cache in object normalizer when using a different setting for the ignoredAttributes setting.

In Symfony 4.2, the setter is deprecated in favor of the ignored_attibutes option in the $context. When merging this up, we will however still need to respect the field as well for BC, the cache key does not look at the default context (apart from the deprecated modifiers, the default context is immutable)

There might be performance regression for some use cases, but also could be a performance improvement when using 'attributes' in the context with lists of objects of the same class.

Commits
-------

926d228877 [Serializer] Respect ignored attributes in cache key of normalizer
2019-04-08 12:10:13 +02:00
David Buchmann
926d228877 [Serializer] Respect ignored attributes in cache key of normalizer 2019-04-08 12:10:02 +02:00
Christian Flothmann
8fb2074972 fix resetting the COLUMN environment variable 2019-04-08 11:29:13 +02:00
Nicolas Grekas
d7a8b3d5e1 bug #30085 Fix TestRunner compatibility to PhpUnit 8 (alexander-schranz)
This PR was squashed before being merged into the 3.4 branch (closes #30085).

Discussion
----------

Fix TestRunner compatibility to PhpUnit 8

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

Modify the installed phpunit version to be compatibility with the symfony custom TestRunner. This is sure not the best way but maybe currently the fastest way to support PhpUnit 8. The hack should be removed as soon as there is another way to implement a custom Runner.

Commits
-------

a0c66a399d Fix TestRunner compatibility to PhpUnit 8
2019-04-08 09:56:38 +02:00
Alexander Schranz
a0c66a399d Fix TestRunner compatibility to PhpUnit 8 2019-04-08 09:56:31 +02:00
Александр Ли
2ae2fd800d [FrameworkBundle] Fix Controller deprecated when using composer --optimized
Update Controller.php
Update Controller.php
2019-04-08 12:19:48 +05:00
Roland Franssen
d2f2e56472 Fix dark themed componnents 2019-04-08 09:12:55 +02:00
Fabien Potencier
b30f57e14b bug #30977 [serializer] prevent mixup in normalizer of the object to populate (dbu)
This PR was merged into the 3.4 branch.

Discussion
----------

[serializer] prevent mixup in normalizer of the object to populate

EUFOSSA

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

OBJECT_TO_POPULATE is meant to specify the top level object. The implementation left the option in the context and it would be used whenever we have the first element that matches the class. #30607 (to master) introduces the feature to also keep the instances of attributes to deeply populate an existing object tree. In both cases, we do not want the mix up to happen with what the current OBJECT_TO_POPULATE is.

Commits
-------

fdb668e051 prevent mixup of the object to populate
2019-04-08 08:05:24 +02:00
Fabien Potencier
bbad6e8e58 Merge branch '3.4' into 4.2
* 3.4:
  Make tests independent from each other
2019-04-08 07:23:45 +02:00
Fabien Potencier
48bb7c999c minor #30986 Make tests independent from each other (greg0ire)
This PR was merged into the 3.4 branch.

Discussion
----------

Make tests independent from each other

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

Environment variables set in a test need to be restored to their
previous values or unset if we want to be able to run tests
independently.

Credits to @ostrolucky for spotting this issue, I'm available for help when merging this in more recent branch (issues may appear then).

Created during the EU-FOSSA hackathon

Commits
-------

00883fc409 Make tests independent from each other
2019-04-08 07:17:37 +02:00
Grégoire Paris
00883fc409
Make tests independent from each other
Environment variables set in a test need to be restored to their
previous values or unset if we want to be able to run tests
independently.
2019-04-07 23:05:09 +02:00
Christian Flothmann
5b8a68d98d minor #30989 fix tests (xabbuh)
This PR was merged into the 4.2 branch.

Discussion
----------

fix tests

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

Commits
-------

27df966705 fix tests
2019-04-07 21:42:46 +02:00
Christian Flothmann
27df966705 fix tests 2019-04-07 21:30:26 +02:00