Commit Graph

54341 Commits

Author SHA1 Message Date
Nicolas Jourdan
ad4f6f2093 [Security][Validator] Add missing Portuguese translations 2020-12-07 10:01:46 +01:00
Alexander M. Turek
4404e6a3e9 minor #39332 Add Croatian (hr) translations (jseparovic1)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Add Croatian (hr) translations

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  |no
| Deprecations? | no
| Tickets       | Fix #38734
| License       | MIT

#SymfonyHackday

Commits
-------

f2dbbd2e58 Add Croatian (hr) translations
2020-12-07 10:00:22 +01:00
Jurica Šeparović
f2dbbd2e58 Add Croatian (hr) translations 2020-12-07 10:00:14 +01:00
Jérémy Derussé
ffdfb4fb53
Assert voter returns valid decision 2020-12-06 23:36:13 +01:00
Nyholm
9d40bd80f6
minor #39348 Fix broken link to documentation in Lock and Semaphore components (ronnylt)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Fix broken link to documentation in Lock and Semaphore components

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

Commits
-------

d907d3ba83 Fix broken link to documentation in Lock and Semaphore components
2020-12-06 14:34:16 +01:00
Ronny López
d907d3ba83 Fix broken link to documentation in Lock and Semaphore components 2020-12-06 09:31:27 +01:00
Fabien Potencier
937c403f15 minor #39343 Add missing entries in gitattributes (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

Add missing entries in gitattributes

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

Adds `/.gitattributes export-ignore` in some bridges

Commits
-------

36f5ff1550 Add missing entries in gitattributes
2020-12-06 08:20:53 +01:00
Jérémy Derussé
36f5ff1550
Add missing entries in gitattributes 2020-12-05 23:16:05 +01:00
pmishev
258bea7fd5 [Form] Fixed StringUtil::trim() to trim ZERO WIDTH SPACE (U+200B) and SOFT HYPHEN (U+00AD) 2020-12-05 20:51:30 +00:00
Alexander M. Turek
8143f8a83b Fix CS. 2020-12-05 20:58:01 +01:00
Alexander M. Turek
86842ac7fb feature #39276 [FrameworkBundle] Added option to specify the event dispatcher in debug:event-dispatcher (TimoBakx)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Added option to specify the event dispatcher in debug:event-dispatcher

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | symfony/symfony-docs#14650
| Tags | #SymfonyHackday

### Description:
In the recent security improvements, new event dispatchers were added (one for each firewall). These were not visible in the `debug:event-dispatcher` command. This PR adds an option to define a event dispatcher to show the events (and listeners) for that specific event dispatcher. Without any options, the default dispatcher is shown (identical to previous working)

In order to be able to fetch specific event dispatchers, I tagged all event dispatchers with a new `kernel.event-dispatcher` tag.

### Usage:
`bin/console debug:event-dispatcher --dispatcher=[servicename] [other options] [event]`

### Subtasks:
- [x] Add `dispatcher` option
- [x] Add `kernel.event_dispatcher` tag to all event dispatchers
- [x] Add autoconfigure tag for services implementing `EventDispatcherInterface`
- [x] Update Descriptor classes to specify the chosen dispatcher
- [x] Update changelog
- [x] Add documentation

Commits
-------

62398b525e [FrameworkBundle] Added option to specify the event dispatcher in debug:event-dispatcher
2020-12-05 20:54:31 +01:00
Timo Bakx
62398b525e [FrameworkBundle] Added option to specify the event dispatcher in debug:event-dispatcher 2020-12-05 20:54:21 +01:00
Alexander M. Turek
ffab85c8c0 Merge branch '5.2' into 5.x
* 5.2:
  [Notifier] Fix tests with PHPUnit 9.5.
  Fix merge.
  Fix CS
  [Messenger] Test generated SQL
  [Config] YamlReferenceDumper: No default value required for VariableNode with array example
  Remove PHPUnit configuration files from components without tests.
  [DependencyInjection] Fix container linter for union types.
2020-12-05 20:10:20 +01:00
Alexander M. Turek
09567d9990 minor #39338 [Notifier] Fix tests with PHPUnit 9.5 (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Fix tests with PHPUnit 9.5

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

Follow-up to #39331, #39335.

#SymfonyHackday

Commits
-------

