Commit Graph

40090 Commits

Author SHA1 Message Date
Nicolas Grekas
25fcc3ed77 Merge branch '4.2'
* 4.2:
  [DI] Fix dumping Doctrine-like service graphs
  fix serialization workaround in CustomUserMessageAuthenticationException
  PHPUnit Bridge: Rollback to traditional array syntax.
  [Form] fix some docblocks and type checks
2019-01-30 18:52:12 +01:00
Nicolas Grekas
4f6541e4f5 Merge branch '3.4' into 4.2
* 3.4:
  [DI] Fix dumping Doctrine-like service graphs
  fix serialization workaround in CustomUserMessageAuthenticationException
  PHPUnit Bridge: Rollback to traditional array syntax.
  [Form] fix some docblocks and type checks
2019-01-30 18:51:38 +01:00
Nicolas Grekas
5b1948e6b7 bug #30046 [DI] Fix dumping Doctrine-like service graphs (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix dumping Doctrine-like service graphs

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

I'm unable to provide a reproducer for this, the required service reference graph is too crazy, but that does the job :)

Commits
-------

ed96830893 [DI] Fix dumping Doctrine-like service graphs
2019-01-30 18:48:51 +01:00
Nicolas Grekas
83bab56a38 minor #30041 PHPUnit Bridge: Rollback to traditional array syntax. (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

PHPUnit Bridge: Rollback to traditional array syntax.

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

I've used PHP CS Fixer to convert all short array expressions back to the traditional syntax understood by php 5.3. Unfortunately, I don't have a local php 5.3 setup anymore, so I hope I've caught all occurrences.

Commits
-------

8b330de7f7 PHPUnit Bridge: Rollback to traditional array syntax.
2019-01-30 18:19:24 +01:00
Nicolas Grekas
ed96830893 [DI] Fix dumping Doctrine-like service graphs 2019-01-30 18:15:16 +01:00
Nicolas Grekas
11dc73d367 minor #30044 [Security] Fix serialization workaround in CustomUserMessageAuthenticationException (renanbr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Fix serialization workaround in CustomUserMessageAuthenticationException

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

Commits
-------

542e9e29b9 fix serialization workaround in CustomUserMessageAuthenticationException
2019-01-30 17:17:49 +01:00
renanbr
542e9e29b9 fix serialization workaround in CustomUserMessageAuthenticationException 2019-01-30 16:28:03 +01:00
Alexander M. Turek
8b330de7f7 PHPUnit Bridge: Rollback to traditional array syntax. 2019-01-30 14:30:37 +01:00
Fabien Potencier
b324445d6a feature #29999 [PropertyAccess] speed up accessing object properties (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PropertyAccess] speed up accessing object properties

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

I propose to improve the performance of the `ObjectNormalizer` by not adding a new interface to the PropertyAccess component, but by adding some shortcut for cases where we know that we do not need to perform all checks. The added benefit is that this will not only speed up the `ObjectNormalizer` class, but will be available for every consumer of the `PropertyAccessor` without having to adapt to a new API.

TODO:

- [ ] confirm that these changes indeed introduce the same benefit as #29405 doing an actual benchmark

Commits
-------

ef7876e517 speed up accessing object properties
2019-01-30 13:41:05 +01:00
Fabien Potencier
46edcee92a bug #30028 [Form] fix some docblocks and type checks (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] fix some docblocks and type checks

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

Commits
-------

ec0c37192b [Form] fix some docblocks and type checks
2019-01-30 13:38:07 +01:00
Nicolas Grekas
3417a15d95 Merge branch '4.2'
* 4.2:
  Add missing `@internal` annotations
  Disable Twig in the profiler menu when Twig is not used
  Mark some/most implementations of Serializable as `@internal`
  [Config] ensure moving away from Serializable wont break cache:clear
  [VarDumper] dont implement Serializable in Stub
  [Config] fix compat with wrapping autoloaders
  [Messenger] fixed RabbitMQ arguments not passed as integer values
