Commit Graph

45269 Commits

Author SHA1 Message Date
Nicolas Grekas
301ec496ea [Lock][HttpFoundation] Hot fix 2019-10-30 14:15:17 +01:00
Timo Bakx
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime 2019-10-30 14:03:57 +01:00
Thomas Calvet
58161b8eec [4.3] Remove unused local variables 2019-10-30 13:58:49 +01:00
Nicolas Grekas
0b5b6fa79f Merge branch '4.3' into 4.4
* 4.3:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [HttpClient] always return the empty string when the response cannot have a body
  [TwigBundle][exception] Added missing css variable to highlight line in trace
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:55:29 +01:00
Nicolas Grekas
1aaf58b55a Merge branch '3.4' into 4.3
* 3.4:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:53:54 +01:00
Nicolas Grekas
27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| Q             | A
| ------------- | ---
| Branch?       | 3.4  <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

<!--
Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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
-------

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas
1a92f44a33 bug #34144 [Serializer] Improve messages for unexpected resources values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce276c7 [Serializer] Improve messages for unexpected resources values
2019-10-30 13:39:30 +01:00
Nicolas Grekas
c424c5adb7 bug #34186 [HttpClient] always return the empty string when the response cannot have a body (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] always return the empty string when the response cannot have a body

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This will fix tests on 4.4 also.

Commits
-------

f78e14332e [HttpClient] always return the empty string when the response cannot have a body
2019-10-30 13:01:49 +01:00
Nicolas Grekas
f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Fabien Potencier
6bb7751fc1 feature #34177 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

```yaml
framework:
    session:
        handler_id: 'redis://localhost'
        handler_id: '%env(REDIS_URL)%'
        handler_id: '%env(DATABASE_URL)%'
        handler_id: 'file://%kernel.project_dir%/var/sessions'
```

etc.

the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)

Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)

Commits
-------

de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
2019-10-30 11:42:43 +01:00
Nicolas Grekas
de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN 2019-10-30 10:56:04 +01:00
Christian Flothmann
9e7ab8c003 feature #32107 [Validator] Add AutoMapping constraint to enable or disable auto-validation (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #32107).

Discussion
----------

[Validator] Add AutoMapping constraint to enable or disable auto-validation

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32070, #32015   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo

As discussed in #32070 and #32015, it's sometimes mandatory to prevent some classes or properties to be auto mapped (auto-validated). This PR introduces a new constraint, `@AutoMapping` allowing to do exactly that. Examples:

Class:

```php
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @Assert\AutoMapping(false)
 */
class DoctrineLoaderNoAutoMappingEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=20, unique=true)
     */
    public $maxLength;
}
```

Property:

```php
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class DoctrineLoaderEntity extends DoctrineLoaderParentEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=10)
     * @Assert\AutoMapping(false)
     */
    public $noAutoMapping;
}
```

The rules are the following:

* If the constraint is present on a property, and set to true, auto-mapping is always on, regardless of the config, and of any class level annotation
* If the constraint is present on a property, and set to false, auto-mapping is always off, regardless of the config, and of any class level annotation
* If the constraint is present on a class, and set to true, auto-mapping is always on except if a the annotation has been added to a specific property, and regardless of the config
* If the constraint is present on a class, and set to false, auto-mapping is always off except if a the annotation has been added to a specific property, and regardless of the config

Commits
-------

f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation
2019-10-30 08:50:31 +01:00
Kévin Dunglas
f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation 2019-10-30 08:50:22 +01:00
Robin Chalas
8e2bc5fe0a minor #34180 [DI] Fix "!tagged" related upgrade/changelog notes (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Fix "!tagged" related upgrade/changelog notes

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes
2019-10-30 00:18:42 +01:00
Robin Chalas
81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes 2019-10-29 21:21:43 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Yonel Ceruto
2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau
5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas
d08273236c feature #34170 Re-allow to use "tagged" in service definitions (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

Re-allow to use "tagged" in service definitions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+.

Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009)

Commits
-------