cb66c523fe [Notifier] Fix tests with PHPUnit 9.5.
2020-12-05 20:09:42 +01:00
Alexander M. Turek
cb66c523fe [Notifier] Fix tests with PHPUnit 9.5. 2020-12-05 19:56:23 +01:00
Alexander M. Turek
dbc1db21cd Merge branch '5.1' into 5.2
* 5.1:
  Fix merge.
  Fix CS
  [Messenger] Test generated SQL
  [Config] YamlReferenceDumper: No default value required for VariableNode with array example
  Remove PHPUnit configuration files from components without tests.
  [DependencyInjection] Fix container linter for union types.
2020-12-05 19:32:58 +01:00
Alexander M. Turek
7c31fa0537 Fix merge. 2020-12-05 19:20:45 +01:00
Alexander M. Turek
f13821e881 Merge branch '4.4' into 5.1 2020-12-05 18:55:33 +01:00
Fabien Potencier
bda2dcdf93 bug #39251 [DependencyInjection] Fix container linter for union types (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix container linter for union types

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39233
| License       | MIT
| Doc PR        | N/A

Commits
-------

e26893b122 [DependencyInjection] Fix container linter for union types.
2020-12-05 18:12:03 +01:00
Alexander M. Turek
cf07627956 minor #39214 [Messenger] Test generated SQL (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Test generated SQL

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

Follow-up to #39166.

This is an attempt to the SQL generated by the `Symfony\Component\Messenger\Transport\Doctrine\Connection::get()` method. The challange was to create a locking SELECT statement, taking into account the different ways to create a lock in different SQL dialects.

This test verifies if the correct lock statements are generated for MySQL and SQL Server.

Commits
-------

1f1b62afb6 [Messenger] Test generated SQL
2020-12-05 18:10:39 +01:00
Fabien Potencier
fd3c60b315 Fix CS 2020-12-05 18:09:55 +01:00
Alexander M. Turek
1f1b62afb6 [Messenger] Test generated SQL 2020-12-05 18:08:48 +01:00
Fabien Potencier
1f6f693aa5 bug #39336 [Config] YamlReferenceDumper: No default value required for VariableNode with array example (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] YamlReferenceDumper: No default value required for VariableNode with array example

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

This will fix #39328 in a better way.

A `VariableNode` may have an array as value and also a default value as "null". (Like the workflow component).
When we dump the config, we generate invalid yaml:

```
    workflows:
        enabled:              false
        workflows:
            # Prototype
            name:
                # Select which Transition events should be dispatched for this Workflow
                events_to_dispatch:   null

                    # Examples:
                    - workflow.enter
                    - workflow.transition

```

With this PR, we will remove the `null` default value from the dumped config.

#SymfonyHackday

Commits
-------

9104fd4539 [Config] YamlReferenceDumper: No default value required for VariableNode with array example
2020-12-05 18:07:51 +01:00
Fabien Potencier
3eb73efc34 minor #39335 [Notifier] Remove PHPUnit configuration files from components without tests (derrabus)
This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] Remove PHPUnit configuration files from components without tests

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

Follows #39331 by @wouterj.

PHPUnit 9.5 fails if we look for tests in directories that do not exist. This is very reasonable behavior, imho.

However, we do have some bridges in the Notifier component that don't provide any tests. Running PHPUnit on those bridges is pointless, which is why I'd like to remove the PHPUnit configuration from them. We can re-add the files as soon as we add tests.

#SymfonyHackday

Commits
-------

710340dfb2 Remove PHPUnit configuration files from components without tests.
2020-12-05 18:06:53 +01:00
Nyholm
9104fd4539
[Config] YamlReferenceDumper: No default value required for VariableNode with array example 2020-12-05 17:41:45 +01:00
Fabien Potencier
e6eef9b5b7 bug #39018 [FrameworkBundle] Fixed validation of php_errors.log (lyrixx)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Fixed validation of php_errors.log

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

It's actually possible to pass a map or PHP errors => Log level like
following

```yaml
    php_errors:
        log:
            !php/const \E_DEPRECATED: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_DEPRECATED: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_NOTICE: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_NOTICE: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_STRICT: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_COMPILE_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_CORE_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_RECOVERABLE_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_COMPILE_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_PARSE: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_CORE_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
```

Commits
-------