2019-01-30 12:44:59 +01:00
Nicolas Grekas
bc8656c573 Merge branch '3.4' into 4.2
* 3.4:
  Add missing `@internal` annotations
  Disable Twig in the profiler menu when Twig is not used
  Mark some/most implementations of Serializable as `@internal`
  [Config] ensure moving away from Serializable wont break cache:clear
  [VarDumper] dont implement Serializable in Stub
  [Config] fix compat with wrapping autoloaders
2019-01-30 12:44:30 +01:00
Nicolas Grekas
823a95d81e Add missing @internal annotations 2019-01-30 12:43:38 +01:00
Nicolas Grekas
82394d8a19 minor #30023 [Config] fix compat with wrapping autoloaders (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] fix compat with wrapping autoloaders

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

Registering this private method as autoloader works, until one wants to decorate autoloaders (like our DebugClassLoader does.)

Commits
-------

695d84be4c [Config] fix compat with wrapping autoloaders
2019-01-30 12:33:42 +01:00
Nicolas Grekas
fb43484f85 bug #30037 Disable Twig in the profiler menu when Twig is not used (javiereguiluz)
This PR was merged into the 3.4 branch.

Discussion
----------

Disable Twig in the profiler menu when Twig is not used

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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 | #30033
| License       | MIT
| Doc PR        | -

Commits
-------

b47408179f Disable Twig in the profiler menu when Twig is not used
2019-01-30 12:31:21 +01:00
Nicolas Grekas
591c805ccd bug #30026 [VarDumper] dont implement Serializable in Stub (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] dont implement Serializable in Stub

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

`Serializable` is really really broken...

Commits
-------

73070d7d32 [VarDumper] dont implement Serializable in Stub
2019-01-30 12:22:50 +01:00
Nicolas Grekas
fb2f57da5e minor #30035 Mark some/most implementations of Serializable as @internal (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Mark some/most implementations of Serializable as `@internal`

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

There are more usages of `Serializable` in the code base, but the remaining are unfortunately exposed as part of interfaces.

All these places are IMHO already considered internal, this just makes it explicit.

Will ease moving away from `Serializable`.

Commits
-------

7b9d73d891 Mark some/most implementations of Serializable as `@internal`
2019-01-30 12:21:16 +01:00
Nicolas Grekas
c7937c9749 bug #30034 [Config] ensure moving away from Serializable wont break cache:clear (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] ensure moving away from Serializable wont break cache:clear

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

When a resource implementation moves away from `Serializable`, the `cache:clear` command currently fails with `Warning: Class Symfony\Component\Config\Resource\ClassExistenceResource has no unserializer`. This change makes it ignore the failure, which is fine.

Commits
-------

9d3180a7e2 [Config] ensure moving away from Serializable wont break cache:clear
2019-01-30 12:20:19 +01:00
Javier Eguiluz
b47408179f Disable Twig in the profiler menu when Twig is not used 2019-01-30 11:27:26 +01:00
Nicolas Grekas
7b9d73d891 Mark some/most implementations of Serializable as @internal 2019-01-30 10:03:33 +01:00
Nicolas Grekas
9d3180a7e2 [Config] ensure moving away from Serializable wont break cache:clear 2019-01-30 09:47:57 +01:00
Christian Flothmann
ec0c37192b [Form] fix some docblocks and type checks 2019-01-30 09:09:50 +01:00
Fabien Potencier
0ac32bcc59 fixed typo 2019-01-30 08:03:13 +01:00
Fabien Potencier
0c6fd86536 minor #30031 [Console] Make "warning" in SymfonyStyle use orange color (TomasVotruba)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Console] Make "warning" in SymfonyStyle use orange color

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

Re-send of #29268

Closes #29268

Commits
-------

947aaee22c [Console] Make "warning" in SymfonyStyle use orange color
2019-01-30 07:49:09 +01:00
Tomáš Votruba
947aaee22c
[Console] Make "warning" in SymfonyStyle use orange color 2019-01-29 23:35:02 +01:00
Fabien Potencier
d18aa4d11b minor #30019 [Mime] improve some types in docblocks (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mime] improve some types in docblocks

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

Commits
-------

