This PR was merged into the 2.8 branch.
Discussion
----------
[Request] [Documentation] clarify that isMethodCacheable() returns true only for GET & HEAD
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | na
| License | MIT
The current documentation points to https://tools.ietf.org/html/rfc7231#section-4.2.3.
The spec says: "this specification defines GET, HEAD, and POST as cacheable, although the overwhelming majority of cache implementations only support GET and HEAD.".
This fix to the documentation clarifies that Symfony follows majority (excluding POST) rather than the spec (including POST).
Commits
-------
9da998005b Doc fix: clarify isMethodCacheable() returns true only for GET & HEAD
This PR was merged into the 2.8 branch.
Discussion
----------
Changes for upcoming Travis' infra migration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Travis is deprecating the `sudo` keyword and moves everything to the same infrastructure (`sudo` really selects between two infrastructures).
See: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
Commits
-------
b3742694d9 Changes for upcoming Travis' infra migration
The current documentation points to https://tools.ietf.org/html/rfc7231#section-4.2.3.
The spec says: "this specification defines GET, HEAD, and POST as cacheable, although the overwhelming majority of cache implementations only support GET and HEAD.".
This fix to the documentation clarifies that Symfony follows majority (excluding POST) rather than the spec (including POST).
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] Fixed absolute Request URI with default port
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29234
| License | MIT
| Doc PR |
This PR fixes the #29234 issue, the request URI with default port was not properly generated.
Example :
```php
$request = Request::create('http://test.com:80/foo');
$request->server->set('REQUEST_URI', 'http://test.com:80/foo');
```
Before this fix, the `$request->getUri()` method returned `http://test.com/:80/foo` :
```diff
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'http://test.com/foo'
+'http://test.com/:80/foo'
```
Commits
-------
cddce2af61 [HttpFoundation] Fixed absolute Request URI with default port
This PR was merged into the 3.4 branch.
Discussion
----------
[Routing] Remove duplicate schemes and methods for invokable controllers
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29225
| License | MIT
This PR backport for 3.4 branch the same issue than the PR #29225.
I add a test to check the fix when annotation are on the class and rename another one when the route annotation is on the invoke method.
Commits
-------
640ccdf069 [Routing] Remove duplicate schemes and methods for invokable controllers
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] Fix trailing space for mime-type with parameters
| 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 | #... <!-- #-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.
-->
This PR fixes a minor issue that we've discovered by exposing our API towards mobile applications which where sending the header as following `content-type: application/json ;charset=UTF-8`. Request is unable to determine the `getContentType -> getFormat` as **json** due to the whitespace at the end.
```php
$request = Request::createFromGlobals();
$request->headers->set('CONTENT_TYPE', 'application/json ;charset=UTF-8'); // Forcing header for test
if ($request->getContentType() !== 'json') {
// Return 415 (Unsupported Media Type) status code..
}
```
When checking https://tools.ietf.org/html/rfc7231#section-3.1.1.1 it seems that a space is part of the RFC spec. (Where OWS is abbreviated for Optional WhiteSpace)
```
media-type = type "/" subtype *( OWS ";" OWS parameter )
```
Current the following cases are supported:
* application/json; charset=UTF-8
* application/json;charset=UTF-8
The following are failing:
* application/json ; charset=UTF-8
* application/json ;charset=UTF-8
Commits
-------
f4866bc371 [HttpFoundation] Fix trailing space for mime-type with parameters
This PR was merged into the 2.8 branch.
Discussion
----------
[Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php] Fix indentation error
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | no
| License | MIT
| Doc PR | no
Commits
-------
24264facaa Indentation error
This PR was squashed before being merged into the 3.4 branch (closes#29231).
Discussion
----------
SCA: consolidate non empty array checks across codebase
| 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
This PR replaces `is_array(...) && count(...) > 0` with `... && is_array(...)` construct used in the codebase.
Commits
-------
2f1fd54dda SCA: consolidate non empty array checks across codebase
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] fix optimizing Psr6Cache for AdapterInterface pools
| 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 described by @Tobion in https://github.com/symfony/symfony/pull/29236/files#r234324045:
> The problem I have experienced is that in dev mode the cache is decorated with a TraceableCache. This means it loses this optimization and introduces https://github.com/symfony/symfony/issues/28918#issuecomment-432399481 again
Commits
-------
b8100a9df0 [Cache] fix optimizing Psr6Cache for AdapterInterface pools
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] fix taking lazy services into account when dumping the container
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29246
| License | MIT
| Doc PR | -
This PR fixes issues found while working on #29246.
It *does* fix the infinite loop, ~but replaces it by an exception (reopening #29078)~:
> ~It's a requirement to specify a Metadata Driver and pass it to Doctrine\ORM\Configuration::setMetadataDriverImpl()~
The full fix is not immediately accessible as it needs some core changes to the dumping logic. Requiring `symfony/proxy-manager-bridge` works around the issue properly.
See #29251 for 4.2
Commits
-------
67d7623e72 [DI] fix taking lazy services into account when dumping the container
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Fixed empty data for compound date interval
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #4715 (continuation)
| License | MIT
| Doc PR | ~
Following #29182, since this type has been introduced in Symfony 3 but with the same limitation explained in #4715.
So for consistency this needs to be fixed here as well.
Commits
-------
38a2abc790 [Form] Fixed empty data for compound date interval
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] Added the missing constraints instance checks
| 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 |
This PR adds the constraints instance checks missing to limit the validators use.
This behavior is already implemented in all built-in validators, but it was missed in two validators.
Commits
-------
0ecaead015 [Validator] Added the missing constraints instance checks
This PR was merged into the 3.4 branch.
Discussion
----------
[PropertyAccessor] Fix unable to write to singular property using setter while plural adder/remover exist
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28961
| License | MIT
Please take a look at the tests I added - they describe the issue. It has to do with the priorities: `findAdderAndRemover('User', 'email')` is called earlier than `$this->isMethodAccessible('User', 'setEmail', 1)`
Commits
-------
8238f167ad [PropertyAccessor] Fix unable to write to singular property using setter while plural adder/remover exist
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] Fixed empty data for compound date types
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #4715
| License | MIT
| Doc PR | ~
Commits
-------
9bab1e8aba [Form] Fixed empty data for compound date types
This PR was merged into the 2.8 branch.
Discussion
----------
Command::addOption should allow int in $default
| Q | A
| ------------- | ---
| Branch? | all
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| 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.
-->
In #28714 the documentation for `$default` on `Command::addOption` was changed to specify more specifically than `mixed`. However, there is an inconsistency as `InputOption::__construct` allows int in its `$default`, but not `Command::addOption`. This PR makes fixes that inconsistency.
Commits
-------
5f8bd89 Command::addOption should allow int in $default
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] Minor fixes in docs and cs
| 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 | ~
Commits
-------
de40f5d07b [Form] Minor fixes in docs and cs
* 2.8:
[Form] Fixed keeping hash of equal \DateTimeInterface on submit
[PhpUnitBridge] Fix typo
[Config] Unset key during normalization
invalidate forms on transformation failures