Commit Graph

38245 Commits

Author SHA1 Message Date
Nicolas Grekas
b959d8594c feature #28218 Improve support for anonymous classes (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Improve support for anonymous classes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Before:
![image](https://user-images.githubusercontent.com/243674/44276933-5c522600-a249-11e8-8bcc-6d55c9fa5a5e.png)

After:
![image](https://user-images.githubusercontent.com/243674/44276912-4cd2dd00-a249-11e8-943f-b6b0d0eb8908.png)

Same in other places, e.g. Console failures.

Commits
-------

e41ced2bfd Improve support for anonymous classes
2018-08-24 12:03:22 +02:00
Nicolas Grekas
771463123a cs fix 2018-08-24 12:01:11 +02:00
Nicolas Grekas
f03a54ed51 feature #28221 [DomCrawler] Add a way to filter direct children (Einenlum)
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
2018-08-24 12:00:10 +02:00
Einenlum
f634afdb6f [DomCrawler] Add a way to filter direct children 2018-08-24 11:59:58 +02:00
Nicolas Grekas
e18bf6eee0 bug #28220 [PropertyAccess] fix type error handling when writing values (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyAccess] fix type error handling when writing values

| 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
-------

45754515a5 fix type error handling when writing values
2018-08-24 11:57:25 +02:00
Nicolas Grekas
d8e2af32d8 feature #28234 [DI] Allow autowiring by type + parameter name (nicolas-grekas)
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
2018-08-24 11:56:33 +02:00
Nicolas Grekas
8860b6691c bug #28249 [Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses (nicolas-grekas)
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
2018-08-24 11:47:29 +02:00
Nicolas Grekas
d446b6aefb bug #28252 [DoctrineBridge] support __toString as documented for UniqueEntityValidator (dmaicher)
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
2018-08-24 11:45:48 +02:00
David Maicher
2ac883a99b [DoctrineBridge] support __toString as documented for UniqueEntityValidator 2018-08-24 11:45:42 +02:00
Nicolas Grekas
a682051ecf minor #28255 [travis] enable Redis cluster (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[travis] enable Redis cluster

| 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        | -

Will allow testing https://github.com/symfony/symfony/pull/28251 also

Commits
-------

f245df404f [travis] enable Redis cluster
2018-08-24 11:40:22 +02:00
Nicolas Grekas
f245df404f [travis] enable Redis cluster 2018-08-24 11:22:31 +02:00
Nicolas Grekas
8b59d177db [Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses 2018-08-23 17:04:29 +02:00
Nicolas Grekas
c0b8f53bcb [DI] Allow autowiring by type + parameter name 2018-08-23 11:47:19 +02:00
Nicolas Grekas
92953485a5 [HttpKernel] fix forwarding trusted headers as server parameters 2018-08-22 17:45:23 +02:00
Nicolas Grekas
7b4e5cc50b Don't "replace" symfony/contracts 2018-08-22 08:18:58 +02:00
Nicolas Grekas
e41ced2bfd Improve support for anonymous classes 2018-08-21 14:03:16 +02:00
Nicolas Grekas
6a4de22787 bug #28228 [Validator] Fix precision issue regarding floats and DivisibleBy constraint (apfelbox)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Validator] Fix precision issue regarding floats and DivisibleBy constraint

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Alternative to #28212

Commits
-------

ae04b48332 [Validator] Fix precision issue regarding floats and DivisibleBy constraint
2018-08-21 13:54:23 +02:00
Jannik Zschiesche
ae04b48332 [Validator] Fix precision issue regarding floats and DivisibleBy constraint 2018-08-20 16:30:22 +02:00
Fabien Potencier
0332f861c6 minor #28230 [Form] fix data mapper return type in docblock (xabbuh)
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
2018-08-20 13:41:49 +02:00
Christian Flothmann
5bdc755d73 fix data mapper return type in docblock 2018-08-19 18:51:04 +02:00
Nicolas Grekas
2df7320c1c bug #28188 [Cache] make PhpMarshaller handle hard references (nicolas-grekas)
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
2018-08-19 18:15:21 +02:00
Nicolas Grekas
df5525ff5f Merge branch '4.1'
* 4.1:
  [travis] fix composer.lock invalidation for PRs patching several components
2018-08-19 14:59:13 +02:00
Nicolas Grekas
0874f7098f Merge branch '3.4' into 4.1
* 3.4:
  [travis] fix composer.lock invalidation for PRs patching several components
2018-08-19 14:58:11 +02:00
Nicolas Grekas
817e7cdfaa Merge branch '2.8' into 3.4
* 2.8:
  [travis] fix composer.lock invalidation for PRs patching several components
2018-08-19 14:57:58 +02:00
Nicolas Grekas
48c531c09a [travis] fix composer.lock invalidation for PRs patching several components 2018-08-19 14:57:42 +02:00
Fabien Potencier
2d7aedba6e feature #28156 [Serializer] Fix the XML comments encoding (maidmaid)
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
2018-08-19 13:10:28 +02:00
Dany Maillard
d94a37f395 Allow to encode xml comments 2018-08-19 12:41:43 +02:00
Nicolas Grekas
71794f4fc4 Merge branch '4.1'
* 4.1:
  minor fix for travis
2018-08-19 10:49:24 +02:00
Nicolas Grekas
80bfead57f Merge branch '3.4' into 4.1
* 3.4:
  minor fix for travis
2018-08-19 10:49:19 +02:00
Nicolas Grekas
b08dcfc88d Merge branch '2.8' into 3.4
* 2.8:
  minor fix for travis
2018-08-19 10:49:14 +02:00
Nicolas Grekas
13a5101502 minor fix for travis 2018-08-19 10:49:05 +02:00
Nicolas Grekas
c42b609e2e minor fix for travis 2018-08-19 10:41:17 +02:00
Nicolas Grekas
3063c62bba Merge branch '4.1'
* 4.1:
  [travis] fix composer.lock invalidation for deps=low
  [Security\Http] Restore laziness of listener iterator
  Make the `message_bus` alias public
2018-08-19 10:17:45 +02:00
Nicolas Grekas
cd14b22f18 Merge branch '3.4' into 4.1
* 3.4:
  [travis] fix composer.lock invalidation for deps=low
  [Security\Http] Restore laziness of listener iterator
2018-08-19 10:16:41 +02:00
Nicolas Grekas
6bab0c10bb Merge branch '2.8' into 3.4
* 2.8:
  [travis] fix composer.lock invalidation for deps=low
2018-08-19 10:16:24 +02:00
Nicolas Grekas
68c00ad69d minor #28227 [travis] fix composer.lock invalidation for deps=low (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[travis] fix composer.lock invalidation for deps=low

| 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        | -

Currently, tests for master on Travis fail for deps=low because an old commit is installed for the `symfony/security-http` depenceny of `SecurityBundle`. The reason is that composer.lock files are cached, but the invalidation logic misses checking the latest valid git commit.
This fixes it.

Commits
-------

02e3ec0539 [travis] fix composer.lock invalidation for deps=low
2018-08-19 10:15:42 +02:00
Nicolas Grekas
02e3ec0539 [travis] fix composer.lock invalidation for deps=low 2018-08-19 10:12:54 +02:00
Fabien Potencier
33ce02e048 minor #28127 [WebProfilerBundle] Remove useless macro arguments (gregurco)
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
2018-08-19 08:38:07 +02:00
Fabien Potencier
a09809b752 bug #28216 [FrameworkBundle] message_bus alias public (sroze)
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
2018-08-19 08:21:14 +02:00
Robin Chalas
2c863c6545 minor #28224 [Security\Http] Restore laziness of listener iterator (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security\Http] Restore laziness of listener iterator

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no (never released)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Alternative to #28223

Restores laziness that I broke in merge commit 2dedacbc04 (diff-31ca8a8ce837591218082b00363149fc)

Commits
-------

2ebc75b [Security\Http] Restore laziness of listener iterator
2018-08-18 23:44:23 +02:00
Nicolas Grekas
2ebc75b9a1 [Security\Http] Restore laziness of listener iterator 2018-08-18 22:38:48 +02:00
Nicolas Grekas
1c248e572e Merge branch '4.1'
* 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
2018-08-18 18:57:16 +02:00
Nicolas Grekas
ff93f1ab2a fix merge 2018-08-18 18:54:38 +02:00
Nicolas Grekas
2dedacbc04 Merge branch '3.4' into 4.1
* 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
2018-08-18 18:52:46 +02:00
Nicolas Grekas
d351daab04 Merge branch '2.8' into 3.4
* 2.8:
  [travis][appveyor] use symfony/flex to accelerate builds
  [Security] Call AccessListener after LogoutListener
2018-08-18 18:47:20 +02:00
Fabien Potencier
1d76f98e28 minor #28199 [travis][appveyor] use symfony/flex to accelerate builds (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[travis][appveyor] use symfony/flex to accelerate builds

| 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        | -

Playing with https://github.com/symfony/flex/pull/409

The optimization is required because appveyor is transiently failing with OOM errors, see e.g.
https://ci.appveyor.com/project/fabpot/symfony/build/1.0.39377

Commits
-------

940ec8f2d5 [travis][appveyor] use symfony/flex to accelerate builds
2018-08-18 18:26:55 +02:00
Nicolas Grekas
940ec8f2d5 [travis][appveyor] use symfony/flex to accelerate builds 2018-08-18 18:09:18 +02:00
Fabien Potencier
662548f553 minor #28219 Removed dead code in Kernel (kevin-biig)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Removed dead code in Kernel

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

While navigating in `src/Symfony/Component/HttpKernel/Kernel` I saw some **dead** codes.

Commits
-------

91d72a67c8 Removed dead code in Kernel
2018-08-18 17:55:22 +02:00
Gabriel Ostrolucký
097c3f82a7 [WebProfilerBundle] Limit width of toolbar item 2018-08-17 22:29:17 +02:00
Christian Flothmann
45754515a5 fix type error handling when writing values 2018-08-17 19:56:06 +02:00