27463daced [Mime] improve some types in docblocks
2019-01-29 22:32:03 +01:00
Nicolas Grekas
73070d7d32 [VarDumper] dont implement Serializable in Stub 2019-01-29 17:19:17 +01:00
Nicolas Grekas
695d84be4c [Config] fix compat with wrapping autoloaders 2019-01-29 16:40:56 +01:00
Christian Flothmann
27463daced [Mime] improve some types in docblocks 2019-01-29 14:08:21 +01:00
Nicolas Grekas
50a0bda031 bug #29532 [Messenger] fixed RabbitMQ arguments not passed as integer values (thePanz)
This PR was submitted for the 4.1 branch but it was merged into the 4.2 branch instead (closes #29532).

Discussion
----------

[Messenger] fixed RabbitMQ arguments not passed as integer values

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

RabbitMQ expects some arguments to be passed as integer values.
Make sure to cast those after parsing the DSN

\cc @thomaskonrad

Commits
-------

f19c035aaa [Messenger] fixed RabbitMQ arguments not passed as integer values
2019-01-29 13:42:30 +01:00
Emanuele Panzeri
f19c035aaa [Messenger] fixed RabbitMQ arguments not passed as integer values 2019-01-29 13:42:22 +01:00
Nicolas Grekas
a3b45eb034 Merge branch '4.2'
* 4.2:
  [Cache] fix connecting using socket with phpredis
  [HttpKernel] fix nested calls to serialize when using DataCollector
2019-01-29 11:17:58 +01:00
Nicolas Grekas
48e5df87a3 [Cache] fix connecting using socket with phpredis 2019-01-29 11:14:57 +01:00
Nicolas Grekas
fac1052038 Merge branch '4.1' into 4.2
* 4.1:
  [HttpKernel] fix nested calls to serialize when using DataCollector
2019-01-29 11:04:11 +01:00
Nicolas Grekas
b7f1fe2a48 Merge branch '3.4' into 4.1
* 3.4:
  [HttpKernel] fix nested calls to serialize when using DataCollector
2019-01-29 11:03:57 +01:00
Nicolas Grekas
3cfb558f03 [HttpKernel] fix nested calls to serialize when using DataCollector 2019-01-29 11:03:44 +01:00
Nicolas Grekas
32aa969dff Merge branch '4.2'
* 4.2:
  [Routing] dont redirect routes with greedy trailing vars with no explicit slash
  skip native serialize among child and parent serializable objects
  [Routing] backport tests from 4.1
  [MonologBridge] Remove unused local variable
  Remove unreachable code
  Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
  Support use of hyphen in asset package name
  Fix format strings for deprecation notices
  Remove a harmless duplicate array key from VarDumper
  [VarDumper] Fixed search bar
  Remove gendered pronouns
  Replace gender by eye color in tests
  [Security] dont do nested calls to serialize()
2019-01-29 10:50:57 +01:00
Nicolas Grekas
adbdec838a Merge branch '4.1' into 4.2
* 4.1:
  [Routing] dont redirect routes with greedy trailing vars with no explicit slash
  skip native serialize among child and parent serializable objects
  [Routing] backport tests from 4.1
  [MonologBridge] Remove unused local variable
  Remove unreachable code
  Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
  Support use of hyphen in asset package name
  Remove gendered pronouns
  Replace gender by eye color in tests
  [Security] dont do nested calls to serialize()
2019-01-29 10:49:29 +01:00
Nicolas Grekas
05071a443a bug #30013 [Routing] dont redirect routes with greedy trailing vars with no explicit slash (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] dont redirect routes with greedy trailing vars with no explicit slash

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

From the linked issue:

> The current logic is the following:
> - when a route is declared with a trailing slash, the trimmed-slash url is redirected to the one with the slash
> - when a route is declared with *no* trailing slash, the slashed url is redirected to the trimmed-slash one
>
> That includes routes with slash-greedy requirements: when the same greedy requirement matches both the slashed and the trimmed-slash URLs, only one of them is considered the canonical one and a redirection happens.
>
> We could fine tune this logic and make an exception when a trailing slash-greedy requirement is declared with no explicit trailing slash after it. (ie disable any redirections for `/foo/{.*}` but keep it for `/foo/{.*}/`. That would mean `/foo/bar` and `/foo/bar/` wouldn't trigger the redirection for route `/foo/{.*}`, breaking the "not-semantics" property of trailing slashes for catch-all routes. Which might be legit afterall.

This PR implements this fine tuning, as that's the most BC behavior (and thus the correct one).
See #30012 for `testGreedyTrailingRequirement` in action on 3.4 as a proof.

Commits
-------

2bb8890bbb [Routing] dont redirect routes with greedy trailing vars with no explicit slash
2019-01-29 10:44:13 +01:00
Nicolas Grekas
2bb8890bbb [Routing] dont redirect routes with greedy trailing vars with no explicit slash 2019-01-29 10:39:33 +01:00
Nicolas Grekas
78c23c7838 Merge branch '3.4' into 4.1
* 3.4:
  skip native serialize among child and parent serializable objects
  [Routing] backport tests from 4.1
  Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
  Support use of hyphen in asset package name
  Remove gendered pronouns
  Replace gender by eye color in tests
  [Security] dont do nested calls to serialize()
2019-01-29 10:21:38 +01:00
Nicolas Grekas
b4357d734b bug #30006 [Security] don't do nested calls to serialize() (nicolas-grekas, Renan)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] don't do nested calls to serialize()

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

The problem (originally reported as `Symfony\Component\Security\Core\Authentication\Token\AbstractToken` issue), may occur also in classes extending `Symfony\Component\Security\Core\Exception\AuthenticationException`

Tasks:

- [x] Skip native serializer (workaround itself)
- [x] Token test
- [x] Exception test

Commits
-------

10256fc4fd skip native serialize among child and parent serializable objects
41000f1de0 [Security] dont do nested calls to serialize()
2019-01-29 10:07:09 +01:00
Nicolas Grekas
957b47726a minor #30012 [Routing] backport tests from 4.1 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] backport tests from 4.1

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

c2e0f9701d [Routing] backport tests from 4.1
2019-01-29 10:06:41 +01:00
Renan
10256fc4fd skip native serialize among child and parent serializable objects 2019-01-29 10:04:09 +01:00
Nicolas Grekas
c2e0f9701d [Routing] backport tests from 4.1 2019-01-29 09:47:12 +01:00
Fabien Potencier
be5d85e112 feature #29641 [Validator] NotBlank: add a new option to allow null values (dunglas)
This PR was squashed before being merged into the 4.3-dev branch (closes #29641).

Discussion
----------

[Validator] NotBlank: add a new option to allow null values

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- 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 | #27876
| License       | MIT
| Doc PR        | todo

This PR adds a new option to the `@NotBlank` constraint to allow null values. As described in #27876, this is particularly useful when creating web APIs.

Commits
-------

484d22a6d9 [Validator] NotBlank: add a new option to allow null values
2019-01-29 07:35:29 +01:00
Kévin Dunglas
484d22a6d9 [Validator] NotBlank: add a new option to allow null values 2019-01-29 07:35:22 +01:00
Fabien Potencier
c95fdbd074 bug #30007 [FrameworkBundle] Support use of hyphen in asset package name (damaya, XuruDragon)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Support use of hyphen in asset package name

This PR is a continuity of #28128

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

According to issue https://github.com/symfony/symfony-docs/pull/10442, we tested in a demo bundle, for example in src/AppBundle/Resources/config/config.yml a package using hyphens: app-client-frontend, and withouth the patch it fails because the package is not recognized. With the patch, it works as expected.
```yaml
framework:
    assets:
        packages:
            app-client-frontend:
                version: "%env(FRONTEND_VERSION)%"
                version_format: '%%2$s/dist/%%1$s'
                base_urls:
                  - "%env(FRONTEND_URL)%"
```

Commits
-------

5c58b6e875 Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
30b6a4f7bf Support use of hyphen in asset package name
2019-01-29 06:58:16 +01:00
Fabien Potencier
55ffdf99b8 minor #30009 [MonologBridge] Remove unused local variable (samnela)
This PR was merged into the 4.1 branch.

Discussion
----------

[MonologBridge] Remove unused local variable

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

5580473740 [MonologBridge] Remove unused local variable
2019-01-29 06:54:33 +01:00
Samuel NELA
5580473740 [MonologBridge] Remove unused local variable 2019-01-28 21:24:44 +01:00