This PR was submitted for the 4.2 branch but it was merged into the 4.1 branch instead (closes#30003).
Discussion
----------
Remove unreachable code
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | (unreachable)
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | n/a (unreachable) <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
The try/finally block will either return or throw.
Additionally, $socket was never defined.
Detected via static analysis
Commits
-------
2fb8f49146 Remove unreachable code
This PR was merged into the 4.2 branch.
Discussion
----------
Fix format strings for deprecation notices
| Q | A
| ------------- | ---
| Branch? | master for features / 3.4 up to 4.2 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? |
| Fixed tickets |
| License | MIT
| Doc PR |
The `%c` conversion specifier expects an integer
(the value of the byte to print). To produce a literal `%`, `%%` should be used.
Detected via static analysis
Commits
-------
2e00dfb0c8 Fix format strings for deprecation notices
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] add id of referencing service when a deprecated alias is found
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Improves #29968 a bit for DX.
Commits
-------
b124fb7271 [DI] add id of referencing service when a deprecated alias is found
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (Manual tests only)
| Fixed tickets | #28122
| License | MIT
| Doc PR | n/a
According to issue https://github.com/symfony/symfony-docs/pull/10442, we tested in a demo bundle, for example in src/AppBundle/Resources/config/config.yml a package using hyphens: app-client-frontend, and withouth the patch it fails because the package is not recognized. With the patch, it works as expected.
```
framework:
assets:
packages:
app-client-frontend:
version: "%env(FRONTEND_VERSION)%"
version_format: '%%2$s/dist/%%1$s'
base_urls:
- "%env(FRONTEND_URL)%"
```
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] move add mime type guesser pass to the component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
ba20bb2e7e move add mime type guesser pass to the component
This PR was merged into the 4.3-dev branch.
Discussion
----------
[PHPUnitBridge] Static access in closure
| Q | A
| ------------- | ---
| Branch? | master for features
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n / a
| License | MIT
| Doc PR | n / a
#29718 bumps php to 5.5 . This is what we could simplify if it gets merged, thanks to this "new" PHP feature: https://3v4l.org/sJOWr
EDIT: it was merged, this can be reviewed.
Commits
-------
97f3023963 Use the scope of an instance
9df76ebbe5 Extract closures into static functions
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] deprecate some options for single_text widgets
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
89ff331865 deprecate some options for single_text widgets
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] Add a set of default content-types for some extensions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| 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
Some extensions have many possible content-types. This PR forces the first (preferred) content type for some extensions (the preset comes from Swiftmailer).
Commits
-------
37065d45f3 [Mime] added a set of default content-types for some extensions
This PR was merged into the 4.3-dev branch.
Discussion
----------
remove accidentally added changelog entries
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The `help_html` option is neither part of the Twig bridge nor of the
FrameworkBundle. It is provided by the Form component.
Commits
-------
aa354cef57 remove accidentally added changelog entries
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Debug][DebugClassLoader] Match callable() type for parameters not defined in sub classes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29969
| License | MIT
| Doc PR | -
Added test fixture for multi param, no param type and multi spaces as well.
BTW, I didn't understand why there was a positive lookbehind on the current regex. Looks useless to me and tests passes without it.
Commits
-------
89c89c9776 [Debug][DebugClassLoader] Match callable() type for parameters not defined in sub classes
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DependencyInjection] fix DOM element namespace URL access
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
429bddf96b fix DOM element namespace URL access
This PR was merged into the 3.4 branch.
Discussion
----------
Replace gender by eye color in tests
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- 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 | #29737 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | <!-- 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.
-->
I've slightly changed @derrabus proposition to use color only because of the potentially racist interpretation when used for a person, open for discussion though.
Commits
-------
72180342b7 Replace gender by eye color in tests
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] allow using compiled matchers and generators without dumping PHP code
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #29590
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10790
This is a resurrection of #25909 to make matcher+generator dumpers output PHP arrays instead of PHP code.
Don't be fooled by the diff stats, it's mostly fixtures.
This PR should contribute to making the Routing component easier to use standalone.
On the way back from SFLive USA.
![image](https://user-images.githubusercontent.com/243674/46920076-784e1b80-cf9d-11e8-86e7-850fffb409de.png)
Commits
-------
f0a519ac7d [Routing] allow using compiled matchers and generators without dumping PHP code
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
As discussed in https://github.com/symfony/symfony/issues/28918, PSR-16 implementations are now mostly useless: either PSR-6 or contracts' CacheInterface is always a better fit.
Let's deprecate them all but keep only a `Psr16Cache` to turn any PSR-6 implementation to a PSR-16 one.
From the changelog:
* removed `psr/simple-cache` dependency, run `composer require psr/simple-cache` if you need it
* deprecated all PSR-16 adapters, use `Psr16Cache` or `Symfony\Contracts\Cache\CacheInterface` implementations instead
* deprecated `SimpleCacheAdapter`, use `Psr16Adapter` instead
* deprecated the "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service, use "Symfony\Contracts\Cache\CacheInterface" / "cache.app" instead
Commits
-------
5006be63c1 [Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead
This PR was merged into the 4.3-dev branch.
Discussion
----------
introducing native php serialize() support for Messenger transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes and no
| New feature? | yes and no
| BC breaks? | maybe (yes if we change the default)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29163
| License | MIT
| Doc PR | TODO!
Messenger currently uses the Serialize to serialize to JSON and then unserialize. This creates a lot of issues:
1) The default serializer requires you to have getter & setter method (or public properties) for them to be serialized. This makes it easy for data to disappear. I've seen several really smart people have this problem.
2) Related to the above, the forced getters/setters (and no required constructor args) force you to design your message classes around this.
It's not that the serializer is doing a bad job - it's just not the right use-case for it.
This PR proposes simply using `serialize()` and `unserialize()`. This is the behavior we want: we want to put objects to sleep and wake them back up.
I believe the original reason we did not do this was so that we could export "generic JSON", in case we wanted other workers (not our Symfony app) to consume the messages. But, that's an edge case, and could still be accomplished by creating your own serializer.
Btw, Laravel uses `serialize()` as does Enqueue for (un)serializing Event objects. We're making our life more difficult for no benefit.
Cheers!
Commits
-------
97e2e32af4 Changing default serializer in Messenger component to PhpSerializer
3111cef9a4 Update src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml
4132bfebe7 updating CHANGELOGs and fixing tests
b4788e4808 introducing native php serialize() support for Messenger transport
* 4.2:
[HttpFoundation] Check file exists before unlink
[Console] Fixed#29835: ConfirmationQuestion with default true for answer '0'
[Cache] PDO-based cache pool table autocreation does not work
[Translation] Concatenated translation messages
[Form] ensure compatibility with older PHPUnit mocks
[Serializer] Docblock about throwing exceptions on serializer
[Cache] fix used variable name
[Debug][ErrorHandler] Preserve our error handler when a logger set another one
[Form] Changed UrlType input type to text when default_protocol is not null
[Bugfix] MemcachedSessionHandler::close() must close connection
Always pass $key to NullAdapter->createCacheItem
* 4.1:
[HttpFoundation] Check file exists before unlink
[Console] Fixed#29835: ConfirmationQuestion with default true for answer '0'
[Translation] Concatenated translation messages
[Form] ensure compatibility with older PHPUnit mocks
[Serializer] Docblock about throwing exceptions on serializer
[Debug][ErrorHandler] Preserve our error handler when a logger set another one
[Form] Changed UrlType input type to text when default_protocol is not null
[Bugfix] MemcachedSessionHandler::close() must close connection
* 3.4:
[HttpFoundation] Check file exists before unlink
[Console] Fixed#29835: ConfirmationQuestion with default true for answer '0'
[Translation] Concatenated translation messages
[Form] ensure compatibility with older PHPUnit mocks
[Serializer] Docblock about throwing exceptions on serializer
[Debug][ErrorHandler] Preserve our error handler when a logger set another one
[Form] Changed UrlType input type to text when default_protocol is not null
[Bugfix] MemcachedSessionHandler::close() must close connection
This PR was merged into the 4.3-dev branch.
Discussion
----------
[VarDumper] Improve performance of AbstractCloner
| 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 | -
While profiling Symfony in "dev" environment (see #29762) I found that `VarCloner::addCasters()` was making thousands of `strtolower()` calls.
![varcloner-addcasters](https://user-images.githubusercontent.com/73419/50694461-40a1bd80-103a-11e9-83c0-a28b8f8f161e.png)
In this PR I propose to remove all those calls. I think it's possible to do it ... but I could be completely wrong, so please review.
-----
As a side note, in the past we did the same `strtolower()` to service IDs and parameter names. We stopped doing that in Symfony 3.3 and it gave us a small performance improvement (same as we could gain here).
If the `strtolower()` calls of `VarCloner::addCasters()` are made just to apply the caster even if the class name is wrongly spelled, I think we could make this change. My guess is that nothing would break for the user (unlike removing the `strtolower()` in DependencyInjection, which broke wrongly spelled services and params). Thanks!
Commits
-------
cff23e52bf [VarDumper] Improve performance of AbstractCloner
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes#29764).
Discussion
----------
[HttpFoundation] Check file exists before unlink
Check file exists to prevent ErrorException
| Q | A
| ------------- | ---
| Branch? | 2.6 <!-- 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 | #... <!-- #-prefixed issue number(s), if any -->
| 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
-------
1954187fac [HttpFoundation] Check file exists before unlink