45519f2e9e [FrameworkBundle] Added support for configuring PHP error level to log level
2020-12-05 17:36:24 +01:00
Alexander M. Turek
710340dfb2 Remove PHPUnit configuration files from components without tests. 2020-12-05 17:36:14 +01:00
Fabien Potencier
df65ffe566 feature #39042 [Console] Extracting ProgressBar's format's magic strings into const (CesarScur)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Console] Extracting ProgressBar's format's magic strings into const

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

The existence of these magic string is propagating outside the project on the user land while constructing a command:

```php
$bar->setFormat('very_verbose');
```

Objective is to provide reusability and resilience to miss naming:
```php
$bar->setFormat(ProgressBar::VERBOSE);
```

Commits
-------

a4b26061a9 Extracting ProgressBar's format's magic strings into const
2020-12-05 17:31:32 +01:00
Grégoire Pineau
45519f2e9e [FrameworkBundle] Added support for configuring PHP error level to log level
This commit allow the following configuration
```yaml
    php_errors:
        log:
            !php/const \E_DEPRECATED: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_DEPRECATED: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_NOTICE: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_NOTICE: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_STRICT: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_COMPILE_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_CORE_WARNING: !php/const Psr\Log\LogLevel::ERROR
            !php/const \E_USER_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_RECOVERABLE_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_COMPILE_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_PARSE: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
            !php/const \E_CORE_ERROR: !php/const Psr\Log\LogLevel::CRITICAL
```
2020-12-05 17:25:54 +01:00
cesar
a4b26061a9 Extracting ProgressBar's format's magic strings into const 2020-12-05 17:13:03 +01:00
Fabien Potencier
7dcaf98373 Merge branch '5.2' into 5.x
* 5.2:
  [Messenger] StopWorkersCommand improve doc helper
  Added compatibility with PHPunit 9.5
  do not apply the Valid constraint on scalar form data
  [Test] Reproduce issue with cascading validation
  [SecurityBundle] Don't use the container as resource type in fixtures.
  Fix bug with whitespace in Kernel::stripComments()
2020-12-05 17:05:36 +01:00
Fabien Potencier
2f607dea7d Merge branch '5.1' into 5.2
* 5.1:
  [Messenger] StopWorkersCommand improve doc helper
  Added compatibility with PHPunit 9.5
  do not apply the Valid constraint on scalar form data
  [Test] Reproduce issue with cascading validation
  [SecurityBundle] Don't use the container as resource type in fixtures.
  Fix bug with whitespace in Kernel::stripComments()
2020-12-05 17:05:27 +01:00
Fabien Potencier
7e577b9cd9 Merge branch '4.4' into 5.1
* 4.4:
  [Messenger] StopWorkersCommand improve doc helper
  Added compatibility with PHPunit 9.5
  do not apply the Valid constraint on scalar form data
  [Test] Reproduce issue with cascading validation
  [SecurityBundle] Don't use the container as resource type in fixtures.
  Fix bug with whitespace in Kernel::stripComments()
2020-12-05 17:05:09 +01:00
Fabien Potencier
21ef411cc9 bug #39333 [Form] do not apply the Valid constraint on scalar form data (lchrusciel, xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] do not apply the Valid constraint on scalar form data

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

#SymfonyHackday

Commits
-------

453bb3ebde do not apply the Valid constraint on scalar form data
41b9457887 [Test] Reproduce issue with cascading validation
2020-12-05 17:02:18 +01:00
Fabien Potencier
935495868a bug #39331 [PhpUnitBridge] Fixed PHPunit 9.5 compatibility (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fixed PHPunit 9.5 compatibility

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

Let's see if this works 🍀

#SymfonyHackday

Commits
-------

5134de52f1 Added compatibility with PHPunit 9.5
2020-12-05 16:57:56 +01:00
Fabien Potencier
d0d0ee3c4f minor #39217 [Messenger] StopWorkersCommand improve doc helper (94noni)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Messenger] StopWorkersCommand improve doc helper

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

Small improvement :)

Commits
-------

e136068743 [Messenger] StopWorkersCommand improve doc helper
2020-12-05 16:51:46 +01:00
Antoine Makdessi
e136068743 [Messenger] StopWorkersCommand improve doc helper 2020-12-05 16:51:39 +01:00
Fabien Potencier
751352c741 minor #39292 [DependencyInjection] Add missing parameter type declarations to loader classes (derrabus)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Add missing parameter type declarations to loader classes

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

This PR adds missing parameter type declarations to the loader classes of the DI component. We initially omitted them in order to stay compatible to the Config component of 4.4. But that compatibility was dropped afterwards and we somehow forgot to add the types here.

