This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] Remove support for legacy and risky HTTP headers
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
e447e8b921 [HttpFoundation] Remove support for legacy and risky HTTP headers
* 4.1:
[HttpKernel] Fixed invalid REMOTE_ADDR in inline subrequest when configuring trusted proxy with subnet
[FrameworkBundle] fixed guard event names for transitions
[DI] Improve class named servics error message
remove unnecessary instanceof in MongoDbSessionHandler
[HttpFoundation] fixed using _method parameter with invalid type
Renaming internal test class to help auto-completion
[Intl] Replace svn with git in the icu data update script
[Messenger] Fix error message on undefined message class for non-subscriber handler
[HttpFoundation] Fix Cookie::isCleared
* 4.0:
[HttpKernel] Fixed invalid REMOTE_ADDR in inline subrequest when configuring trusted proxy with subnet
[FrameworkBundle] fixed guard event names for transitions
[DI] Improve class named servics error message
[HttpFoundation] fixed using _method parameter with invalid type
[Intl] Replace svn with git in the icu data update script
[HttpFoundation] Fix Cookie::isCleared
* 3.4:
[HttpKernel] Fixed invalid REMOTE_ADDR in inline subrequest when configuring trusted proxy with subnet
[FrameworkBundle] fixed guard event names for transitions
[DI] Improve class named servics error message
[HttpFoundation] fixed using _method parameter with invalid type
[Intl] Replace svn with git in the icu data update script
[HttpFoundation] Fix Cookie::isCleared
* 2.8:
[HttpKernel] Fixed invalid REMOTE_ADDR in inline subrequest when configuring trusted proxy with subnet
[HttpFoundation] fixed using _method parameter with invalid type
[Intl] Replace svn with git in the icu data update script
[HttpFoundation] Fix Cookie::isCleared
This PR was squashed before being merged into the 3.4 branch (closes#28057).
Discussion
----------
[DI] Improve class named servics error message
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #28006
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
61de0601a1 [DI] Improve class named servics error message
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] Fix Cookie::isCleared
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27946
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
Commits
-------
d3d7766874 [HttpFoundation] Fix Cookie::isCleared
This PR was merged into the 2.8 branch.
Discussion
----------
[Intl] Replace svn with git in the icu data update script
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Quoting http://site.icu-project.org/repository:
> Announcement 07/16/2018: The ICU source code repository has been migrated from Subversion to Git, and is now hosted on GitHub at the following location: https://github.com/unicode-org/icu.
The icu update script will from now on:
* use git
* fetch the latest release tag (no need to maintain the list anymore)
I rebuilt the data files, but since no new ICU releases has been made, none of files were actually updated.
Commits
-------
ebdf972e49 [Intl] Replace svn with git in the icu data update script
This PR was merged into the 4.1 branch.
Discussion
----------
[Messenger] Fix error message on undefined message class for non-subscriber handler
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Fixes a wrong hint talking about `getHandledMessages()` while the handler does not implement `MessageSubscriberInterface`.
Commits
-------
e5ea3bc032 [Messenger] Fix error message on undefined message class for non-subscriber handler
This PR was merged into the 3.4 branch.
Discussion
----------
Use an empty string as default for assertEquals
Make sure it isn’t interpreted as a type NULL, making the test fail with PHPUnit 7.2.
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This shouldn’t break the existing tests, but will also make them work with recent PHPUnit.
Commits
-------
31353147a3 Use an empty string as default for assertEquals
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] Add missing Ukrainian translations
| Q | A
| ------------- | ---
| Branch? | 2.8 <!-- see below -->
| 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 -->
| License | MIT
Add missing Ukrainian translations.
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
Commits
-------
b7d55ede15 Add missing Ukrainian translations
* 4.1:
Fix Clidumper tests
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
Apply fixers
Disable the native_constant_invocation fixer until it can be scoped
Update the list of excluded files for the CS fixer
* 4.0:
Fix Clidumper tests
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
Apply fixers
Disable the native_constant_invocation fixer until it can be scoped
Update the list of excluded files for the CS fixer
* 3.4:
Fix Clidumper tests
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
Apply fixers
Disable the native_constant_invocation fixer until it can be scoped
Update the list of excluded files for the CS fixer
* 2.8:
Fix Clidumper tests
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
Apply fixers
Disable the native_constant_invocation fixer until it can be scoped
Update the list of excluded files for the CS fixer
* 4.1:
fix merge
bumped Symfony version to 4.1.3
[PhpUnitBridge] Describe weak_vendors properly
[HttpKernel] Fix merging bindings for controllers' locators
updated VERSION for 4.1.2
updated CHANGELOG for 4.1.2
bumped Symfony version to 4.0.14
updated VERSION for 4.0.13
updated CHANGELOG for 4.0.13
bumped Symfony version to 3.4.14
updated VERSION for 3.4.13
updated CHANGELOG for 3.4.13
bumped Symfony version to 2.8.44
Chaining senders with their aliases should work
* 4.0:
[HttpKernel] Fix merging bindings for controllers' locators
bumped Symfony version to 4.0.14
updated VERSION for 4.0.13
updated CHANGELOG for 4.0.13
bumped Symfony version to 3.4.14
updated VERSION for 3.4.13
updated CHANGELOG for 3.4.13
bumped Symfony version to 2.8.44
* 3.4:
[HttpKernel] Fix merging bindings for controllers' locators
bumped Symfony version to 3.4.14
updated VERSION for 3.4.13
updated CHANGELOG for 3.4.13
bumped Symfony version to 2.8.44
This PR was squashed before being merged into the 4.1 branch (closes#28046).
Discussion
----------
[PhpUnitBridge] Describe weak_vendors properly
| 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
The `weak_vendors` mode now displays deprecations, this behavior has changed since https://github.com/symfony/symfony/pull/25997
Commits
-------
336008c5d3 [PhpUnitBridge] Describe weak_vendors properly
This PR was merged into the 4.1 branch.
Discussion
----------
[Messenger] Fix chaining senders with their aliases
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27908
| License | MIT
| Doc PR | ø
Turns out chaining senders when using their alias as the name is broken. This PR fixes it :)
Commits
-------
98bb64c32a Chaining senders with their aliases should work
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] fix truncating form views in data collector
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no (fixing a non released patch)
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Fixes#27923.
Commits
-------
5fa1f12f3c [Form] fix truncating form views in data collector
* 4.1:
updated VERSION for 2.8.43
update CONTRIBUTORS for 2.8.43
updated CHANGELOG for 2.8.43
backported translations
Fixed templateExists on parse error of the template name
* 4.0:
updated VERSION for 2.8.43
update CONTRIBUTORS for 2.8.43
updated CHANGELOG for 2.8.43
backported translations
Fixed templateExists on parse error of the template name
* 3.4:
updated VERSION for 2.8.43
update CONTRIBUTORS for 2.8.43
updated CHANGELOG for 2.8.43
backported translations
Fixed templateExists on parse error of the template name
* 2.8:
updated VERSION for 2.8.43
update CONTRIBUTORS for 2.8.43
updated CHANGELOG for 2.8.43
backported translations
Fixed templateExists on parse error of the template name
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpKernel] Fixed templateExists on parse error of the template name
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28001
| License | MIT
| Doc PR | -
9bfa971bc5/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php (L49-L51)
Commits
-------
53347c42fd Fixed templateExists on parse error of the template name
* 4.1:
fixed UUID error message id in translation files
Add missing typehint on chain sender
Add several missing translations of the UUID validation message.
Serbo-Croatian has Serbian plural rule
[Validator] Add missing UUID validator message translation (hu)
[Validator] Add missing UUID validator message translation (en)
add missing translation for uuid validator
Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler
Fix PHPDoc return type
[MonologBridge] Improve FirePHPHandler
Fix SVGs not scaling in IE9, IE10, and IE11
Supports nested "abstract" object while serializing and de-serializing
* 4.0:
fixed UUID error message id in translation files
Add several missing translations of the UUID validation message.
Serbo-Croatian has Serbian plural rule
[Validator] Add missing UUID validator message translation (hu)
[Validator] Add missing UUID validator message translation (en)
add missing translation for uuid validator
Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler
Fix PHPDoc return type
[MonologBridge] Improve FirePHPHandler
Fix SVGs not scaling in IE9, IE10, and IE11
* 3.4:
fixed UUID error message id in translation files
Add several missing translations of the UUID validation message.
Serbo-Croatian has Serbian plural rule
[Validator] Add missing UUID validator message translation (hu)
[Validator] Add missing UUID validator message translation (en)
add missing translation for uuid validator
Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler
Fix PHPDoc return type
[MonologBridge] Improve FirePHPHandler
Fix SVGs not scaling in IE9, IE10, and IE11
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] Add several missing translations of the UUID validation message.
| Q | A
| ------------- | ---
| Branch? | 2.8
| 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 | (Comments in #27992) <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | —
All the remaining translations from #27992
Commits
-------
ee780f3c66 Add several missing translations of the UUID validation message.
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] Add missing UUID validator message translation (hu)
| Q | A
| ------------- | ---
| Branch? |2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License | MIT
| Doc PR | -
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
Commits
-------
0b2134415c [Validator] Add missing UUID validator message translation (hu)
This PR was squashed before being merged into the 3.4 branch (closes#26193).
Discussion
----------
Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25518
| License | MIT
Symfony 3.4 emits deprecation warnings for `TranslationLoader` and `WriteCheckSessionHandler` as soon as these classes are loaded, yet at the same time these classes are part of the default services defined in Symfony 3.4, so if these classes are loaded during container compilation a deprecation warning is emitted, even if these classes are never actually used.
An example would be the following within a compiler pass:
foreach ($containerBuilder->getDefinitions() as $definition) {
if (is_subclass_of($definition->getClass(), SomeClass::class)) {
$definition->addMethodCall('setSomething', [new Reference('someservice')]);
}
}
This will load both `TranslationLoader` and `WriteCheckSessionHandler` in order to check their definition. No instance of the classes are ever used and the classes are not loaded after compilation ever, yet the deprecation notices are shown on every single page. More details are provided in issue #25518 .
By moving the deprecation notices to the class constructors false-positives are avoided while actual usage of the classes should still generate the deprecation warnings.
Commits
-------
1a427b181d Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler
This PR was squashed before being merged into the 4.2-dev branch (closes#27943).
Discussion
----------
[Security] Deprecate returning stringish objects from Security::getUser
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes-ish
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
`$user` can also be an object implementing `__ toString`. Here we want only true user objects...
Commits
-------
8c410da7e7 [Security] Deprecate returning stringish objects from Security::getUser
This PR was squashed before being merged into the 4.2-dev branch (closes#27956).
Discussion
----------
Added types and tweaked PHPdoc of clickLink() and submitForm() methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| 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 | - <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | -
I wanted to suggest these changes to #27807 but I failed to do that before it was merged.
Commits
-------
be9d578d4b Added types and tweaked PHPdoc of clickLink() and submitForm() methods
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Security] Remember me: allow to set the samesite cookie flag
| 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? | no
| Fixed tickets | no
| License | MIT
| Doc PR | symfony/symfony-docs#10077
This PR allows to set the [`samesite`](https://www.owasp.org/index.php/SameSite) cookie flag for remember me token cookies.
Commits
-------
337e8ef044 [Security] Remember me: allow to set the samesite cookie flag
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] fix compatibility with older Cache versions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
FrameworkBundle 4.2 will be compatible with older versions of the Cache
component. In those versions adapters don't implement `ResetInterface`.
For backwards compatibility they still need to be tagged.
Commits
-------
ec795cca78 fix compatibility with older Cache versions
* 4.1:
fixed typo
[FrameworkBundle] fixed brackets position in method calls
Add placeholder support in bootstrap 4 file fields
[Form] Improve rendering of `file` field in bootstrap 4
[Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
[Security] Update user phpdoc on tokens
[WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
[HttpFoundation] Fixed phpdoc for get method of HeaderBag
fix typo in ContainerBuilder docblock
[Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
[Console] correctly return parameter's default value on "--"
[DependencyInjection] add missing test for #27710
[EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset
Fix serialization of abstract items with groups across multiple entities
* 4.0:
fixed typo
[FrameworkBundle] fixed brackets position in method calls
[Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
[Security] Update user phpdoc on tokens
[WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
[HttpFoundation] Fixed phpdoc for get method of HeaderBag
fix typo in ContainerBuilder docblock
[Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
[Console] correctly return parameter's default value on "--"
* 3.4:
[FrameworkBundle] fixed brackets position in method calls
[Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
[Security] Update user phpdoc on tokens
[WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
[HttpFoundation] Fixed phpdoc for get method of HeaderBag
fix typo in ContainerBuilder docblock
[Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
[Console] correctly return parameter's default value on "--"
* 2.8:
[Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
[Security] Update user phpdoc on tokens
[WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
[HttpFoundation] Fixed phpdoc for get method of HeaderBag
fix typo in ContainerBuilder docblock
FrameworkBundle 4.2 will be compatible with older versions of the Cache
component. In those versions adapters don't implement `ResetInterface`.
For backwards compatibility they still need to be tagged.
This PR was squashed before being merged into the 4.2-dev branch (closes#27829).
Discussion
----------
[DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? |no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
As explained by @stof in https://github.com/symfony/symfony/pull/27735#discussion_r199797412, injecting the `ClassMetadataFactory` directly can lead to issues when resetting the EntityManager.
This PR deprecates this usage and encourages to inject the entity manager directly.
Commits
-------
3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor
This PR was merged into the 4.2-dev branch.
Discussion
----------
Add symfony/contracts: a set of abstractions extracted out of the Symfony components
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | -
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
A set of abstractions extracted out of the Symfony components.
This is a topic I've been thinking about for a long time. I feel like the time has come for Symfony to publish some abstractions so that people could build on them in a decoupled way.
I've identified interfaces in some components that would greatly benefit from being moved out from the components where they are for now. E.g. #26929 is something that has a broader scope than the Cache component itself.
By putting them in a new `symfony/abstractions` package, we would allow more innovation in the Symfony community, at the abstraction level.
In order to start small, I propose only one interface that gathers a concept that is shared amongst many components already: `ResetInterface`. It would provide a standard `reset()` method, whose purpose is to set an object back to its initial state, allowing it to be reused many times with no side effects/leaks related to its history. By this definition, it could also be autoconfigured (as done here, see update in FrameworkExtension). See wording in the docblock in the attached source code.
Ideally, I'd like this package to provide not only interfaces, by also generic traits, and reference test suites when possible. We could work on adding more abstractions during the 4.2 cycle. WDYT?
## Here is the attached README:
A set of abstractions extracted out of the Symfony components.
Can be used to build on semantics that the Symfony components proved useful - and
that already have battle tested implementations.
Design Principles
-----------------
* contracts are split by domain, each into their own sub-namespaces;
* contracts are small and consistent sets of PHP interfaces, traits, normative
docblocks and reference test suites when applicable, etc.;
* all contracts must have a proven implementation to enter this repository;
* they must be backward compatible with existing Symfony components.
FAQ
---
### How to use this package?
The abstractions in this package are useful to achieve loose coupling and
interoperability. By using the provided interfaces as type hints, you are able
to reuse any implementations that match their contracts. It could be a Symfony
component, or another one provided by the PHP community at large.
Depending on their semantics, some interfaces can be combined with autowiring to
seamlessly inject a service in your classes.
Others might be useful as labeling interfaces, to hint about a specific behavior
that could be enabled when using autoconfiguration or manual service tagging (or
any other means provided by your framework.)
### How is this different from PHP-FIG's PSRs?
When applicable, the provided contracts are built on top of PHP-FIG's PSR. We
encourage relying on them and won't duplicate the effort. Still, the FIG has
different goals and different processes. Here, we don't need to seek universal
standards. Instead, we're providing abstractions that are compatible with the
implementations provided by Symfony. This should actually also contribute
positively to the PHP-FIG (from which Symfony is a member), by hinting the group
at some abstractions the PHP world might like to take inspiration from.
### Why isn't this package split into several packages?
Putting all interfaces in one package eases discoverability and dependency
management. Instead of dealing with a myriad of small packages and the
corresponding matrix of versions, you just need to deal with one package and one
version. Also when using IDE autocompletion or just reading the source code, it
makes it easier to figure out which contracts are provided.
There are two downsides to this approach: you may have unused files in your
`vendor/` directory, and in the future, it will be impossible to use two
different sub-namespaces in different major versions of the package. For the
"unused files" downside, it has no practical consequences: their file sizes are
very small, and there is no performance overhead at all since they are never
loaded. For major versions, this package follows the Symfony BC + deprecation
policies, with an additional restriction to never remove deprecated interfaces.
Resources
---------
* [Documentation](https://symfony.com/doc/current/components/contracts.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
Commits
-------
898203649f Added symfony/contracts: a set of abstractions extracted out of the components
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27924
| License | MIT
| Doc PR | No
Commits
-------
51a49c7f78 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
This PR was squashed before being merged into the 4.2-dev branch (closes#27807).
Discussion
----------
Added new methods submitForm and clickLink to Client class
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Added new methods to BrowserKit/Client to simplify work with links and forms.
Related to https://github.com/symfony/symfony/issues/27627
Commits
-------
e098eddc96 Added new methods submitForm and clickLink to Client class
This PR was merged into the 4.1 branch.
Discussion
----------
[EventDispatcher] Clear orphaned events on reset
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | NA
| License | MIT
| Doc PR | NA
When the Orphaned Events feature was added in #24392 it was forgotten to also clear them when the `reset` method on the `TraceableEventDispatcher` is called. This makes the Orphaned Events tab on the Event profiler an evergrowing list when using PHP-PM (or other event loop implementations).
Commits
-------
d3260dfdcd [EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset
This PR was merged into the 3.4 branch.
Discussion
----------
[Form/Profiler] Massively reducing memory footprint of form profiling pages...
… by removing redundant 'form' variable from view variables.
| 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 |
## Problem
When trying to profile large forms in web profiler, the page can get so big that the memory footprint of the web browser excedes 1Gb making everything unusable and sometimes crashing the browser.
This is especially true for "deep" forms as every node of the form also contains its children in the debugging infos.
## Solution
When removing the "form" view variable that actually contains duplicated contents of everything already displayed in the page, the memory footprint massively decrease making the page usable again even form very complex and deep forms.
By using CutStub, we keep a necessary level of information by providing the information that the variable is indeed here but not directly accessible in the dump.
Commits
-------
5f5077f4fc [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Routing] deprecate non string requirement names
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Basically, this will help catching wrong `@Route` annotation configurations like the following which can lead to hard to debug issues:
```php
@Route("/{foo}", requirements={"foo", "bar"})
```
Commits
-------
8bb5266553 deprecate non string requirement names
As to the PHP documentation date() uses the value of time() as timestamp
if none is given. date() has to be mocked in ClockMock as well for this
still being true, otherwise \time() is used as default.
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Add `MarshallerInterface` allowing to change the serializer, providing a default one that automatically uses igbinary when available
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #19895
| License | MIT
| Doc PR | -
With this PR, when igbinary is available, it is automatically used to serialize values.
This provides faster and smaller cache payloads.
The unserializing logic is autoadaptative:
- when an igbinary-serialized value is unserialized but the extension is missing, a cache miss is triggered
- when a natively-serialized value is unserialized and the extension is available, the native `unserialize()` is used
Ping @palex-fpt since you provided very useful comments on the topic and might be interested in reviewing here also.
Commits
-------
9c328c4894 [Cache] Add `MarshallerInterface` allowing to change the serializer, providing a default one that automatically uses igbinary when available
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
* Allowed configuring PDO-based cache pools via a new `cache.adapter.pdo` abstract service
* added automatic table creation when using Doctrine DBAL with PDO-based backends
Commits
-------
1484117430 [FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] allow turning routes to utf8 mode by default
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This allows building optimized routers that match in a single regexp instead of an alternate of utf8/non-utf8 set of routes.
Commits
-------
8f359cc047 [FrameworkBundle] allow turning routes to utf8 mode by default
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Process][Console] deprecated defining commands as strings
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #27796
| License | MIT
| Doc PR | -
* Added the `Process::fromShellCommandline()` static constructor to define shell command-lines
* Allowed passing commands as `array($process, 'ENV_VAR' => 'value')` to `ProcessHelper::run()`
* Deprecated passing commands as strings when creating a `Process` instance.
* Deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods.
* Deprecated passing a command as a string to `ProcessHelper::run()`, pass it the command as an array of arguments instead.
* Made the `ProcessHelper` class final
Commits
-------
8895bc1b5b [Process][Console] deprecated defining commands as strings
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] Improve exception messages by hiding the hidden ids they contain
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27822
| License | MIT
| Doc PR | -
This PR improves error messages containing hidden ids, especially the ones mentioning service locators.
Right now, when a service subscriber is incomplete, we get:
> The service ".service_locator.G69Xsbl.App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".
With this PR we get this instead:
> The service "routing.loader" in the container provided to "App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".
When no locators are involved, the hidden service is swallowed:
> The service "App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".
This PR also improves runtime exceptions thrown in service locators.
Before:
> Cannot autowire service ".service_locator.Z1jvVrN": it references interface "Symfony\Component\Config\Loader\LoaderInterface" but no such service exists. You should maybe alias this interface to one of these existing services: [...].
After:
> Cannot autowire service "routing.loader" required by "App\Controller\MyRouter": it references interface "Symfony\Component\Config\Loader\LoaderInterface" but no such service exists. You should maybe alias this interface to one of these existing services: [...].
TODO:
- [x] add tests.
Commits
-------
d2b4901a43 [DI] Improve exception messages by hiding the hidden ids they contain
This PR was merged into the 4.1 branch.
Discussion
----------
[Serializer] Fix serialization of items with groups across entities and discrimination map
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27816, #27641
| License | MIT
| Doc PR | ø
I believe this approach is better than the one taken in #27816. At least, it's an alternative :)
Commits
-------
c648b938b2 Fix serialization of abstract items with groups across multiple entities
* 4.1:
[Filesystem] fix lock file permissions
[Lock] fix lock file permissions
[Form] Removed .form-control-label class.
Removed .mb-0 in errors.
Fix the detection of the Process new argument
add @xabbuh as a code owner of the Yaml component
improve deprecation messages
Replace .initialism with .text-uppercase.
* 4.0:
[Filesystem] fix lock file permissions
[Lock] fix lock file permissions
[Form] Removed .form-control-label class.
Removed .mb-0 in errors.
Fix the detection of the Process new argument
add @xabbuh as a code owner of the Yaml component
improve deprecation messages
Replace .initialism with .text-uppercase.
* 3.4:
[Filesystem] fix lock file permissions
[Lock] fix lock file permissions
[Form] Removed .form-control-label class.
Removed .mb-0 in errors.
Fix the detection of the Process new argument
add @xabbuh as a code owner of the Yaml component
Replace .initialism with .text-uppercase.
This PR was squashed before being merged into the 3.4 branch (closes#27903).
Discussion
----------
[Lock] fix lock file permissions
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | see discussion below
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
See [this comment](https://github.com/symfony/symfony/pull/27668#issuecomment-403392924). Since we are using `r+` now to fix an issue on Solaris, we also need to change the file permissions when the lock file is created for the first time. Otherwise
```php
fopen($fileName, 'r+')
```
will fail due to the file permissions and while
```php
fopen($fileName, 'r')
```
will work, the subsequent locking will again fail on Solaris.
Changing the file permissions to `0666` fixes this issue. __However__ any lock file that was generated _prior_ to this change will still cause issues and would need to be manually deleted. Usually the default `sys_get_temp_dir()` location is used for the lock files and _usually_ these files are purged periodically, so it probably won't matter that much. But it still might cause some confusion since it will not be transparent, why the file lock failed on Solaris systems.
Commits
-------
23481a112e [Lock] fix lock file permissions
This PR was squashed before being merged into the 3.4 branch (closes#27886).
Discussion
----------
[Form] Removed .form-control-label class.
| 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 |
There is no such a class neither in [bootstrap 4.0](https://getbootstrap.com/docs/4.0/components/forms/#form-controls) nor in [bootstrap 4.1](https://getbootstrap.com/docs/4.1/components/forms/#form-controls).
Commits
-------
cb3e712698 [Form] Removed .form-control-label class.
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Replace .initialism with .text-uppercase.
| 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 |
I think that the `.initialism` [class](https://getbootstrap.com/docs/4.0/content/typography/#abbreviations) is for different purposes. While the `.text-uppercase` [class](https://getbootstrap.com/docs/4.0/utilities/text/#text-transform) is more neutral and does exactly what we want here.
Commits
-------
3c39dfdaa6 Replace .initialism with .text-uppercase.
This PR was merged into the 3.4 branch.
Discussion
----------
Fix the detection of the Process new argument
| 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 | n/a
This fixes the detection of the new method signature when triggering the deprecation warning. The new `$env` parameter is the second argument, not the first one.
Commits
-------
57e95f3f9a Fix the detection of the Process new argument
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Activation middleware decorator
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| 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 | part of #26901 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | TODO
A small middleware decorator that can be wired using DI decoration to enable/disable a middleware on an arbitrary condition. This can be used to keep the same middleware stack across env but enable/disable some of them through this.
Commits
-------
6e43838c5d [Messenger] Activation middleware decorator
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] don't encode cookie name for BC
| 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 | -
As reported by @Seldaek in https://github.com/symfony/symfony/pull/25348#issuecomment-401696990
Commits
-------
d28949b846 [HttpFoundation] don't encode cookie name for BC
This PR was merged into the 4.2-dev branch.
Discussion
----------
[HttpKernel][FrameworkBundle] Turn HTTP exceptions to HTTP status codes by default
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25844
| License | MIT
| Doc PR | -
When an exception is thrown, *if it is not handled* then it will be reinjected as a 2nd exception event via `HttpKernel::terminateWithException()`. When this happens, this will generate a proper HTTP status code.
Commits
-------
80b0739fc2 [HttpKernel][FrameworkBundle] Turn HTTP exceptions to HTTP status codes by default
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Serializer] Allow to access to the format and context in circular ref handler
| 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 | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | todo
Similar to #27017 but for circular reference handlers.
ping @meyerbaptiste
Commits
-------
99f829ec2b [Serializer] Allow to access to the format and context in circular ref handler
This PR was squashed before being merged into the 3.4 branch (closes#27435).
Discussion
----------
[OptionResolver] resolve arrays
| 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 |
Option resolver didn't work with nested arrays
Before:
$resolver->setDefaults([
'integer' => [
[
12,
23,
],
],
]);
$resolver->setAllowedTypes('integer', 'integer[][]');
Error
The option "host" with value array is expected to be of type "integer[][]", but is of type "integer[][]".
Option expetcted type `integer[][]` but get... `integer[][]`. So strange
Now that case work correct, and we get
array (size=1)
'integer' =>
array (size=1)
0 =>
array (size=2)
0 => int 12
1 => int 23
Commits
-------
6d4812e995 [OptionResolver] resolve arrays
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | -
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Right now, to generate service locators, we use collections of closures described using `ServiceClosureArgument`. This works well, but it doesn't scale well when the number of services grows, because we have to load as many closures as there are services, even if we never call them.
This PR introduces `ServiceLocatorArgument`, which describes the same thing, but allows dumping optimized locators: instead of a collection of closures, this generates a static array that OPcache can put in shared memory (see fixtures for example.)
Once this PR is merged, we'll be able to update `ServiceLocatorPass::register()` to leverage it and generate these optimized locators everywhere. One particular I have in mind in the locator used by `ServiceArgumentResolver`, which can grow fast (it has as many entries as there are actions.)
Commits
-------
6c8e9576a3 [DI] Add ServiceLocatorArgument to generate array-based locators optimized for OPcache shared memory
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Workflow] Fix autofit label in rendering
Set default to autofit label in place/transition to render long labels properly.
| Q | A
| ------------- | ---
| Branch? | master (3.2 to 4.1)
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes, not sure how to add a proper test however
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When using long names for `places` or `transitions`, currently this will not be properly rendered it via the `GraphvizDumper`, see below.
![Default truncated](https://cdn.pbrd.co/images/HsAMVK9.png)
![Default autofit](https://cdn.pbrd.co/images/HsANdKx.png)
By setting the default to `fixedsize=false` it will autofit the label in the rendering.
This will also solve the warning when running the `dump` command:
`Warning: node 'place_08b79deda74a924c3babb9b1d0f3e4eed9320989', graph 'workflow' size too small for label`
Commits
-------
76465fc1f7 [Workflow] Set default to autofit label in place/transition to render long labels properly
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Security] Allow passing null as $filter in LdapUserProvider to get the default filter
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
c6f87c6e3a [Security] Allow passing null as $filter in LdapUserProvider to get the default filter
This PR was squashed before being merged into the 4.2-dev branch (closes#27650).
Discussion
----------
[SecurityBundle] Add json login ldap
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Add a simple from_login_ldap on firewall types to let authenticate with ldap with json API
Commits
-------
2b2dfd2 [SecurityBundle] Add json login ldap
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Console] changed warning verbosity; fixes typo
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes*
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
* Tests pass, but I do not have an installation of MacOS to run tests on. Tests should be unaffected (the test is simply [skipped on MacOS](https://github.com/symfony/console/blob/master/Tests/Command/CommandTest.php#L345)).
When a Console Command fails to change the process title on MacOS, a warning is issued to output. This warning is relevant to developers of Console applications, but to end users is largely meaningless and potentially confusing.
This PR changes the verbosity of the warning to "very verbose" so it does not interrupt normal usage.
I've also fixed a typo in the message ("get" vs. "set").
Commits
-------
86c771a changed warning verbosity; fixes typo
* 4.1:
[DomCrawler] Fix ChoiceFormField::select() PHPDoc
[Security] LdapUserProvider uidKey could be null
[HttpFoundation] add tests for FlashBagInterface::setAll()
Check for Hyper terminal on all operating systems.
[DI] Don't show internal service id on binding errors
Fix a bug when having more than one named handler per message subscriber
Prevent toolbar links color override by css
add conflict for non-compatible TwigBridge version
* 4.0:
[DomCrawler] Fix ChoiceFormField::select() PHPDoc
[Security] LdapUserProvider uidKey could be null
[HttpFoundation] add tests for FlashBagInterface::setAll()
Check for Hyper terminal on all operating systems.
[DI] Don't show internal service id on binding errors
Prevent toolbar links color override by css
* 3.4:
[DomCrawler] Fix ChoiceFormField::select() PHPDoc
[HttpFoundation] add tests for FlashBagInterface::setAll()
Check for Hyper terminal on all operating systems.
[DI] Don't show internal service id on binding errors
Prevent toolbar links color override by css
* 2.8:
[DomCrawler] Fix ChoiceFormField::select() PHPDoc
[HttpFoundation] add tests for FlashBagInterface::setAll()
Check for Hyper terminal on all operating systems.
Prevent toolbar links color override by css
This PR was merged into the 2.8 branch.
Discussion
----------
[DomCrawler] Fix ChoiceFormField::select() PHPDoc
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| 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 | n/a
| License | MIT
| Doc PR | n/a
It's allowed by `setValue`, it works, and it makes sense for `<select multiple>` fields.
Commits
-------
154ce9c170 [DomCrawler] Fix ChoiceFormField::select() PHPDoc
This PR was merged into the 2.8 branch.
Discussion
----------
[WebProfilerBundle] Prevent toolbar links color override by css
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27658
| License | MIT
| Doc PR |
Fixes this issue: https://github.com/symfony/symfony/issues/27658#issuecomment-401008659
Links color in toolbar can be easily override by application css. As this could happens sometimes, this PR set links color with a stronger CSS precedence.
Commits
-------
e12e217f2b Prevent toolbar links color override by css
This PR was merged into the 4.1 branch.
Discussion
----------
[Messenger] Fix a bug when having more than one named handler per message subscriber
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ø
| License | MIT
| Doc PR | ø
It turns out that when using multiple named handler on the same subscriber class, it wasn't working properly at all. It fixes it and obviously add a test for it :)
Commits
-------
47d715e97b Fix a bug when having more than one named handler per message subscriber
This PR was merged into the 4.1 branch.
Discussion
----------
[FrameworkBundle] add conflict for non-compatible TwigBridge version
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27713
| License | MIT
| Doc PR |
The argument was dropped in #27454.
Commits
-------
251e684fe6 add conflict for non-compatible TwigBridge version
This PR was squashed before being merged into the 2.8 branch (closes#27836).
Discussion
----------
[HttpFoundation] add tests for FlashBagInterface::setAll()
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
Adding documentation for the `FlashBagInterface::setAll()` function
Commits
-------
af96475e2a [HttpFoundation] add tests for FlashBagInterface::setAll()
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Security] Use AuthenticationTrustResolver in SimplePreAuthenticationListener
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes (minor)
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Minor, but would be consistent with how `ContextListener` checks for anonymous tokens.
Commits
-------
27b89cb [Security] Use AuthenticationTrustResolver in SimplePreAuthenticationListener
This PR was squashed before being merged into the 4.2-dev branch (closes#27830).
Discussion
----------
[Dependency-Injection] Fix issue where non-defined services were attempted to be removed
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| 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 | #27802 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
The RemoveUnusedServicesPass generates a graph of services that are connected, then removes services that are not part of the graph. To build this graph it creates a list of services then examines their definitions for more services.
The current scenario was causing an error, thrown by getDefinition (triggered in Behat):
* Service was referenced by another service definition
* Service was _not_ defined
* Service was subsequently set() on the container
Commits
-------
53155c9800 [Dependency-Injection] Fix issue where non-defined services were attempted to be removed
* 4.1:
Add color support for Hyper terminal .
[HttpFoundation] Fix tests: new message for status 425
[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
[Workflow] Update phpdoc to fit a used className
[PropertyInfo] added handling of nullable types in PhpDoc
[HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
[Cache] provider does not respect option maxIdLength with versioning enabled
[Form] Fix fixtures for forward compat
[Lock] Fix SemaphoreStoreTest on OS X
Ensure the class discriminator mechanism works with serialization groups as well
fix handling of empty DI extension configs
* 4.0:
Add color support for Hyper terminal .
[HttpFoundation] Fix tests: new message for status 425
[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
[PropertyInfo] added handling of nullable types in PhpDoc
[HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
[Cache] provider does not respect option maxIdLength with versioning enabled
* 3.4:
Add color support for Hyper terminal .
[HttpFoundation] Fix tests: new message for status 425
[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
[PropertyInfo] added handling of nullable types in PhpDoc
[HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
[Cache] provider does not respect option maxIdLength with versioning enabled
* 2.8:
Add color support for Hyper terminal .
[HttpFoundation] Fix tests: new message for status 425
[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
This PR was merged into the 2.8 branch.
Discussion
----------
[Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27811
| License | MIT
This change prevents error when invalid subscriber is being used.
Expected result:
```
The Doctrine connection "root" referenced in service "stof_doctrine_extensions.listener.sluggable" does not exist. Available connections names: default
```
Actual error:
```
Notice: Array to string conversion
```
Commits
-------
cf1bc66464 [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
This PR was merged into the 4.2-dev branch.
Discussion
----------
[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/9996
Using this, enabling e.g. TokenProcessor or WebProcessor just needs one line in `services.yaml`:
```yaml
services:
Symfony\Bridge\Monolog\Processor\TokenProcessor: ~
Symfony\Bridge\Monolog\Processor\WebProcessor: ~
```
Commits
-------
28a4912f21 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors
This PR was merged into the 3.4 branch.
Discussion
----------
[PropertyInfo] added handling of nullable types in PhpDoc
While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. `?string`), and returns those in a `Nullable` wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found").
Correctly parse this syntax into a nullable type.
| 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 | n/a
Commits
-------
38b369be3f [PropertyInfo] added handling of nullable types in PhpDoc
While not specified in PSR-5, PhpDocumentor does support parsing
nullable types in the PHP 7.1 syntax (i.e. ?string), and returns those
in a Nullable wrapper. We currently don't handle this and neither throw
an error, which results in all kind of weird breakage when this syntax
is used (e.g. "class string|int not found").
Correctly parse this syntax into a nullable type.
This PR was merged into the 4.2-dev branch.
Discussion
----------
[VarDumper] make control characters non-selectable in HTML
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | maybe
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23921
| License | MIT
| Doc PR | -
### Overview
This fixes long term annoyance with control characters in dumps. It makes dumps unusable to use with e.g. SQLs, since copying them will leave `\n` (and others).
### Changes
This PR does three things:
1. Adds special class of characters abbreviated as `ctrl` (cosmetic, already exists in fact but it's not exposed in HTML)
2. Makes control characters non-selectable
3. Changes color of control character from default orange to grey (used by Symfony.com dark theme) which improves UX by showing *"hey, this is something special"*
### Preview
**Inline dump**
<img width="243" alt="screenshot 2018-05-19 17 26 18" src="https://user-images.githubusercontent.com/1227834/40273711-7d963450-5b8b-11e8-843a-dda1e2719b59.png">
**Web Profiler**
<img width="418" alt="screenshot 2018-05-19 17 38 36" src="https://user-images.githubusercontent.com/1227834/40273714-86b9cfec-5b8b-11e8-898b-b7cb5f150a72.png">
<img width="533" alt="screenshot 2018-05-19 17 20 42" src="https://user-images.githubusercontent.com/1227834/40273720-a2370852-5b8b-11e8-88c7-aed9281cc056.png">
**Dump Server**
<img width="194" alt="screenshot 2018-05-19 17 30 12" src="https://user-images.githubusercontent.com/1227834/40273722-aa444686-5b8b-11e8-9ae9-ea2eebb3368d.png">
Commits
-------
b0d4c99bf4 [VarDumper] make control characters non-selectable in HTML
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Serializer] Allow to pass a single value for the groups opt
| 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 | n/a
| License | MIT
| Doc PR | todo
Shortcut syntax similar to #20509 but for the context: allows to pass a string instead of an array of string in the serialization context when only one group if used.
Before:
```php
$serializer->serialize($foo, 'json', ['groups' => ['myGroup']];
/** @ApiResource(normalizationContext={"groups"={"myGroup"}}) */
```
After:
```php
$serializer->serialize($foo, 'json', ['groups' => 'myGroup'];
/** @ApiResource(normalizationContext={"groups"="myGroup") */
```
Commits
-------
5b392030f9 [Serializer] Allow to pass a single value for the groups opt
This PR was squashed before being merged into the 3.4 branch (closes#27659).
Discussion
----------
[HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
| 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 |
#26157 started to send a new cookie in `AbstractTestSessionListener`, but is incompatible with `CookieClearingLogoutHandler` as it overrides its `Set-Cookie` by setting a new cookie (breaking my test that checked to see that the cookie was removed after a log out).
Commits
-------
f54d96926a [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
This PR was squashed before being merged into the 3.4 branch (closes#27752).
Discussion
----------
[Cache] provider does not respect option maxIdLength with versioning enabled
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27746
| License | MIT
| Doc PR |
Component symfony/cache generates cache item ID longer then maxIdLength when versioning is enabled
Commits
-------
ba8b63b195 [Cache] provider does not respect option maxIdLength with versioning enabled
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Serializer] Deprecate CsvEncoder as_collection false default value
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- 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 | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
As already expressed in https://github.com/symfony/symfony/pull/25369 and related issues, this behavior is quite counter-intuitive. It may be fine for write-API with a single document in the body but I think such CSV APIs are way less common than file-based ones, expecting collections. So I think this behavior should be opt-in explicitly in required cases, always dealing with collections by default.
This is still an arbitrary decision, but trying to make it based on use-cases and user's experience with CSV.
Note: perhaps we could find a better name for this as the semantic of setting `as_collection` to `false` to get the single row directly would not be really obvious.
Also, it could throw an exception when getting multiple rows where only one was expected.
Commits
-------
bce59c8427 [Serializer] Deprecate CsvEncoder as_collection false default value
This PR was merged into the 4.1 branch.
Discussion
----------
[Serializer] Class discriminator and serialization groups
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27641
| License | MIT
| Doc PR | ø
It turns out the discriminator mapping does not work well with the serialization groups. This is fixing it (+ a little bit of cleaning in the tests).
Commits
-------
c91b7afe35 Ensure the class discriminator mechanism works with serialization groups as well
This PR was merged into the 4.2-dev branch.
Discussion
----------
[VarDumper] show proxified class on hover
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
![capture d ecran de 2018-06-29 08-18-59](https://user-images.githubusercontent.com/243674/42076362-2ab0dd1c-7b75-11e8-9243-5e2f78afe870.png)
Commits
-------
955494c37d [VarDumper] show proxified class on hover
This PR was merged into the 3.4 branch.
Discussion
----------
[Lock] Fix SemaphoreStoreTest on OS X
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | no
| 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 | https://github.com/symfony/symfony/pull/27755#pullrequestreview-132772372 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
As spotted in https://github.com/symfony/symfony/pull/27755#pullrequestreview-132772372, for OS X.
If other OS X users could give it a try (`/phpunit src/Symfony/Component/Lock/ --filter=SemaphoreStoreTest`), that would be awesome.
Commits
-------
9055611dc3 [Lock] Fix SemaphoreStoreTest on OS X
* 4.1:
[HttpFoundation] update phpdoc of FlashBagInterface::add()
[ProxyManagerBridge] Fix support of private services (bis)
bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
[Form] relax fixtures for forward compat
[Validator] Fix the namespace of RegexTest
[Lock] fix locale dependent test case
* 4.0:
[HttpFoundation] update phpdoc of FlashBagInterface::add()
[ProxyManagerBridge] Fix support of private services (bis)
bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
[Form] relax fixtures for forward compat
[Validator] Fix the namespace of RegexTest
[Lock] fix locale dependent test case
* 3.4:
[HttpFoundation] update phpdoc of FlashBagInterface::add()
[ProxyManagerBridge] Fix support of private services (bis)
bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
[Form] relax fixtures for forward compat
[Validator] Fix the namespace of RegexTest
[Lock] fix locale dependent test case
* 2.8:
[HttpFoundation] update phpdoc of FlashBagInterface::add()
bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
[Validator] Fix the namespace of RegexTest
This PR was merged into the 3.4 branch.
Discussion
----------
[Lock] fix locale dependent test case
| 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 | -
Right now, I get a failure with `Exception: Failed to extract list of opend semaphores. Expect a Semaphore status, got ------ États des sémaphores --------` :)
Commits
-------
e665da0c9a [Lock] fix locale dependent test case
This PR was squashed before being merged into the 2.8 branch (closes#27765).
Discussion
----------
[HttpFoundation] update phpdoc of FlashBagInterface::add()
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
**Reason why I propose to change the docblock like this: **
The `FlashBagInterface::add()` function does not work only with the `string` type in second parameter
Commits
-------
9135e18ded [HttpFoundation] update phpdoc of FlashBagInterface::add()
This PR was merged into the 3.4 branch.
Discussion
----------
[SecurityBundle] Dont throw if "security.http_utils" is not found
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27445
| License | MIT
| Doc PR | -
The comment + test were misleading, the actual important thing is wiring `AddSessionDomainConstraintPass` before removing passes, which is already the case already.
Commits
-------
db88330448 [SecurityBundle] Dont throw if "security.http_utils" is not found
This PR was squashed before being merged into the 4.2-dev branch (closes#27675).
Discussion
----------
[DoctrineBridge] always load event listeners lazy via ServiceLocator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes/no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/27661
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/9973
As described in https://github.com/symfony/symfony/issues/27661 this PR suggests to always load doctrine event listeners lazily from a service locator instead of the full service container.
If we agree to move forward I could tackle the remaining todos:
- [x] update UPGRADE.md
- [x] documentation PR
- [x] tested on real app
Commits
-------
130ec0525d [DoctrineBridge] always load event listeners lazy via ServiceLocator
* 4.1:
[Routing] Disallow object usage inside Route
[HttpFoundation] missing namespace for RedisProxy
[Routing] fix too much greediness in host-matching regex
[HttpFoundation] fix registration of session proxies
failing test to reproduce session problem
[HttpFoundation] fix session tracking counter
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] fix session tracking counter
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
As just discussed with @nicolas-grekas I found this issue today while upgrading my app to 3.4.12. Somehow its not possible anymore to set caching headers correctly since this commit: 146e01cb44 (diff-5350dc763df30ada9d00563c115f6652)
Commits
-------
89ed756462 failing test to reproduce session problem
26fc4e683f [HttpFoundation] fix session tracking counter
This PR was merged into the 4.1 branch.
Discussion
----------
[Routing] fix too much greediness in host-matching regex
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27721
| License | MIT
| Doc PR | -
Commits
-------
e16b3023c0 [Routing] fix too much greediness in host-matching regex
* 4.1:
Bump ext-mongodb to 1.5 on Travis
Redesign the Debug error page in prod
[DI] fix dumping deprecated service in yaml
[Serializer] CsvEncoder::AS_COLLECTION_KEY constant
bumped Symfony version to 4.1.2
updated VERSION for 4.1.1
updated CHANGELOG for 4.1.1
bumped Symfony version to 4.0.13
updated VERSION for 4.0.12
updated CHANGELOG for 4.0.12
bumped Symfony version to 3.4.13
updated VERSION for 3.4.12
updated CHANGELOG for 3.4.12
bumped Symfony version to 2.8.43
updated VERSION for 2.8.42
update CONTRIBUTORS for 2.8.42
updated CHANGELOG for 2.8.42
* 4.0:
Bump ext-mongodb to 1.5 on Travis
Redesign the Debug error page in prod
[DI] fix dumping deprecated service in yaml
bumped Symfony version to 4.0.13
updated VERSION for 4.0.12
updated CHANGELOG for 4.0.12
bumped Symfony version to 3.4.13
updated VERSION for 3.4.12
updated CHANGELOG for 3.4.12
bumped Symfony version to 2.8.43
updated VERSION for 2.8.42
update CONTRIBUTORS for 2.8.42
updated CHANGELOG for 2.8.42
* 3.4:
Bump ext-mongodb to 1.5 on Travis
Redesign the Debug error page in prod
[DI] fix dumping deprecated service in yaml
bumped Symfony version to 3.4.13
updated VERSION for 3.4.12
updated CHANGELOG for 3.4.12
bumped Symfony version to 2.8.43
updated VERSION for 2.8.42
update CONTRIBUTORS for 2.8.42
updated CHANGELOG for 2.8.42
This PR was squashed before being merged into the 4.2-dev branch (closes#27499).
Discussion
----------
Improved an error message related to controllers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This proposal is irrelevant for experienced users but it may be useful for newcomers. After having delivered several introductory Symfony training, I can say that when someone adds `return "some string...";` in their controller, the error message is confusing:
![before](https://user-images.githubusercontent.com/73419/40959468-0faf790a-689d-11e8-9ce1-f6e0caf4b113.png)
Maybe we can reword it a bit? (I'm open for suggestions to improve the error message)
![after](https://user-images.githubusercontent.com/73419/40959505-29747070-689d-11e8-834e-92bf18760469.png)
Commits
-------
7510c3a335 Improved an error message related to controllers
This PR was squashed before being merged into the 4.2-dev branch (closes#26300).
Discussion
----------
[PropertyInfo] Implement "Collection" types in PhpDocExtractor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26299
| License | MIT
| Doc PR | todo
Here's a proposition of implementation of my feature request #26299 :
I added few tests covering the requested feature, and I had to change a few things in the ```Symfony\Component\PropertyInfo\Util\PhpDocTypeHelper``` class (createType no longer gets a string, but a ```phpDocumentor\Reflection\Type``` instance) to be able to detect properly Collections and their subtypes.
Of course a simpler implementation is possible, without changing the PhpDocTypeHelper internal behaviour, by matching the input string against ```/^([^>]+)</``` and extracting the classname alone.
Commits
-------
12bafe46d0 [PropertyInfo] Implement \"Collection\" types in PhpDocExtractor
* 2.8:
[DI] fix dumping deprecated service in yaml
bumped Symfony version to 2.8.43
updated VERSION for 2.8.42
update CONTRIBUTORS for 2.8.42
updated CHANGELOG for 2.8.42
This PR was squashed before being merged into the 4.2-dev branch (closes#26946).
Discussion
----------
[WebProfilerBundle] Display uploaded files in the profiler
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26926
| License | MIT
| Doc PR | -
![profiler_files](https://user-images.githubusercontent.com/73419/38807087-ac1e9bac-417b-11e8-99e0-317b437c986e.png)
Note: I wanted to use the VarDumper to display the table information (as we do in the rest of tables) but I had lots of problems and I just wanted to create a proof of concept for the feature to see if we like it.
Commits
-------
3f6f75bc12 [WebProfilerBundle] Display uploaded files in the profiler
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Config] deprecate tree builders without root nodes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
While reviewing #27472 I wondered if we really need support config trees without a root node. If we did not support it, users wouldn't create pseudo configuration classes when they were actually not needed.
Commits
-------
c2ce15301c deprecate tree builders without root nodes
This PR was merged into the 4.2-dev branch.
Discussion
----------
[PropertyAccess] Add Property Path to Exception Message
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | None
| License | MIT
| Doc PR | None
When an exception is thrown writing a property it is not currently obvious which path is at fault (eg. `Expected argument of type "%s", "%s" given` - but where?). This patch appends the current property path to the exception so it is clear which path caused the error (eg. `Expected argument of type "%s", "%s" given at property path "foo.bar"`)
Commits
-------
473a025643 add property path to exception message when error writing property
* 4.1:
[TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
Add note about changed form processing when using PUT requests
[TwigBundle] bump lowest deps to fix issue with "double-colon" controller service refs
[SecurityBundle] Dont throw if "security.http_utils" is not found
[Di] Fix undefined variable found by Php Inspections (EA Ultimate)
[DI] Cleanup unused service_subscriber.locator tag
[DI] Resolve env placeholder in logs
The debug class loader is always loaded by Debug::enable().
[Intl] Update ICU data to 62.1
* 4.0:
[TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
Add note about changed form processing when using PUT requests
[SecurityBundle] Dont throw if "security.http_utils" is not found
[Di] Fix undefined variable found by Php Inspections (EA Ultimate)
[DI] Cleanup unused service_subscriber.locator tag
[DI] Resolve env placeholder in logs
The debug class loader is always loaded by Debug::enable().
[Intl] Update ICU data to 62.1
* 3.4:
[TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
Add note about changed form processing when using PUT requests
[SecurityBundle] Dont throw if "security.http_utils" is not found
[Di] Fix undefined variable found by Php Inspections (EA Ultimate)
[DI] Cleanup unused service_subscriber.locator tag
[DI] Resolve env placeholder in logs
The debug class loader is always loaded by Debug::enable().
[Intl] Update ICU data to 62.1
* 2.8:
Add note about changed form processing when using PUT requests
The debug class loader is always loaded by Debug::enable().
[Intl] Update ICU data to 62.1
This PR was merged into the 4.2-dev branch.
Discussion
----------
Redesigned the default error page in production
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22964
| License | MIT
| Doc PR | -
This continues the work done in #27071.
Before/After comparison:
![before-after-prod-error-pages](https://user-images.githubusercontent.com/73419/41844084-6e132208-786f-11e8-97c9-53602395e231.png)
Commits
-------
1df8b3e741 Redesigned the default error page in production
This PR was squashed before being merged into the 3.4 branch (closes#27626).
Discussion
----------
[TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
| 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 |
While adding https://github.com/elifesciences/journal/pull/990 I was a bit confused why the `preload()` Twig function didn't work initially. Turns out the WebLink component is disabled by default if using the full stack, but the Twig extension is always enabled.
This only adds the Twig extension if the component is enabled, and shows a friendly error message if it's not.
Commits
-------
cccb66f4c6 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
This PR was squashed before being merged into the 4.2-dev branch (closes#27655).
Discussion
----------
[Translation] Added support for translation files with other filename patterns
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27644
| License | MIT
| Doc PR | -
This implements the #27644 feature request in case we accept it.
My vote is 👍 because the changes required are tiny and the resulting code is even more robust thanks to the new `preg_match()` call.
Commits
-------
0ee912dbd8 [Translation] Added support for translation files with other filename patterns
This PR was squashed before being merged into the 4.2-dev branch (closes#27580).
Discussion
----------
[Form] Add ability to clear form errors
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #14060
| License | MIT
| Doc PR | symfony/symfony-docs#9916
This PR adds the ability to manually clear form errors, thus improving the DX issue reported in #14060.
Unlike my original approach in #14233 and #27571 which break BC, this adds a new `ClearableErrorInterface` which `Form` implements. (`Button` does not implement it because buttons can't have errors.)
Commits
-------
9eb755c07f [Form] Add ability to clear form errors
This PR was merged into the 2.8 branch.
Discussion
----------
[Intl] Update ICU data to 62.1
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| 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 | -
| License | MIT
| Doc PR | -
It's this time of the year again to update ICU data. http://site.icu-project.org/download/62
Not many actual changes this time. Few new scripts added and some metadata for the VEF currency.
Commits
-------
5f2e6c2f12 [Intl] Update ICU data to 62.1
This PR was squashed before being merged into the 4.2-dev branch (closes#27247).
Discussion
----------
[Form] Deprecate `searchAndRenderBlock` returning empty string
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #26531
| License | MIT
| Doc PR | -
I would like to remove this silent behavior, because it's confusing
Commits
-------
02f2f0ed39 [Form] Deprecate `searchAndRenderBlock` returning empty string
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] Cleanup unused service_subscriber.locator tag
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes-ish
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Cleanup internal DI tag `container.service_subscriber.locator` so it's _not_ reported as unused tag, i.e.:
```
Tag "container.service_subscriber.locator" was defined on service(s) "App\Controller\MainController", "translation.warmer", "router.cache_warmer", "twig.cache_warmer", "twig.template_cache_warmer",
but was never used. Did you mean "container.service_subscriber", "container.service_locator"?
```
Commits
-------
8e060fa45d [DI] Cleanup unused service_subscriber.locator tag
This PR was merged into the 4.1 branch.
Discussion
----------
[VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27622
| License | MIT
| Doc PR | -
Right now, the `dump()` function is broken on 4.1 as soon as one sets up a `dump_destination` for the dump server (as done by default by our Flex recipe). #27397 describes the issue and proposes a tentative fix. Yet, I think the issue is deeper and exists at the design level. Writting to the server should not happen in a `DumperInterface`, that's not its semantics. Instead, I propose a `Connection` object that will allow `DumpDataCollector` to have all the info it requires to do everything on its own.
My bad for not spotting this at the review stage.
Commits
-------
1435d677be [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper
* 4.1:
[minor] SCA
[Serializer] Minor tweaks for a67b650f12
allow_extra_attributes does not throw an exception as documented
[Cache] fix visibility of RedisTrait::init()
[Serializer] Updates DocBlock to a mixed param type
* 4.0:
[minor] SCA
[Serializer] Minor tweaks for a67b650f12
allow_extra_attributes does not throw an exception as documented
[Cache] fix visibility of RedisTrait::init()
[Serializer] Updates DocBlock to a mixed param type
* 3.4:
[Serializer] Minor tweaks for a67b650f12
allow_extra_attributes does not throw an exception as documented
[Cache] fix visibility of RedisTrait::init()
[Serializer] Updates DocBlock to a mixed param type
This PR was squashed before being merged into the 4.0 branch (closes#27676).
Discussion
----------
[minor] SCA
| Q | A
| ------------- | ---
| Branch? | 4.0>
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Found some leftovers after introducing parameter types in 4.0.
Commits
-------
afeb89fa06 [minor] SCA
This PR was merged into the 2.8 branch.
Discussion
----------
[Serializer] Updates DocBlock to a mixed param type
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | Yes
| New feature? | No
| BC breaks? | No
| Deprecations? | Non added.
| Tests pass? | Yes , no new tests added.
| Fixed tickets | #27457
| License | MIT
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
The JSON serializers make use of the JsonSerializable interface and return arrays to the NormalizerInterface. This PR updates the DocBlock to reflect that.
Moving towards PHP 7.2 and the use of object type-hints would require changes to the [JsonSerializableNormalizer@L41](92c37b9711/src/Symfony/Component/Serializer/Normalizer/JsonSerializableNormalizer.php (L41)) at a minimum.
Truly not much of a PR I'm afraid!
Commits
-------
dca9ff529a [Serializer] Updates DocBlock to a mixed param type
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Fix locking on Solaris
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
As reported on #27668, the descriptor must be writeable on Solaris to get an exclusive lock.
Commits
-------
43da583267 [Cache] Fix locking on Solaris
* 4.1:
[Lock] use 'r+' for fopen (fixes issue on Solaris)
[HttpKernel] fix test compat with PHP 5.3
fix handling of nested Error instances
fix file lock on SunOS
Ignore keepQueryParams attribute when generating route redirect.
[Cache] more granular handling of exceptions in AbstractTrait::clear()
change `evaluate()` docblock return type from string to mixed
Set serialize_precision explicitly to avoid fancy float rounding
* 4.0:
[Lock] use 'r+' for fopen (fixes issue on Solaris)
[HttpKernel] fix test compat with PHP 5.3
fix handling of nested Error instances
fix file lock on SunOS
[Cache] more granular handling of exceptions in AbstractTrait::clear()
change `evaluate()` docblock return type from string to mixed
Set serialize_precision explicitly to avoid fancy float rounding
* 3.4:
[Lock] use 'r+' for fopen (fixes issue on Solaris)
[HttpKernel] fix test compat with PHP 5.3
fix handling of nested Error instances
fix file lock on SunOS
[Cache] more granular handling of exceptions in AbstractTrait::clear()
change `evaluate()` docblock return type from string to mixed
Set serialize_precision explicitly to avoid fancy float rounding
This PR was squashed before being merged into the 3.4 branch (closes#27668).
Discussion
----------
[Lock] use 'r+' for fopen (fixes issue on Solaris)
| Q | A
| ------------- | ---
| Branch? | 3.4 (also applicable to _LockHandler_ in 2.8 and 3.3)
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes [1]
| Fixed tickets | -
| License | MIT
| Doc PR | -
We discovered a curious case on a specific hosting environment: the `FlockStorage` (or `LockHandler` in previous Symfony versions) could never get a file lock on **existing files**. So if you run a script for the first time and the lock file did not exist yet, the `FlockStorage` could get a lock on that file just fine. However on the second and subsequent runs, `FlockStorage` could _never_ get a file lock anymore. You can follow the discussion [here](https://github.com/contao/core-bundle/issues/1551) (if you speak German).
We have been using this little script to confirm the issue on the hosting environment:
```php
$fileName = __DIR__ . '/file.lock';
if (!$handle = @fopen($fileName, 'r')) {
$handle = fopen($fileName, 'x');
}
if (!$handle) {
echo "Could not open $fileName\n";
exit;
}
if (flock($handle, LOCK_EX | LOCK_NB)) {
echo "Got a lock on $fileName\n";
flock($handle, LOCK_UN | LOCK_NB);
} else {
echo "Could not get a lock on $fileName\n";
}
```
Whenever `file.lock` already existed prior to running the script, a lock could not be made.
After contacting the hosting provider's support on this they confirmed the issue and told us they are using **Solaris** instead of a Linux environment. And this is supposedly why it does not work. Instead you have to use `'r+'` instead of `'r'` for `fopen`.
I was able to confirm that changing from `'r'` to `'r+'` fixes the issue. However I am wondering who's actually at fault here. Is it Solaris? PHP? The compiled PHP version under Solaris? The hosting provider's operating system configuration?
### System information
```
uname -a
SunOS vlek 5.11 11.3 i86pc i386 i86pc Solaris
```
```
phpinfo:
SunOS localhost 5.10 Generic_150401-49 i86pc
```
```
php -v
PHP 7.2.5 (cli) (built: May 4 2018 12:57:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
```
### Footnotes
[1] Previously one failed test on the first run and two failing tests on the second run with the proposed changes:
```
1) Symfony\Component\Lock\Tests\Store\FlockStoreTest::testSaveSanitizeName
Symfony\Component\Lock\Exception\LockStorageException: fopen(C:\Users\[…]\AppData\Local\Temp/sf.-php-echo-hello-word-.Sz2dDSf.lock)
: failed to open stream: Permission denied
```
```
2) Symfony\Component\Lock\Tests\Store\FlockStoreTest::testSaveWithDifferentKeysOnSameResources
Symfony\Component\Lock\Exception\LockStorageException: fopen(C:\Users\[…]\AppData\Local\Temp/sf.Symfony-Component-Lock-Tests-Store-
AbstractStoreTest-testSaveWithDifferentKeysOnSameResources5b2b5f00872538.64807920.2u9bH+a.lock): failed to open stream: Permission denied
```
The latter failed both on the first run and on the second run.
After the [proposed changes](https://github.com/symfony/symfony/pull/27668#discussion_r197054198) from @nicolas-grekas everything works fine 👍
Commits
-------
9c9ae7d9c9 [Lock] use 'r+' for fopen (fixes issue on Solaris)
* 2.8:
[HttpKernel] fix test compat with PHP 5.3
fix file lock on SunOS
change `evaluate()` docblock return type from string to mixed
Set serialize_precision explicitly to avoid fancy float rounding
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
See https://pecl.php.net/package-changelog.php?package=redis
Commits
-------
2ff02cd333 [Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DX] Log potential redirect loops caused by forced HTTPS
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27603
| License | MIT
| Doc PR | n/a
If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.
See https://github.com/symfony/symfony/issues/27603
Commits
-------
53048cec6d Log potential redirect loops caused by forced HTTPS
This PR was squashed before being merged into the 4.2-dev branch (closes#27653).
Discussion
----------
[Translation] Improved the performance of the lint:xliff command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27564
| License | MIT
| Doc PR | -
As suggested by @stof I extracted the schema validation logic from XliffFileLoader to reuse it in the `lint:xliff` command. The validation is now instantaneous, so the command is blazing fast!
Commits
-------
e53bf5839b [Translation] Improved the performance of the lint:xliff command
This PR was merged into the 2.8 branch.
Discussion
----------
Set serialize_precision explicitly to avoid fancy float rounding
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | -
This is fixing some of the test failures I was seeing locally due to increased `serialize_precision` INI setting:
```
2) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testConstructorWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'
/www/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php:46
3) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testStaticCreateWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'
```
The test assertions should not depend on externally configured PHP configuration.
Also default value for this option was changed multiple times: http://php.net/manual/en/ini.core.php#ini.serialize-precision
For compatibility reasons (with PHP <7.x) `-1` can't be used.
https://3v4l.org/HBNsT
HHVM doesn't seem to support this though, how to handle this?
Commits
-------
b5ee7c3ccd Set serialize_precision explicitly to avoid fancy float rounding
This PR was merged into the 4.1 branch.
Discussion
----------
[Messenger] Fixed MessengerPass::guessHandledClasses return type
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | #27633
| License | MIT
| Doc PR | ø
#27633 should have been merged to 4.1.
Commits
-------
d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type
This PR was merged into the 3.4 branch.
Discussion
----------
[Config] Fixing GlobResource when inside phar archive
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes if old broken behavior counts as stable
| Deprecations? | no
| Tests pass? | no tests yet
| Fixed tickets |
| License | MIT
| Doc PR | N/A
When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).
Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.
## Examples:
`src/Kernel.php::configureContainer()`:
```php
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
```
Expected behavior: `config/services.yaml` inside PHAR archive is found and parsed
Actual behavior: the file will not be loaded
`config/services.yaml` (hard-coded in Kernel without using glob pattern)
```yaml
App\:
resource: '../src/*'
exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'
```
Expected behavior: service classes in `src/` will be found and auto-wired
Actual behavior: services are not auto-wired because the class files are not found
Commits
-------
e336ebeecf Fixing GlobResource when inside phar archive
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] fix Memcached tests
| 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 | -
Clearing a memcached pool works only when versioning is enabled. Dunno why this has not be caught before, but it's making tests fail now.
Commits
-------
09ec9e7cce [Cache] fix Memcached tests
* 4.1:
[HttpKernel] fix PHP 5.4 compat
Fix surrogate not using original request
[Finder] Update RealIteratorTestCase
[Routing] remove unneeded dev dep on doctrine/common
[minor] SCA
[Validator] Remove BOM in some xlf files
Ensure updateTimestamp returns a boolean
Fix#27378: Error when rendering a DateIntervalType form with exactly 0 weeks
[HttpKernel] fix session tracking in surrogate master requests
* 4.0:
[HttpKernel] fix PHP 5.4 compat
Fix surrogate not using original request
[Finder] Update RealIteratorTestCase
[Routing] remove unneeded dev dep on doctrine/common
[minor] SCA
[Validator] Remove BOM in some xlf files
Fix#27378: Error when rendering a DateIntervalType form with exactly 0 weeks
[HttpKernel] fix session tracking in surrogate master requests
* 3.4:
[HttpKernel] fix PHP 5.4 compat
Fix surrogate not using original request
[Finder] Update RealIteratorTestCase
[Routing] remove unneeded dev dep on doctrine/common
[minor] SCA
[Validator] Remove BOM in some xlf files
Fix#27378: Error when rendering a DateIntervalType form with exactly 0 weeks
[HttpKernel] fix session tracking in surrogate master requests
* 2.8:
[HttpKernel] fix PHP 5.4 compat
Fix surrogate not using original request
[Finder] Update RealIteratorTestCase
[Routing] remove unneeded dev dep on doctrine/common
[Validator] Remove BOM in some xlf files
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] Fixed tests added in #27611
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| 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 | ~
| License | MIT
| Doc PR | ~
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
Commits
-------
be97006c57 [FrameworkBundle] Fixed tests added in #27611
If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.
See https://github.com/symfony/symfony/issues/27603
When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).
Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27378
| License | MIT
Fixes the issue described in #27378
Commits
-------
dae704ad2fFix#27378: Error when rendering a DateIntervalType form with exactly 0 weeks
This PR was merged into the 4.2-dev branch.
Discussion
----------
CacheWarmerAggregate handle deprecations logs
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27387
| License | MIT
Actually the Web Debug Toolbar warning you about the deprecation messages thrown during the container built (#21502).
Cache warmup can throw deprecated message without any persistance, it may cause issue like #27387
This PR reproduce the same job for the cache warmer, and so on, handle deprecated messages during the warmup of Twig, Translator, Validator, Security and all `kernel.cache_warmer` services.
Here are the point that may be improvable in this PR:
1. Actually I've "duplicate" the callable used in the `set_error_handler` of the Kernel.
IMHO I think that Kernel and CacheWarmerAggregate have differents jobs and a trait may be a good solution to share this error handler setter without duplicating the code, but I'm a little bit lost about the repercussion of adding a Trait in the Kernel.
2. I've think about extending the `CacheWarmerAggregate` into a `DeprecatedLogHandlingCacheWarmerAggregate` to add the debug and containerClass argument, and declare it as the `cache_warmer` service only in debug mode (by declaring it in the DebugBundle/Resources/config/services.xml).
Commits
-------
f03b8bba9d CacheWarmerAggregate handle deprecations logs
This PR was merged into the 4.2-dev branch.
Discussion
----------
[OptionsResolver] Introduce ability to deprecate options, allowed types and values
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27216
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/9859
**Deprecating an option**
```php
$resolver = (new OptionsResolver())
->setDefined(['foo', 'bar'])
->setDeprecated('foo')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated.
```
With custom message:
```php
$resolver = (new OptionsResolver())
->setDefined('foo')
->setDefault('bar', function (Options $options) {
return $options['foo'];
})
->setDeprecated('foo', 'The option "foo" is deprecated, use "bar" option instead.')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated, use "bar" option instead.
$resolver->resolve(['bar' => 'baz']); // OK.
```
**Deprecating allowed types**
```php
$resolver = (new OptionsResolver())
->setDefault('type', null)
->setAllowedTypes('type', ['null', 'string', FormTypeInterface::class])
->setDeprecated('type', function ($value) {
if ($value instanceof FormTypeInterface) {
return sprintf('Passing an instance of "%s" to option "type" is deprecated, pass its FQCN instead.', FormTypeInterface::class);
}
})
;
$resolver->resolve(['type' => new ChoiceType()]); // PHP Deprecated: Passing an instance of "Symfony\Component\Form\FormTypeInterface" to option "type" is deprecated, pass its FQCN instead.
$resolver->resolve(['type' => ChoiceType::class]); // OK.
```
The closure is invoked when `resolve()` is called. The closure must return a string (the deprecation message) or an empty string to ignore the option deprecation.
Multiple types and normalizer:
```php
$resolver = (new OptionsResolver())
->setDefault('percent', 0.0)
->setAllowedTypes('percent', ['null', 'int', 'float'])
->setDeprecated('percent', function ($value) {
if (null === $value) {
return 'Passing "null" to option "percent" is deprecated, pass a float number instead.';
}
if (is_int($value)) {
return sprintf('Passing an integer "%d" to option "percent" is deprecated, pass a float number instead.', $value);
}
})
->setNormalizer('percent', function (Options $options, $value) {
return (float) $value;
})
;
$resolver->resolve(['percent' => null]); // PHP Deprecated: Passing "null" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20]); // PHP Deprecated: Passing an integer "20" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20.0]); // OK.
```
The parameter passed to the closure is the value of the option after validating it and before normalizing it.
**Deprecating allowed values**
```php
$resolver = (new OptionsResolver())
->setDefault('percent', 0.0)
->setAllowedTypes('percent', 'float')
->setDeprecated('percent', function ($value) {
if ($value < 0) {
return 'Passing a number less than 0 to option "percent" is deprecated.';
}
})
;
$resolver->resolve(['percent' => -50.0]); // PHP Deprecated: Passing a number less than 0 to option "percent" is deprecated.
```
Commits
-------
f8746ce8bd Add ability to deprecate options
This PR was merged into the 4.2-dev branch.
Discussion
----------
[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26898
| License | MIT
Report unknown folders in templates/bundles in debug:twig and make suggestions if any
Developped with @bricejulia
Commits
-------
acfb325a35 refs #26898 Remove unnecessary loop Trim messages on build rather than on display
da42b3e23c refs #26898 Check if projectDir is not null before loop
da0c589385 refs #26898 Move changelog entry to 4.1.0 to 4.2.0
7d9467a319 Add an entry on json export format
bab9d99032 Use %twig.default_path% parameter and search in old folder structure too
1758de24a5 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] fix session tracking in surrogate master requests
| 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 | -
Spotted while looking at ESI fragments resolved by`HttpCache`: right now when the master request starts the session, fragments are not cacheable anymore, even when they do not use the session.
Commits
-------
146e01cb44 [HttpKernel] fix session tracking in surrogate master requests
This PR was squashed before being merged into the 4.2-dev branch (closes#26486).
Discussion
----------
[HttpFoundation] Adds getAcceptableFormats() method for Request
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21909
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Adds a new method `getAcceptableFormats()` for `Request`. This reads the content types in Accept header and maps them to formats already defined in `Request` class
In a request made by a browser, based on the default Accept header, the `getAcceptableFormats()` will return an array `['html', 'xml']`
In progress
- [x] gather feedback for my changes
- [x] submit changes to the documentation
Commits
-------
8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request
This PR was submitted for the master branch but it was squashed and merged into the 2.8 branch instead (closes#27508).
Discussion
----------
[Finder] Update RealIteratorTestCase
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27480
| License | MIT
| Doc PR | n/a
Makes the entire test directory empty instead of trying to delete particular files and directories. The old method failed when trying to remove a directory which was not empty.
Commits
-------
7d0ebd41ab [Finder] Update RealIteratorTestCase
This PR was merged into the 4.2-dev branch.
Discussion
----------
[TwigBundle] Enhance the twig not found exception
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27468
| License | MIT
| Doc PR | -
Improve error message to make it clear to developers what mistake they have made.
Commits
-------
32988b4294 Enhance the twig not found exception
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] show public/private for aliases in debug:container command
| 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 | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | not needed <!-- required for new features -->
It could be helpful to see the public/private status for aliases in `debug:container` command.
Otherwise you need to dive into the code to get the information, because the result only shows the options of the aliased service.
## Look & Feel for public alias
![screenshot 2018-06-08 09 25 50](https://user-images.githubusercontent.com/995707/41144664-f3b50766-6afd-11e8-92d0-ca30513a1afc.png)
_text has slightly changed_
## Look & Feel for private alias
![screenshot 2018-06-08 09 23 31](https://user-images.githubusercontent.com/995707/41144593-b354aad2-6afd-11e8-8ab1-f9196e567f67.png)
_text has slightly changed_
//cc @nicolas-grekas
Commits
-------
1df7742345 [FrameworkBundle] show public/private for aliases in debug:container command
This PR was squashed before being merged into the 4.2-dev branch (closes#27633).
Discussion
----------
[Messenger] Fixed MessengerPass::guessHandledClasses return type
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Good evening! Thanks for this amazing project.
I've searched over issues and PRs and I didn't find anything about this bug I found. Excuse me if this is a duplicate.
If you create an implementation of `MessageSubscriberInterface` and yield results from `getHandledMessages` method, a TypeError (like the following) will be raised:
```TypeError: Return value of Symfony\Component\Messenger\DependencyInjection\MessengerPass::guessHandledClasses() must be of the type array, object returned```
`MessengerPass::guessHandledClasses` return type declared is `array`, when `MessageSubscriberInterface::guessHandledClasses()`'s return type is `iterable`.
In this PR I have fixed the return type and wrote a simple test for it.
I am looking forward your review. Thank you.
Massimiliano
Commits
-------
0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type
This PR was squashed before being merged into the 3.4 branch (closes#27623).
Discussion
----------
[minor] SCA
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
New findings: language level, greedy regex, array_column usages
Commits
-------
5922507dc5 [minor] SCA
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] serialize objects using native arrays when possible
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR allows leveraging OPCache shared memory when storing objects in `Php*` pool storages (as done by default for all system caches). This improves performance a bit further when loading e.g. annotations, etc. (bench coming);
Instead of using native php serialization, this uses a marshaller that represents objects in plain static arrays. Unmarshalling these arrays is faster than unserializing the corresponding PHP strings (because it works with copy-on-write, while unserialize cannot.)
php-serialization is still a possible format because we have to use it when serializing structures with internal references or with objects implementing `Serializable`. The best serialization format is selected automatically so this is completely seamless.
ping @palex-fpt since you gave me the push to work on this, and are pursuing a similar goal in #27484. I'd be thrilled to get some benchmarks on your scenarios.
Commits
-------
866420e2eb [Cache] serialize objects using native arrays when possible
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Improve perf of array-based pools
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
- skip key validation when key is already known
- remove overhead in `ArrayCache::get()` via inlining
- don't store simple values in serialized format when not needed, preserving COW
~~Needs #27565 to be green.~~
Commits
-------
92a2d4754f [Cache] Improve perf of array-based pools
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Prevent stampede at warmup using flock()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Replaces #27028
This PR protects against cache stampede by wrapping the computation of items in a pool of locks.
For each apps, there can be at most 20 concurrent processes that compute items at the same time and only one per cache-key.
Commits
-------
0ac2777ad1 [Cache] Prevent stampede at warmup using flock()
This PR was squashed before being merged into the 3.4 branch (closes#27596).
Discussion
----------
[Framework][Workflow] Added support for interfaces
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
I consider this to be a bugfix in config, because `ClassInstanceSupportStrategy` (`InstanceOfSupportStrategy`) actually works with interfaces. Therefore propose to 3.4.
Commits
-------
6104c28c08 [Framework][Workflow] Added support for interfaces
* 4.1:
remove HHVM code
[VarDumper] Fix dumping ArrayObject and ArrayIterator instances
[ProxyManagerBridge] Fixed support of private services
[Cache] Fix typo in comment.
[FrameworkBundle] give access to non-shared services when using test.service_container
Fix bad method call with guard authentication + session migration
Avoid calling eval when there is no script embedded in the toolbar
* 3.4:
[VarDumper] Fix dumping ArrayObject and ArrayIterator instances
[ProxyManagerBridge] Fixed support of private services
[Cache] Fix typo in comment.
Fix bad method call with guard authentication + session migration
This PR was merged into the 2.8 branch.
Discussion
----------
[VarDumper] Fix dumping ArrayObject and ArrayIterator instances
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Properties added on child classes of `ArrayObject` and `ArrayIterator`, or dynamic properties added on instances of them were now properly dumped. This fixes it.
![image](https://user-images.githubusercontent.com/243674/41349429-2660cbc6-6f10-11e8-8015-a3d6ad8b0c9c.png)
Commits
-------
3ecabfc36e [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
This PR was merged into the 4.1 branch.
Discussion
----------
[FrameworkBundle] give access to non-shared services when using test.service_container
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27488
| License | MIT
| Doc PR | -
Commits
-------
516ff5a985 [FrameworkBundle] give access to non-shared services when using test.service_container
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Use sub-second accuracy for internal expiry calculations
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | not really
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Embeds #26929, #27009 and #27028, let's focus on the 4th commit for now.
This is my last significant PR in the Cache series :)
By using integer expiries internally, our current implementations are sensitive to abrupt transitions when time() goes to next second: `$s = time(); sleep(1); echo time() - $s;` *can* display 2 from time to time.
This means that we do expire items earlier than required by the expiration settings on items.
This also means that there is no way to have a sub-second expiry. For remote backends, that's fine, but for ArrayAdapter, that's a limitation we can remove.
This PR replaces calls to `time()` by `microtime(true)`, providing more accurate timing measurements internally.
Commits
-------
08554ea18c [Cache] Use sub-second accuracy for internal expiry calculations
This PR was merged into the 4.1 branch.
Discussion
----------
[FrameworkBundle] fix for allowing single colon controller notation
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27522
| License | MIT
| Doc PR | -
This fixes a BC break introduced in https://github.com/symfony/symfony/pull/26085#pullrequestreview-126370222.
ping @Tobion
Commits
-------
1680674174 [FrameworkBundle] fix for allowing single colon controller notation
* 4.1:
fixed CS
Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
fixed CS
Avoid migration on stateless firewalls
[Serializer] deserialize from xml: Fix a collection that contains the only one element
[HttpKernel] Log/Collect exceptions at prio 0
[PhpUnitBridge] Fix error on some Windows OS
[DI] Deduplicate generated proxy classes
[Routing] fix matching host patterns, utf8 prefixes and non-capturing groups
* 4.0:
fixed CS
Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
fixed CS
Avoid migration on stateless firewalls
[Serializer] deserialize from xml: Fix a collection that contains the only one element
[PhpUnitBridge] Fix error on some Windows OS
[DI] Deduplicate generated proxy classes
* 3.4:
fixed CS
Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
fixed CS
Avoid migration on stateless firewalls
[Serializer] deserialize from xml: Fix a collection that contains the only one element
[PhpUnitBridge] Fix error on some Windows OS
[DI] Deduplicate generated proxy classes
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Add stampede protection via probabilistic early expiration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR |
This PR implements [probabilistic early expiration](https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration) on top of `$cache->get($key, $callback);`
It adds a 3rd arg to `CacheInterface::get`:
> float $beta A float that controls the likelyness of triggering early expiration. 0 disables it, INF forces immediate expiration. The default is implementation dependend but should typically be 1.0, which should provide optimal stampede protection.
Commits
-------
13523ad985 [Cache] Add stampede protection via probabilistic early expiration
This PR was squashed before being merged into the 3.4 branch (closes#27556).
Discussion
----------
Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Related to #27395
| License | MIT
| Doc PR | symfony/symfony-docs#9860
This is the sister PR to #27452, which covered all the other authentication listeners.
Commits
-------
c06f3229de Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
This PR was squashed before being merged into the 2.8 branch (closes#27452).
Discussion
----------
Avoid migration on stateless firewalls
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Related to #27395
| License | MIT
| Doc PR | symfony/symfony-docs#9860
This is a proof-of-concept. Once we agree / are happy, I need to add this to all of the other authentication mechanisms that recently got the session migration code & add tests.
Basically, this avoids migrating the session if the firewall is stateless. There were 2 options to do this:
A) Make the `SessionAuthenticationStrategy` aware of all stateless firewalls. **This is the current approach**
or
B) Make each individual authentication listener aware whether or not *its* firewall is stateless.
Commits
-------
cca73bb564 Avoid migration on stateless firewalls
This PR was squashed before being merged into the 3.4 branch (closes#27326).
Discussion
----------
[Serializer] deserialize from xml: Fix a collection that contains the only one element
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27279
| License | MIT
| Doc PR |
In xml when parent node (`restaurants`) contains several children nodes with the same tag (`restaurant`) it is clear that the children form a collection:
```
restaurants = {array} [1]
restaurant = {array} [2]
0 = {array} [2]
name = "Some restaurant name"
type = "Chinese"
1 = {array} [2]
name = "Another restaurant name"
type = "Italian"
```
Afterwards the object denormalizer has no problem to create a collection of restaurants.
But when there is only one child (`restaurant`) the decoded normalized array will not contain a collection:
```
restaurants = {array} [1]
restaurant = {array} [2]
name = "Some restaurant name"
type = "Chinese"
```
In this situation the object denormalizer threw unexpected exception. This PR modifies `AbstractObjectNormalizer` that is it will fill a collection containing the sole element properly.
Commits
-------
1f346f446d [Serializer] deserialize from xml: Fix a collection that contains the only one element
* 4.1:
[FrameworkBundle] decouple some cache-warmer's test from internal details
bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
Remove released semaphore
* 4.0:
[FrameworkBundle] decouple some cache-warmer's test from internal details
bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
Remove released semaphore
* 3.4:
[FrameworkBundle] decouple some cache-warmer's test from internal details
bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
Remove released semaphore
This PR was merged into the 3.4 branch.
Discussion
----------
[Lock] Remove released semaphore
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27356
| License | MIT
| Doc PR | NA
This PR remove the semaphore with `sem_remove`. By removing without releasing the semaphore, all pending blocking acquiring will fail that's why the acquire method has also been update to handle such case
Commits
-------
77b9f90a32 Remove released semaphore
This PR was merged into the 3.4 branch.
Discussion
----------
TagAwareAdapter over non-binary memcached connections corrupts memcache
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | #27405
| License | MIT
| Doc PR |
TagAwareAdapter uses non-ascii symbols in key names. It breaks memcached connections in non-binary mode.
Commits
-------
67d4e6dd29 bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
* 4.1:
[Cache][Security] Use Throwable where possible
revert #27545
Update Finder.php
[FrameworkBundle] remove dead code in CachePoolClearerPass
Fix security-core cross-dependencies, fixes#27507
Pass previous exception to FatalErrorException
* 4.0:
[Cache][Security] Use Throwable where possible
revert #27545
Update Finder.php
[FrameworkBundle] remove dead code in CachePoolClearerPass
Fix security-core cross-dependencies, fixes#27507
Pass previous exception to FatalErrorException
Corrected return type which causes following error with (psalm)[https://getpsalm.org/]
```
ERROR: PossiblyInvalidArgument - src/Command/Utils/CheckVendorDependencies.php:170:62 - Argument 1 of iterator_to_array expects Traversable, possibly different type array<mixed, Symfony\Component\Finder\SplFileInfo>|Iterator provided $directories = array_map($closure, iterator_to_array($finder->getIterator()));
```
This PR was merged into the 2.8 branch.
Discussion
----------
[Debug] Pass previous exception to FatalErrorException
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27483
| License | MIT
Add a previous parameter to FatalErrorException.
Call \ErrorException with this parameter.
Update parent::__constructor for inherited classes with default parameters and the new one
Commits
-------
7f9780b5df Pass previous exception to FatalErrorException
This PR was merged into the 3.4 branch.
Discussion
----------
Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27212
| License | MIT
| Doc PR | -
This reverts commit b213c5a758, reversing
changes made to 61af0e3a25.
This breaks BC and is more like a new feature, let's move this on master.
Commits
-------
c6acad719d Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
* 4.1:
[FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer()
Remove mentions of "beta" in composer.json files
[DI] Ignore missing tree root nodes on validate
[WebProfilerBundle] fixed getSession when no session has been set deprecation warnings
bug #27299 [Cache] memcache connect should not add duplicate entries on sequential calls
[Router] regression when matching a route
[FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override
[Routing] Don't reorder past variable-length placeholders
[DebugBundle] DebugBundle::registerCommands should be noop
[BrowserKit] Fix a BC break in Client affecting Panthère
[DX] Improve exception message when AbstractController::getParameter fails
simple-phpunit: remove outdated appveryor workaround
This PR was merged into the 4.1 branch.
Discussion
----------
[FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer()
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | -
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27494
| License | MIT
| Doc PR | -
By making `Client::getContainer()` return the new test container, we broke BC, as spotted in linked issue.
Always use `static::$container` in your tests instead.
While reverting to returning the real container, I noticed we have a serious design issue in the way the test container currently works: because the kernel can be rebooted, we cannot inject the container directly, but have to go through the kernel all the time. Fixing this forces doing a BC break on the constructor of `TestContainer`. Since this is a new class and since it's mostly internal, I think we should do it now. I've marked the class as internal to further strengthen this.
Commits
-------
6764d4e012 [FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer()
This PR was squashed before being merged into the 4.1 branch (closes#27472).
Discussion
----------
[DI] Ignore missing tree root nodes on validate
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | technically yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27450
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest 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 the master branch.
-->
Commits
-------
b3cdfc64b5 [DI] Ignore missing tree root nodes on validate
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] Don't generate factories for errored services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Spotted while comparing the dumped container of Blackfire with Symfony 4.0 vs 4.1.
Commits
-------
a6b6206a62 [DI] Don't generate factories for errored services
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Should enhance DX by preventing situations like #27436.
Commits
-------
e2f344fa32 [FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances
This PR was squashed before being merged into the 4.2-dev branch (closes#27077).
Discussion
----------
[DependencyInjection] add ServiceSubscriberTrait
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23898
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/9809
This allows you to easily configure Service Subscribers with the following convention:
```php
class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait;
public function doSomething()
{
// $this->router() ...
}
private function router(): RouterInterface
{
return $this->container->get(__METHOD__);
}
}
```
This also allows you to create helper traits like `RouterAware`, `LoggerAware` etc... and compose your services with them (*not* using `__METHOD__` in traits because it doesn't behave as expected.).
```php
trait LoggerAware
{
private function logger(): LoggerInterface
{
return $this->container->get(__CLASS__.'::'.__FUNCTION__);
}
}
```
```php
trait RouterAware
{
private function router(): RouterInterface
{
return $this->container->get(__CLASS__.'::'.__FUNCTION__);
}
}
```
```php
class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait, LoggerAware, RouterAware;
public function doSomething()
{
// $this->router() ...
// $this->logger() ...
}
}
```
Commits
-------
238e793431 [DependencyInjection] add ServiceSubscriberTrait
This PR was merged into the 4.1 branch.
Discussion
----------
[Routing] Don't reorder past variable-length placeholders
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | #27491
| License | MIT
Commits
-------
44616d9bcc [Router] regression when matching a route
7a750d4508 [Routing] Don't reorder past variable-length placeholders
This PR was merged into the 4.1 branch.
Discussion
----------
[DebugBundle] DebugBundle::registerCommands should be noop
| Q | A
| ------------- | ---
| Branch? | 4.1 <!-- see below -->
| 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 | #27493 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Commits
-------
dd4b0edb22 [DebugBundle] DebugBundle::registerCommands should be noop
This PR was merged into the 4.1 branch.
Discussion
----------
[FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override
| Q | A
| ------------- | ---
| Branch? | 4.1 <!-- see below -->
| Bug fix? | no
| 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 | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
These two bundles requires `symfony/http-kernel:^4.1` which already makes [`Bundle::registerCommands`](49ad34b78e/src/Symfony/Component/HttpKernel/Bundle/Bundle.php (L143-L145)) a noop.
Commits
-------
7c97846811 [FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override
This PR was squashed before being merged into the 4.1 branch (closes#27485).
Discussion
----------
[BrowserKit] Fix a BC break in Client affecting Panthère
| Q | A
| ------------- | ---
| Branch? | 4.1
| 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 | dunglas/panthere#25
| License | MIT
| Doc PR | n/a
Commits
-------
e3aa90f852 [BrowserKit] Fix a BC break in Client affecting Panthère
This PR was squashed before being merged into the 4.1 branch (closes#27443).
Discussion
----------
[DX] Improve exception message when AbstractController::getParameter fails
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | no (DX)
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27436
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Improve exception message for situations where the `parameter_bag` is not present in `AbstractController`. Also fixed the exception to the correct type.
Commits
-------
a8f4128 [DX] Improve exception message when AbstractController::getParameter fails
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Actually, there is no downside in using a taggable cache pool as a backend for CacheInterface.
This means we can simplify things and remove the TaggableCacheInterface and keep only CacheInterface (master-only).
Commits
-------
c250fbdda0 [Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface
* 4.1: (22 commits)
[HttpKernel] Fix restoring trusted proxies in tests
Update UPGRADE-4.0.md
[Messenger] Fix suggested enqueue adapter package
bumped Symfony version to 4.1.1
updated VERSION for 4.1.0
updated CHANGELOG for 4.1.0
Insert correct parameter_bag service in AbstractController
Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)"
CODEOWNERS: some more rules
removed unneeded comments in tests
removed unneeded comments in tests
Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
[HttpKernel] fix registering IDE links
update UPGRADE-4.1 for feature #26332 Form field help option
[HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
[Process] Consider \"executable\" suffixes first on Windows
Triggering RememberMe's loginFail() when token cannot be created
bumped Symfony version to 4.1.0
updated VERSION for 4.1.0-BETA3
updated CHANGELOG for 4.1.0-BETA3
...
* 4.0:
[HttpKernel] Fix restoring trusted proxies in tests
Update UPGRADE-4.0.md
CODEOWNERS: some more rules
removed unneeded comments in tests
removed unneeded comments in tests
Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
[HttpKernel] fix registering IDE links
[HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
[Process] Consider \"executable\" suffixes first on Windows
Triggering RememberMe's loginFail() when token cannot be created
[Serializer] Fix serializer tries to denormalize null values on nullable properties
[FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
* 3.4:
[HttpKernel] Fix restoring trusted proxies in tests
Update UPGRADE-4.0.md
CODEOWNERS: some more rules
removed unneeded comments in tests
removed unneeded comments in tests
Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
[HttpKernel] fix registering IDE links
[HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
[Process] Consider \"executable\" suffixes first on Windows
Triggering RememberMe's loginFail() when token cannot be created
[Serializer] Fix serializer tries to denormalize null values on nullable properties
[FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger][Profiler] Show dispatch caller
| Q | A
| ------------- | ---
| Branch? | 4.2 <!-- see below -->
| 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 | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Just something I missed on my checklist in the first PR:
![mai-22-2018 19-51-52](https://user-images.githubusercontent.com/2211145/40380514-a0ba3326-5df9-11e8-9dd6-82a42dc7ccae.gif)
Commits
-------
1c2f43f17c [Messenger][Profiler] Show dispatch caller
This PR was squashed before being merged into the 4.2-dev branch (closes#27429).
Discussion
----------
[PropertyInfo] Auto-enable PropertyInfo component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ø
| License | MIT
| Doc PR | ø
The PropertyInfo component (used by the Serializer to provide more insights from PhpDocs, etc...) is disabled by default, not sure why. This enables it by default when the component is installed.
Commits
-------
06ea72e3b2 [PropertyInfo] Auto-enable PropertyInfo component
This PR was merged into the 4.2-dev branch.
Discussion
----------
[WebProfilerBundle] Make Twig bundle an explicit dependency
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26115
| License | MIT
Let's make Twig bundle an explicit dependency of WebProfilerBundle. That's better for DX and as Silex won't be maintained when 4.2 is out, it's the right time to do so.
Commits
-------
cac37caa7d [WebProfilerBundle] made Twig bundle an explicit dependency
* 2.8:
removed unneeded comments in tests
Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
[HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
[Process] Consider \"executable\" suffixes first on Windows
Triggering RememberMe's loginFail() when token cannot be created
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Finder] added "use natural sort" option
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26930
| License | MIT
| Doc PR | symfony/symfony-docs#9671
Added `$useNaturalSort` optional argument to `Finder::sortByName()` method. If it is specified and equals to `true`, ["natural sort order" algorithm](https://en.wikipedia.org/wiki/Natural_sort_order) will be applied, which means that `strnatcmp` function will be used instead of `strcmp` (see #26930 for details).
Commits
-------
e697c7d272 [Finder] added "use natural sort" option
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27259
| License | MIT
| Doc PR | no
Hello!
There is fix for #27259 issue. It changes priority of `AddConsoleCommandPass` to `TYPE_BEFORE_REMOVING` as @chalasr advised. I'm not sure about side effects by that.
Commits
-------
e36099503f [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
This PR was squashed before being merged into the 2.8 branch (closes#26973).
Discussion
----------
[HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
| Q | A
| ------------- | ---
| Branch? | 2.7 and up
| Bug fix? | improvement
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ---
| License | MIT
| Doc PR | ---
SubRequest used in `InlineFragmentRendered` explicitly sets `$server['REMOTE_ADDR']` to `127.0.0.1`. Therefore, it's required to configure `127.0.0.1` address in TRUSTED_PROXIES environment variable. Without that, `Request::isFromTrustedProxy()` will return false.
The current behavior might be a little bit problematic, for instance, in case where images are rendered through subrequests. These might end-up with an incorrect schema in URL (`http` instead of `https`).
Commits
-------
18f55feef8 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.