This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Envelope-aware middleware is never called with a message
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | no
| License | MIT
| Doc PR | no
Messenger components middlewares implementing `Symfony\Component\Messenger\EnvelopeAwareInterface` receive in their handle method an instance of `Symfony\Component\Messenger\Envelope`, not a message.
To better reflect the expected usage, I've updated the unit tests for the message middleware and fixed the code accordingly.
Commits
-------
9488e2a026 [Messenger] Envelope-aware middleware is never called with a message
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 merged into the 3.4 branch.
Discussion
----------
Fix tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| 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
Makes Travis green. It's a temporary fix while the 2.6 branch of Doctrine isn't merged in the 2.7 one.
Not sure if it is worth a merge.
Commits
-------
aaf7e889f7 Fix tests
This PR was merged into the 4.2-dev branch.
Discussion
----------
Fix test file relative for AppVeyor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Fix test for AppVeyor introduced in https://github.com/symfony/symfony/pull/27978https://ci.appveyor.com/project/fabpot/symfony/build/1.0.38700#L616
Commits
-------
186a7a9824 Fix test file relative for AppVeyor
This PR was merged into the 2.8 branch.
Discussion
----------
[DX] Fix PHPDoc return type
GetResponseEvent::getResponse() may return null too
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
While doing static analysis on my code, I got a false negative for this method, since it may return null, but the PHPDoc says otherwise.
Commits
-------
8e49598788 Fix PHPDoc return type
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 2.8 branch.
Discussion
----------
[MonologBridge] Improve FirePHPHandler
| 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
Fix a call to a parent static property. Remove a useless call to `getRequest()`
Commits
-------
1d93b5e26a [MonologBridge] Improve FirePHPHandler
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
This PR was submitted for the 3.2 branch but it was merged into the 3.4 branch instead (closes#27966).
Discussion
----------
[FrameworkBundle] fixed brackets position in method calls
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Fixed wrong colons positions in hasDefinition method calls
Commits
-------
b5863bc7e8 [FrameworkBundle] fixed brackets position in method calls
This PR was merged into the 4.1 branch.
Discussion
----------
[Form] Remaining changes for bootstrap 4 file fields
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no>
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | —
| License | MIT
| Doc PR | —
Hi again,
This is a follow-up PR for #27919
Apparently I talked about it in the previous PR, but forgot to actually push the change. Sorry about that! 😞
This PR no actually adds this instead of just talking about it:
![2018-07-15 at 17 52](https://user-images.githubusercontent.com/1032411/42735630-e19b22be-8857-11e8-85b8-6d64e17c2be2.png)
Sorry again, just forgot to actually update the last PR.
Commits
-------
3cd2eef6e6 Add placeholder support in bootstrap 4 file fields
This PR was squashed before being merged into the 4.2-dev branch (closes#27891).
Discussion
----------
[Finder] Allow arrays as parameters of some methods for better fluent experience and code readability
| 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 | symfony/symfony-docs#10038
Makes the Finder library a little more convenient to use by allowing the use of arrays as parameters of methods that can be called multiple times.
This way of doing things was already present for the `Finder::in()` and `Finder::exclude()` methods, it has been extended to other methods that can be called several times to cumulate their effects.
This allows a better use of fluent methods by avoiding breaking the chaining to iterate on array variables (a little more complexity in the Finder library for less complexity in applications that uses it).
```php
// we could use
$finder = Finder::create()->in($fileRepository)->name($fileList);
// instead of
$finder = Finder::create()->in($fileRepository);
foreach ($fileList as $file) {
$finder->name($file);
}
```
In `.php_cs` files, this would make the code more readable by separating the configuration of the execution code:
```php
<?php
const RULES = [
'@Symfony' => true,
'@Symfony:risky' => true,
];
const EXCLUDED_DIRS = [
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
'Symfony/Component/Cache/Tests/Marshaller/Fixtures',
'Symfony/Component/DependencyInjection/Tests/Fixtures',
// ...
];
const EXCLUDED_FILES = [
// file content autogenerated by `var_export`
'Symfony/Component/Translation/Tests/fixtures/resources.php',
// test template
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php',
// ...
];
return PhpCsFixer\Config::create()
->setRules(RULES)
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->append(array(__FILE__))
->exclude(EXCLUDED_DIRS)
->notPath(EXCLUDED_FILES)
)
;
```
TODO
- [x] complete the tests to validate the new syntax on all modified methods
- [x] submit changes to the Finder documentation
Commits
-------
ad97cd7121 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
`$dataClass` constructor argument of `FormConfigBuilder` obviously allows `null` as its value and it even has a `?string` typehint in `master` branch, so this fixes the PHPDoc typehint to match.
Commits
-------
9854a26981 [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
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.