Commits
-------

de0dbd88d2 [DependencyInjection] Add missing parameter type declarations to loader classes.
2020-12-05 16:47:19 +01:00
Fabien Potencier
caeac51317 feature #39323 Search for pattern on debug:event-dispatcher (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

Search for pattern on debug:event-dispatcher

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

When running `bin/console event-dispatcher` you may pass it an argument to show what event you are interested to see the listeners for. Example:

```
bin/console event-dispatcher kernel.request
bin/console debug:event-dispatcher "Symfony\Component\Security\Http\Event\CheckPassportEvent"
```

Since more and more events are using FQCN now, this is a handful to write. Other questions that I face is, should I use single backslash `\` or double `\\`?

This PR propose that you can use a pattern as second argument. If there is no exact match, it will search for similar event names. Say:

```
bin/console debug:event-dispatcher CheckPassportEvent
bin/console debug:event-dispatcher checkpassport
bin/console debug:event-dispatcher Security
bin/console debug:event-dispatcher Security
bin/console debug:event-dispatcher App
```

#SymfonyHackday

Commits
-------

ab31ee9966 Search for pattern on debug:event-dispatcher
2020-12-05 16:37:59 +01:00
Nyholm
ab31ee9966 Search for pattern on debug:event-dispatcher 2020-12-05 16:37:50 +01:00
Wouter de Jong
5134de52f1 Added compatibility with PHPunit 9.5 2020-12-05 16:15:30 +01:00
Christian Flothmann
453bb3ebde do not apply the Valid constraint on scalar form data 2020-12-05 16:10:06 +01:00
Łukasz Chruściel
41b9457887 [Test] Reproduce issue with cascading validation 2020-12-05 16:10:06 +01:00
Alexander M. Turek
37d823dd07 feature #39317 [Form] Changed DataMapperInterface $forms parameter type to \Traversable (vudaltsov)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Form] Changed DataMapperInterface $forms parameter type to \Traversable

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix #39311
| License       | MIT
| Doc PR        | no

Didn't touch `PropertyPathMapper` because it's deprecated anyway.

Commits
-------

ce77be2507 [Form] Changed DataMapperInterface $forms parameter type to \Traversable
2020-12-05 14:50:03 +01:00
vudaltsov
ce77be2507 [Form] Changed DataMapperInterface $forms parameter type to \Traversable 2020-12-05 14:49:49 +01:00
Fabien Potencier
4ce800f840 minor #39324 [SecurityBundle] Don't use the container as resource type in fixtures (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Don't use the container as resource type in fixtures

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

Discovered while working on #39292: Some fixtures of SecurityBundle call config loaders and pass the whole container as resource type. This does not really make sense.

Commits
-------

e7e38b7213 [SecurityBundle] Don't use the container as resource type in fixtures.
2020-12-05 13:50:50 +01:00
Fabien Potencier
cdb1883843 bug #39220 [HttpKernel] Fix bug with whitespace in Kernel::stripComments() (ausi)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Fix bug with whitespace in Kernel::stripComments()

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

`Kernel::stripComments()` removes significant whitespace in some cases.

I noticed this in one of the generated classes, the code `<?php include_once \dirname(__DIR__).'/file.php';` got replaced with `<?php include_once\dirname(__DIR__).'/file.php';` which is a syntax error.

Commits
-------

8d368e1fe3 Fix bug with whitespace in Kernel::stripComments()
2020-12-05 13:50:17 +01:00
Alexander M. Turek
e7e38b7213 [SecurityBundle] Don't use the container as resource type in fixtures. 2020-12-05 13:07:14 +01:00
Alexander M. Turek
de0dbd88d2 [DependencyInjection] Add missing parameter type declarations to loader classes. 2020-12-05 12:11:23 +01:00
Alexander M. Turek
1bf434139a Merge branch '5.2' into 5.x
* 5.2:
  [HttpFoundation] Make test pass without Xdebug.
  [Mime] Leverage PHP 8's detection of CSV files.
  [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests.
  [FrameworkBundle] TextDescriptor::formatControllerLink checked method…
  Fix CS
  [HttpClient] throw clearer error when no scheme is provided
  Fix github pr template and include 5.2 for bugfixes
  [HttpFoundation] Ignore stack trace printed by Xdebug 3.
  fix lexing backslashes in single quoted strings
2020-12-05 11:59:40 +01:00