This PR was merged into the 4.2-dev branch.
Discussion
----------
Mock date() in ClockMock
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no (In case `date()` is mocked in some other way execution would fail because of redeclaration. Could be avoided with an extra `function_exists()` check. WDYT?)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
As to the [PHP documentation](https://secure.php.net/manual/en/function.date.php) `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.
BTW: The msec part of `microtime()` has 8 fractional digits on my system, ClockMock returns only 6...
Commits
-------
e8ba79adb9 [Bridge/PhpUnit] Mock date() in ClockMock
* 4.1:
[DoctrineBridge] support __toString as documented for UniqueEntityValidator
[travis] enable Redis cluster
[Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses
fix data mapper return type in docblock
fix type error handling when writing values
* 3.4:
[DoctrineBridge] support __toString as documented for UniqueEntityValidator
[travis] enable Redis cluster
[Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses
fix data mapper return type in docblock
fix type error handling when writing values
This PR was squashed before being merged into the 4.2-dev branch (closes#28221).
Discussion
----------
[DomCrawler] Add a way to filter direct children
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28171
| License | MIT
| Doc PR | -
The Dom-Crawler component only has a `filter()` method (to filter the node and all its children) and a `children()` method to return direct children.
**There is currently no way to easily filter (thanks to a selector) the direct children of a node, like jQuery allows so (with a selector passed to the `.children([selector])` method).**
**This PR adds a way to optionally filter direct children thanks to a CSS selector**. Here is an example of the usage:
```php
$html = <<<'HTML'
<html>
<body>
<div id="foo">
<p class="lorem" id="p1"></p>
<p class="lorem" id="p2"></p>
<div id="nested">
<p class="lorem" id="p3"></p>
</div>
</div>
</body>
</html>
HTML;
$crawler = new Crawler($html);
$foo = $crawler->filter('#foo');
$foo->children() // will select `#p1`, `#p2` and `#nested`
$foo->children('p') // will select `#p1` and `p2`
$foo->children('.lorem') // will select `#p1` and `p2`
```
This PR adds only an optional parameter and adds no BC break.
Commits
-------
f634afdb6f [DomCrawler] Add a way to filter direct children
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] Allow autowiring by type + parameter name
| 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/issues/10206
In #27165, we introduced the possibility to bind by type+name:
```yaml
bind:
Psr\Log\LoggerInterface $myLogger: @monolog.logger.my_logger
```
But we forgot about aliases. For consistency, they could and should allow doing the same. More importantly, this will open up interesting use cases where bundles could provide default values for typed+named arguments (using the new `ContainerBuilder::registerAliasForArgument()` method). E.g:
```yaml
services:
Psr\Cache\CacheItemPoolInterface $appCacheForecast: @app.cache.forecast
```
Works also for controller actions and service subscribers (using the real service id as the key).
Commits
-------
c0b8f53bcb [DI] Allow autowiring by type + parameter name
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28248
| License | MIT
| Doc PR | -
As described in https://github.com/php-memcached-dev/php-memcached/issues/24 and because we enable the binary protocol by default.
Commits
-------
8b59d177db [Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses
This PR was squashed before being merged into the 3.4 branch (closes#28252).
Discussion
----------
[DoctrineBridge] support __toString as documented for UniqueEntityValidator
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28245
| License | MIT
| Doc PR | -
This fixes https://github.com/symfony/symfony/issues/28245.
It brings back handling `__toString` as documented for invalid values.
Commits
-------
2ac883a99b [DoctrineBridge] support __toString as documented for UniqueEntityValidator
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] fix data mapper return type in docblock
| 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
-------
5bdc755d73 fix data mapper return type in docblock
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] make PhpMarshaller handle hard references
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR makes the interface and behavior of `PhpMarshaller` cleaner and bullet-proof.
While a bug fix at this stage, I'd like to propose splitting it to a new `VarExporter` component all goes well.
Commits
-------
bc5d208584 [Cache] make PhpMarshaller handle hard references
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Serializer] Fix the XML comments encoding
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | /
| License | MIT
| Doc PR | /
When we decode a XML comment, we get `['#comment' => ' foo ']`. But when we encode this same content, the result is not the expected one.
```php
$encoder->encode(['#comment' => ' foo '], 'xml');
```
```
Expected:
<response>
<!-- foo -->
</response>
Actual:
<response>
<item key="#comment"> foo </item>
</response>
```
Commits
-------
d94a37f395 Allow to encode xml comments
This PR was merged into the 4.2-dev branch.
Discussion
----------
[WebProfilerBundle] Remove useless macro arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I was digging into the Stopwatch Component and the part of displaying timeline in WebProfilerBundle and found some useless arguments in macro. The code was changed but arguments were abandoned.
Where the problem appeared: bfcc5e7392 (diff-3651d31bd302da5c7c1ef927e8641c78L294)
Commits
-------
70498dbeae [WebProfilerBundle] remove useless macro arguments
This PR was merged into the 4.1 branch.
Discussion
----------
[FrameworkBundle] `message_bus` alias public
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28215
| License | MIT
| Doc PR | ø
Because it is used in the `ControllerTrait` with `get('message_bus')`... same than for `security.csrf.token_manager` and cie, it should be public.
Commits
-------
51b6e9eb96 Make the `message_bus` alias public
* 4.1:
fix merge
[travis][appveyor] use symfony/flex to accelerate builds
Add missing stderr redirection
clean up unused code
Remove the HTML5 validation from the profiler URL search form
[Filesystem] Add test to prevent regression when using array|resource with dumpFile
Add help texts for checkboxes in horizontal bootstrap 4 forms
[Security] Call AccessListener after LogoutListener
* 3.4:
[travis][appveyor] use symfony/flex to accelerate builds
Add missing stderr redirection
clean up unused code
[Filesystem] Add test to prevent regression when using array|resource with dumpFile
[Security] Call AccessListener after LogoutListener
This PR was squashed before being merged into the 4.2-dev branch (closes#28069).
Discussion
----------
[Validator] New `DivisibleBy` constraint for testing divisibility
This introduces a new ~`MultipleOf`~ `DivisibleBy` constraint which checks whether one number is a multiple of (aka "divisible by") some other number. Useful for enforcing specific increments on a number.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10121
See https://github.com/symfony/symfony-docs/pull/10121 for examples of this constraint in action.
Commits
-------
efcfb8b22d [Validator] New `DivisibleBy` constraint for testing divisibility
This PR was merged into the 3.4 branch.
Discussion
----------
[PhpUnitBridge] Add missing stderr redirection
| 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 seems to have been overlooked in
6c0e6af47a, and results in the test suite
being polluted on machines where phpdbg is not installed.
I updated the code to mimic other occurences of exec in this file.
Commits
-------
d67b86b9e7 Add missing stderr redirection