Commit Graph

52262 Commits

Author SHA1 Message Date
Timo Bakx
62398b525e [FrameworkBundle] Added option to specify the event dispatcher in debug:event-dispatcher 2020-12-05 20:54:21 +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
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
Alexander M. Turek
72abcc3051 Merge branch '5.1' into 5.2
* 5.1:
  [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:51:53 +01:00
Alexander M. Turek
2cf0686f72 Merge branch '4.4' into 5.1
* 4.4:
  [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:32:07 +01:00
Alexander M. Turek
0ded672a60 minor #39322 [HttpFoundation] Make test pass without Xdebug (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Make test pass without Xdebug

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

Fixup of #39293. This change should make the tests pass without Xdebug. Sorry for the messup. 🙈

Commits
-------

cf94f2a591 [HttpFoundation] Make test pass without Xdebug.
2020-12-05 10:12:38 +01:00
Alexander M. Turek
cf94f2a591 [HttpFoundation] Make test pass without Xdebug. 2020-12-05 09:52:36 +01:00
Fabien Potencier
4a2946b46d bug #39252 [Mime] Leverage PHP 8's detection of CSV files (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Leverage PHP 8's detection of CSV files

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

Commits
-------

41a965cdc4 [Mime] Leverage PHP 8's detection of CSV files.
2020-12-05 09:45:34 +01:00
Alexander M. Turek
41a965cdc4 [Mime] Leverage PHP 8's detection of CSV files. 2020-12-05 09:25:17 +01:00
Fabien Potencier
66d3f22cdf minor #39295 [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests. (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests.

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

While debugging HttpFoundation's functional tests with different PHP binaries, I noticed that the webserver process that is started there would always use the `php` binary from my `$PATH` instead of the binary I'm running PHPUnit with.

This PR attempts to fix this by using the `PHP_BINARY` constant.

Commits
-------

9208c69b21 [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests.
2020-12-05 09:21:21 +01:00
Alexander M. Turek
9208c69b21 [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests. 2020-12-05 09:17:15 +01:00
Fabien Potencier
eb6a79203b bug #39313 [FrameworkBundle] TextDescriptor::formatControllerLink checked method… (fjogeleit)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] TextDescriptor::formatControllerLink checked method…

…_exists method before it ensures that $controller is not null

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

Today I tried PHP8 with Symfony 5.2. - by checking my routes with
```
bin/console debug:router
```

It throws
```
 method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
```

The reason is the configured auth route for the login API defined in routes.yaml:
```
authorization::login:
  path: '/login'
```
This route has no controller configured and the value of $controller in `TextDescriptor::formatControllerLink` in the FrameworkBundle is `null`. This method has a elseif condition with `method_exists` without a check if $controller is a string or object.
In PHP8 this throws an exception/error and did not work. This PR checks that `$controller` is not null before the method_exists check to prevent this failure.

I'm not sure how to test this in the existing Testsuite

Commits
-------

67bd779ef4 [FrameworkBundle] TextDescriptor::formatControllerLink checked method…
2020-12-05 09:14:47 +01:00
Frank Jogeleit
67bd779ef4 [FrameworkBundle] TextDescriptor::formatControllerLink checked method… 2020-12-05 09:14:40 +01:00
Fabien Potencier
21d4c09a1c minor #39320 Move @experimental annotations to 5.3 (fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Move @experimental annotations to 5.3

| Q             | A
| ------------- | ---
| Branch?       | 5.x <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

b07608c0fe Move @experimental annotations to 5.3
2020-12-05 08:38:15 +01:00
Fabien Potencier
b07608c0fe Move @experimental annotations to 5.3 2020-12-05 08:36:41 +01:00
Fabien Potencier
db4883d115 Merge branch '5.2' into 5.x
* 5.2:
  Add missing entries in .gitattributes
  Fix @experimental annotations
  Remove not used mailer_transport.xml service config
  Update README.md
2020-12-05 08:34:44 +01:00
Fabien Potencier
ac9858b0c8 minor #39318 Fix @experimental annotations (fabpot)
This PR was merged into the 5.2 branch.

Discussion
----------

Fix @experimental annotations

| Q             | A
| ------------- | ---
| Branch?       | 5.2 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

07781474bc Fix @experimental annotations
2020-12-05 08:34:04 +01:00
Fabien Potencier
71591dfd38 Merge branch '5.1' into 5.2
* 5.1:
  Add missing entries in .gitattributes
  Update README.md
2020-12-05 08:33:16 +01:00
Fabien Potencier
8a6ab55a74 minor #39319 Add missing entries in .gitattributes (fabpot)
This PR was merged into the 5.1 branch.

Discussion
----------

Add missing entries in .gitattributes

| Q             | A
| ------------- | ---
| Branch?       | 5.1 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

a0e7fc36a3 Add missing entries in .gitattributes
2020-12-05 08:32:32 +01:00
Fabien Potencier
a0e7fc36a3 Add missing entries in .gitattributes 2020-12-05 08:09:10 +01:00
Fabien Potencier
07781474bc Fix @experimental annotations 2020-12-05 07:51:44 +01:00
Fabien Potencier
1e15aa69f4 minor #39293 [HttpFoundation] Ignore stack trace printed by Xdebug 3 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Ignore stack trace printed by Xdebug 3

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

If we're running HttpFoundation's functional tests with Xdebug 3, a stack trace will be printed when a warning is emitted. This confuses our `cookie_max_age` test currently where we perform a `setcookie()` call that will emit a warning.

I have patched the corresponding fixture so the printed stack trace is ignored.

A failed test can be seen here: https://travis-ci.com/github/symfony/symfony/jobs/452077515#L11078

Commits
-------

b67baa4e7f [HttpFoundation] Ignore stack trace printed by Xdebug 3.
2020-12-05 07:41:35 +01:00
Fabien Potencier
4dd16d11eb Fix CS 2020-12-05 07:31:47 +01:00
Fabien Potencier
bb0362d167 feature #39258 [Notifier] Add ContextBlock for slack notifier (norkunas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add ContextBlock for slack notifier

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This block allows to add small text to the message layout footer

Commits
-------

6687e23c7d Add ContextBlock for slack notifier
2020-12-05 07:30:00 +01:00
Fabien Potencier
fb2ea6f632 Fix CS 2020-12-05 07:27:59 +01:00
Fabien Potencier
53e1bc01b7 feature #39300 [Notifier] Check for maximum number of buttons in slack action block (malteschlueter)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Check for maximum number of buttons in slack action block

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

After having problems with the SlackSectionBlock (https://github.com/symfony/symfony/pull/39236) i thought it would be helpful to also have a check for the maximum elements in the SlackActionsBlock and a test. https://api.slack.com/reference/block-kit/blocks#actions
Edit: The actual documentation says that the maximum are 5 elements but this is outdated. The actual number is 25. The slack support confirmed that.

Can this be added to 5.2 or better to the 5.x branch?

There are also some other implementations of slack blocks like the SlackDividerBlock but they have only a constructor and no additional methods. Should we also add some tests for them even if they have no extra logic?

Commits
-------

a7936d2b0e [Notifier] Check for maximum number of buttons in slack action block
2020-12-05 07:13:36 +01:00
Malte Schlüter
a7936d2b0e [Notifier] Check for maximum number of buttons in slack action block 2020-12-05 07:13:20 +01:00
Fabien Potencier
1177baa770 bug #39286 [HttpClient] throw clearer error when no scheme is provided (BackEndTea)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient] throw clearer error when no scheme is provided

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

This could be considred a BC break, as previously this would've  a `TransportExcepiton`, instead of an `InvalidArgumentException`. But i see no reason to catch this specific error, as it would generally be a configuration error.

Commits
-------

4d821d6c34 [HttpClient] throw clearer error when no scheme is provided
2020-12-05 07:03:15 +01:00