This PR was merged into the 5.1-dev branch.
Discussion
----------
[DI] added possibility to define services with abstract arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#31769
| License | MIT
| Doc PR | n/a
feature caused by rfc #31769 from issues list
I hope, this PR will be useful
Abstract argument have to replaced by one of compiler passes or exception will be thrown.
Example:
This service definition
```xml
...
<service id="App\Test\Test">
<argument key="$a" type="abstract">should be defined by TestPass</argument>
</service>
...
```
or this for yaml
```yaml
App\Test\Test:
arguments:
$a: !abstract should be defined by TestPass
```
causes exception like `Argument "$a" of service "App\Test\Test" is abstract (should be defined by TestPass), did you forget to define it?`
if argument was not replaced by compiler pass
```php
...
public function process(ContainerBuilder $container)
{
$test = $container->getDefinition(Test::class);
$test->setArgument('$a', 'test');
}
...
```
Commits
-------
62fefaa59f [DI] added possibility to define services with abstract arguments
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Routing] add priority option to annotated routes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Tickets | Fix #26132
| License | MIT
| Doc PR | -
This PR allows defining the priority of routes using annotations:
`@Route(name="foo", priority=10)`
As requested [in this comment](https://github.com/symfony/symfony/pull/26132#pullrequestreview-352321332), priority is reserved to using annotations. For other formats, the order works fine.
Commits
-------
8522a83217 [Routing] add priority option to annotated routes
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Contracts/Deprecation] Provide a generic function and convention to trigger deprecation notices
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This PR results from a discussion we had yesterday with @alcaeus, @beberlei and others at the Symfony UG meetup in Berlin (thanks SensioLabs for bringing me there).
It provides a generic function and convention to trigger deprecation notices, which could be a better alternative to the `@trigger_error(..., E_USER_DEPRECATED)` calls that we use currently.
This proposed package would provide a single global function named `deprecated()`.
Its purpose is to trigger deprecations in a way that can be silenced on production environment
by using the `zend.assertions` ini setting and that can be caught during development to generate reports.
The function requires at least 3 arguments:
- the name of the package that is triggering the deprecation
- the version of the package that introduced the deprecation
- the message of the deprecation
- more arguments can be provided: they will be inserted in the message using `printf()` formatting
Example:
```php
deprecated('symfony/blockchain', 8.9, 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
```
This will generate the following message:
`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
Check #35550 to see how using this function could look like on Symfony itself.
Commits
-------
f0f41cbfc5 [Contracts/Deprecation] Provide a generic function and convention to trigger deprecation notices
This PR was merged into the 3.4 branch.
Discussion
----------
[Security] Replace 403 with 401 in `onAuthenticationFailure` method
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
This comment in `onAuthenticationFailure` was misleading since a 401 status code should probably be returned instead of a 403.
Commits
-------
73bc793be2 Replace 403 with 401 in onAuthenticationFailure method
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Form] Add "is empty callback" to form config
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/31572 for 4.4+
| License | MIT
| Doc PR | -
This PR introduces a new feature that allow to resolve a bug.
Currently, the `isEmpty()` behavior of the `Form` class is the same whatever its configuration. That prevents us to specify a different behavior by form type.
But I think that some form types should have dedicated empty values. For example, the `CheckboxType` model data either resolves to `true` (checked) or `false` (unchecked). But `false` is not an empty value in the `Form::isEmpty()` method, so a `CheckboxType` form can never be empty. `false` should not be in that list because for other form types, it's perfectly fine that it's not considered as an empty value.
The problem is better seen in https://github.com/symfony/symfony/issues/31572 with a `ChoiceType` that is never considered as empty (when no radio button is checked).
Being able to specify the "is empty" behavior by form type would also allow users to define their own logic in their custom form types + probably define it ourselves in all our form types in order to get rid of the default common behavior.
Commits
-------
7bfc27e7cf [Form] Add "is empty callback" to form config
This PR was merged into the 5.1-dev branch.
Discussion
----------
[DI] Enable auto alias compiler pass by default
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? |
| Deprecations? | no
| Tickets | Fix#34194
| License | MIT
| Doc PR |
I'm sending this PR to trigger a discussion as @nicolas-grekas suggested in #34194
I'm using this quite a lot in one of my applications and I don't see any reasons why it shouldn't be enabled by default.
Commits
-------
4fde51745b Enable auto alias compiler pass by default
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.
Discussion
----------
[PhpUnitBridge] fix getting the vendor/ dir for tests
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
341dd5dd1d [PhpUnitBridge] fix getting the vendor/ dir for tests
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Messenger] Made final class really final
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
introduced in #35485 (so no BC break)
Commits
-------
cd8a386284 [Messenger] Made final class really final
This PR was merged into the 4.4 branch.
Discussion
----------
[PHPunit bridge] Provide current file as file path
I failed to apply perfectly this comment:
https://github.com/symfony/symfony/pull/33820#discussion_r338746158
It should fix one failing test in the bridge.
| Q | A
| ------------- | ---
| Branch? |4.4
| Bug fix? | not for the end user
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
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 master.
-->
Commits
-------
d5302cb5d2 Provide current file as file path
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Serializer] Add support for stdClass
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#33047, #33894
| License | MIT
| Doc PR | n/a
Add support for `stdClass`. Alternative to #33894.
Commits
-------
d7bca80007 [Serializer] Add support for stdClass
* 5.0:
[Mailer] fix typos
[Messenger] fix typo
[DI] Unknown env prefix not regornized as such
[DI] Fix support for multiple tags for locators and iterators
[PhpUnitBridge] Fix some errors when using serialized deprecations
Fix HTTP client config handling
* 4.4:
[Mailer] fix typos
[Messenger] fix typo
[DI] Unknown env prefix not regornized as such
[DI] Fix support for multiple tags for locators and iterators
[PhpUnitBridge] Fix some errors when using serialized deprecations
Fix HTTP client config handling
This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead.
Discussion
----------
[DI] Unknown env prefix not recognized as such
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This is a failing test to illustrate the difference between real and fake env vars when using an unknown prefix, followed by the `default` prefix.
```
%env(unknown:default::REAL)%
// Unsupported env var prefix "unknown".
%env(unknown:default::FAKE)%
// null
```
For `default::FAKE` we get `null` at
38b9a27976/src/Symfony/Component/DependencyInjection/EnvVarProcessor.php (L103)
which is then preserved at
38b9a27976/src/Symfony/Component/DependencyInjection/EnvVarProcessor.php (L123)
need inspiration for a patch still :)
Commits
-------
550819a655 [DI] Unknown env prefix not regornized as such
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] Fix support for multiple tags for locators and iterators
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#34462, Fix#35326
| License | MIT
| Doc PR | none
Fix PriorityTaggedServiceTrait::findAndSortTaggedServices to work with multiple explicitely tagged services as would be expected by !tagged_locator. Also reorganize PriorityTaggedServiceTrait::findAndSortTaggedServices to be simpler and easier to understand.
Commits
-------
6fc91eb192 [DI] Fix support for multiple tags for locators and iterators
This PR was submitted for the 4.4 branch but it was squashed and merged into the 5.1-dev branch instead (closes#34278).
Discussion
----------
Update bootstrap_4_layout.html.twig
Add lang attribute to enable translating the "Browse" after text using SCSS variables.
Example:
```
$custom-file-text: (
en: "Browse",
de: "Auswählen"
);
```
https://github.com/twbs/bootstrap/blob/v4.3.1/scss/_variables.scss#L640
| Q | A
| ------------- | ---
| Branch? | 4.4 for features
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix #
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
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
-------
b1b724f716 Update bootstrap_4_layout.html.twig
This PR was submitted for the 4.3 branch but it was squashed and merged into the 4.4 branch instead.
Discussion
----------
[PhpUnitBridge] Fix some errors when using serialized deprecations
| 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 PR attempts to fix conflicts that arose in #31478
Creating as a draft for now as I think having separate test methods no longer make sense (`isSelf()` and `isIndirect()` have been replaced with `getType()`). @l-vo please review and confirm I did not loose anything valuable from your original contribution.
Commits
-------
056d59824f [PhpUnitBridge] Fix some errors when using serialized deprecations