7b7dc0df9a Re-allow to use "tagged" in service definitions
2019-10-29 15:17:53 +01:00
Kévin Dunglas
7b7dc0df9a
Re-allow to use "tagged" in service definitions 2019-10-29 15:11:25 +01:00
Nicolas Grekas
380e0fc984 feature #34043 [Lock] Add missing lock connection string in FrameworkExtension (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Add missing lock connection string in FrameworkExtension

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | TODO

This PR adds support to missing DSN in Lock component

```
framework:
  lock: sqlite:/tmp/db
  lock: mysql:host=localhost;dbname=test
  lock: zookeeper://localhost:2181
```

The PR also removes intermediate "internal" services `.lock_connection.*` in favor of factory `StoreFactory::createStore`. Which remove duplicate code.

This PR also deprecate unused services `lock.store.*` and  `lock.store.*.abstract`

Commits
-------

2db24cf582 Add missing lock connection string in FrameworkExtension
2019-10-29 14:57:27 +01:00
Nicolas Grekas
8ec1f14c47 Merge branch '4.3' into 4.4
* 4.3:
  [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:52:16 +01:00
Nicolas Grekas
2326f2882c bug #34167 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() (dunglas)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

This parameter was already deprecated in Symfony 4. Allowing to not pass it in Symfony 4.3 without triggering a deprecation allows to support both HttpFoundation 4.3 and 4.4, otherwise it's not possible.

Needed to make API Platform compatible with Symfony 5 (https://github.com/api-platform/core/pull/3009)

Commits
-------

e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:51:20 +01:00
Kévin Dunglas
e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00
Grégoire Pineau
31c402a003 [VarDumper] Do not dump the EventDispatcher 2019-10-29 14:41:12 +01:00
Jérémy Derussé
2db24cf582
Add missing lock connection string in FrameworkExtension 2019-10-29 14:34:12 +01:00
Nicolas Grekas
e2c625e78b feature #34057 [Lock][Cache] Allows URL DSN in PDO adapters (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock][Cache] Allows URL DSN in PDO adapters

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | TODO

This PR duplicate a feature from PdoSessionHandler that convert URL DSN ( ie. mysql://localhost/test) into PDO DSN (ie. mysql:host=localhost;dbname=test)

that would ease configuration by using the same well-known variable
```
framework:
  lock: '%env(DATABASE_URL)%'
```

note: I applied the same change on Cache component for consistency.

Commits
-------

474daf976e Allows URL DSN in Lock and Cache
2019-10-29 14:07:00 +01:00
Nicolas Grekas
a302d2050e [DI] fix regexp for anonymous services with no class set 2019-10-29 12:56:37 +01:00
Kévin Dunglas
3b11a76686
feature #34151 [DomCrawler] normalizeWhitespace should be true by default (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #34151).

Discussion
----------

[DomCrawler] normalizeWhitespace should be true by default

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

According to the [DOM](https://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-isElementContentWhitespace) and [WebDriver](https://www.w3.org/TR/webdriver/#get-element-text) specs, browsers always return the normalized text. In Panther, because of WebDriver, it's not even possible without dirty hacks to retrieve the "non normalized" text.

For compatibility with Panther it's mandatory to set this new parameter (introduced in 4.4) to `true` by default.

 I propose to change the default value to true in 5.0, it has the benefit of:

* being spec-compliant (in 5.0, text will be normalized by default)
* being cleaner when using Panther (`$node->text()` instead of `$node->text(null, true)`, passing true is mandatory because Panther doesn't support retrieving the non-normalized text)

For backward compatible with 4.x versions, if no argument is passed and the returned text isn't the same than the normalized one, a notice is triggered.

Commits
-------

54d46eef67 [DomCrawler] normalizeWhitespace should be true by default
2019-10-29 12:38:43 +01:00
Kévin Dunglas
54d46eef67
[DomCrawler] normalizeWhitespace should be true by default 2019-10-29 12:38:30 +01:00
Thomas Calvet
ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Nicolas Grekas
452c863639 [Cache] add DeflateMarshaller - remove phpredis compression 2019-10-29 11:36:36 +01:00
Kévin Dunglas
42be5f8132
Merge branch '4.3' into 4.4
* 4.3:
  [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:04:46 +01:00
Kévin Dunglas
ee4b99f227
bug #33828 [DoctrineBridge] Auto-validation must work if no regex are passed (dunglas)
This PR was squashed before being merged into the 4.3 branch (closes #33828).

Discussion
----------

[DoctrineBridge] Auto-validation must work if no regex are passed

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Backport of https://github.com/symfony/symfony/pull/32107/files#r295762928.
This behavior if faulty, if no regex are passed, autvalidation must be triggered, [as done in `PropertyInfoLoader`](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php#L50).

Commits
-------

5ed7d6c759 [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:03:42 +01:00
Kévin Dunglas
5ed7d6c759
[DoctrineBridge] Auto-validation must work if no regex are passed 2019-10-29 11:03:05 +01:00
Robin Chalas
662b35e30e Merge branch '4.3' into 4.4
* 4.3:
  remove outdated workflow test
  drop wrong test (fix merge)
2019-10-29 04:34:23 +01:00
Robin Chalas
f233259c68 remove outdated workflow test 2019-10-29 03:10:02 +01:00
Robin Chalas
6c2253415f drop wrong test (fix merge) 2019-10-29 02:54:26 +01:00
Glodzienski
16bd71b5b1
Adding some validations tags on validators.et.xlf 2019-10-28 21:40:18 -03:00
Yonel Ceruto
cc2858f7d0 bug #34158 [ErrorRenderer] Security fix: hide sensitive error messages (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] Security fix: hide sensitive error messages

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

This PR fixes a security issue. Exception messages must not be displayed except when debugging, because they can contain sensitive data including credentials.
For instance, PDO and Doctrine throw exception with message such as `The details are: SQLSTATE[HY000] [1045] Access denied for user 'root'@'db.example.com' (using password: NO)` revealing internal details about the infrastructure usful for an attacker.

Also, I still think that ErrorRenderer should be removed in favor of using the Serializer directly (see https://github.com/symfony/symfony/pull/33650#issuecomment-534441889). I'll try to open some PRs to do that in tomorrow.

Commits
-------

d7d7f22 [ErrorRenderer] Security fix: hide sensitive error messages
2019-10-28 19:43:36 -04:00
Kévin Dunglas
d7d7f22dbe [ErrorRenderer] Security fix: hide sensitive error messages 2019-10-28 19:37:55 -04:00
Robin Chalas
913c485efd minor #34159 [Security] Fix merge (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fix merge

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

fd0ed42adb [Security] Fix merge
2019-10-28 23:51:27 +01:00
Robin Chalas
fd0ed42adb [Security] Fix merge 2019-10-28 23:18:08 +01:00
Nicolas Grekas
0f5a7b8b41 Merge branch '4.3' into 4.4
* 4.3:
  Fix an error message to be more accurate
2019-10-28 22:57:16 +01:00
Nicolas Grekas
7b3d5cd615 minor #34157 [OptionsResolver] Fix an error message to be more accurate (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30432
| License       | MIT
| Doc PR        | -

Follow-up https://github.com/symfony/symfony/pull/30442 for 4.3

Commits
-------

1be68a752a Fix an error message to be more accurate
2019-10-28 22:53:11 +01:00
Yonel Ceruto
1be68a752a Fix an error message to be more accurate 2019-10-28 16:59:01 -04:00
Nicolas Grekas
05f7f4e147 Merge branch '4.3' into 4.4
* 4.3:
  [OptionsResolve] Revert change in tests for a not-merged change in code
  [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
  [Workflow] Made the configuration more robust for the 'property' key
  [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
  #30432 fix an error message
  fix paths to detect code owners
  [HttpClient] ignore the body of responses to HEAD requests
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  [SecurityBundle] Fix wrong assertion
  Remove unused local variables in tests
  [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
  Make sure to collect child forms created on *_SET_DATA events
  [WebProfilerBundle] Improve display in Email panel for dark theme
  do not render errors for checkboxes twice
2019-10-28 21:30:34 +01:00
Robin Chalas
2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (and forward)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

<!--
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):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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
-------

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
Ryan Weaver
01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context" 2019-10-28 13:18:09 -04:00