Commit Graph

29843 Commits

Author SHA1 Message Date
Peter Rehm
de8106fea6 Further refactorings to PHPUnit namespaces 2017-02-21 09:32:25 +01:00
Fabien Potencier
3e9b8f3ba5 feature #21122 [ExpressionLanguage] Create an ExpressionFunction from a PHP function name (maidmaid)
This PR was squashed before being merged into the 3.3-dev branch (closes #21122).

Discussion
----------

[ExpressionLanguage] Create an ExpressionFunction from a PHP function name

| 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        | n/a

When we [extend Expression Language](http://symfony.com/doc/current/components/expression_language/extending.html), we often need to add PHP functions whose code is repetitive and redundant at the compiler/evaluator level. This PR proposes a new way more generic which allows to add a PHP function.

currently:

```php
$el = new ExpressionLanguage();
$compiler = function ($str) {
    return sprintf('strtoupper(%s)', $str);
};
$evaluator = function ($arguments, $str) {
    return strtoupper($str);
};
$el->addFunction(new ExpressionFunction('strtoupper', $compiler, $evaluator));
$el->evaluate('strtoupper("hello")'); // return "HELLO"
```

with this PR:

```php
$el->addFunction(ExpressionFunction::fromPhp('strtoupper'));
$el->evaluate('strtoupper("hello")'); // return "HELLO"
```

It includes PHP namespaced function:

```php
$el->addFunction(ExpressionFunction::fromPhp('My\strtoupper', 'my_strtoupper'));
$el->evaluate('my_strtoupper("hello")'); // return "HELLO"
```

Commits
-------

44d67ed5f5 [ExpressionLanguage] Create an ExpressionFunction from a PHP function name
2017-02-20 09:23:03 -08:00
Dany Maillard
44d67ed5f5 [ExpressionLanguage] Create an ExpressionFunction from a PHP function name 2017-02-20 09:23:01 -08:00
Fabien Potencier
f4db331478 minor #21676 [Serializer] Reduce complexity of NameConverter (gadelat)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Serializer] Reduce complexity of NameConverter

Cleaner and faster implementation of camelcase normalization.
Speed improvement is particularly visible in long string input.

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

50ca944278 [Serializer] Reduce complexity of NameConverter
2017-02-20 09:20:53 -08:00
Fabien Potencier
fd65bcccef minor #21662 add missing changelog for deprecated strict attribute (dbu)
This PR was merged into the 3.3-dev branch.

Discussion
----------

add missing changelog for deprecated strict attribute

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

since #21058, 3.3 triggers a deprecation when using the strict attribute. luckily wouter managed to find the reason and we figured out we can simply delete the attribute. having an upgrade file entry would make it easier to find the reason for the deprecation and be sure what to do. (assuming i understood the implications correctly)

Commits
-------

2c5f8797b8 add missing changelog for deprecated strict attribute
2017-02-20 09:04:18 -08:00
Fabien Potencier
0476eb52ed feature #21653 [VarDumper] Added a way to print or not comma separator and/or trailing comma (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[VarDumper] Added a way to print or not comma separator and/or trailing comma

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

---

Usecase: Be able to display a dump on one line.
It's already used in the following projets: https://github.com/bobthecow/psysh/blob/master/src/Psy/VarDumper/Dumper.php#L93-L95

Commits
-------

1ef07515c1 [VarDumper] Added a way to print or not comma separator and/or trailing comma
2017-02-20 09:01:40 -08:00
Fabien Potencier
f1cf0ad334 minor #21680 [FrameworkBundle] resolve parameters in definition classes (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] resolve parameters in definition classes

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21637#discussion_r101814478
| License       | MIT
| Doc PR        |

Commits
-------

37ce682947 resolve parameters in definition classes
2017-02-20 08:59:53 -08:00
Fabien Potencier
eb678a097a minor #21678 [Yaml] fix DUMP_EMPTY_ARRAY_AS_SEQUENCE flag value (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] fix DUMP_EMPTY_ARRAY_AS_SEQUENCE flag value

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

3953d76954 fix DUMP_EMPTY_ARRAY_AS_SEQUENCE flag value
2017-02-20 08:58:22 -08:00
Sébastien ALFAIATE
1337cdb03c [WebServerBundle] fixed html attribute escape 2017-02-20 16:51:35 +01:00
Nicolas Grekas
61d535332f minor #21687 Updated to PHPUnit namespaces (peterrehm)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Updated to PHPUnit namespaces

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

b84eb86 Updated to PHPUnit namespaces
2017-02-20 15:00:56 +01:00
Peter Rehm
b84eb86655 Updated to PHPUnit namespaces 2017-02-20 14:56:45 +01:00
Nicolas Grekas
56642c4b3d Merge branch '3.2'
* 3.2:
  Updated PHPUnit namespaces
  Add missing conflict rules for phpunit
2017-02-20 14:49:17 +01:00
Nicolas Grekas
13983d986b minor #21686 Updated PHPUnit namespaces (peterrehm)
This PR was merged into the 3.2 branch.

Discussion
----------

Updated PHPUnit namespaces

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

Follow Up of #21663

Commits
-------

c2e80e3 Updated PHPUnit namespaces
2017-02-20 14:45:48 +01:00
Nicolas Grekas
3d4e163ddb Merge branch '2.8' into 3.2
* 2.8:
  Add missing conflict rules for phpunit
2017-02-20 14:40:00 +01:00
Nicolas Grekas
f9f53b2487 Merge branch '2.7' into 2.8
* 2.7:
  Add missing conflict rules for phpunit
2017-02-20 14:37:30 +01:00
Nicolas Grekas
347f529206 minor #21684 Add missing conflict rules for phpunit (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Add missing conflict rules for phpunit

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

We forgot them in #21564

Commits
-------

3e83e02 Add missing conflict rules for phpunit
2017-02-20 14:37:10 +01:00
Peter Rehm
c2e80e3b8b Updated PHPUnit namespaces 2017-02-20 14:34:33 +01:00
Nicolas Grekas
3e83e02f2c Add missing conflict rules for phpunit 2017-02-20 13:48:07 +01:00
Nicolas Grekas
2f20a6ceea Merge branch '3.2'
* 3.2:
  Updated PHPUnit namespaces
2017-02-20 13:38:57 +01:00
Nicolas Grekas
95f30de91d Merge branch '2.8' into 3.2
* 2.8:
  Updated PHPUnit namespaces
2017-02-20 13:38:41 +01:00
Nicolas Grekas
f2754ebe53 minor #21663 Updated PHPUnit namespaces (peterrehm)
This PR was squashed before being merged into the 2.8 branch (closes #21663).

Discussion
----------

Updated PHPUnit namespaces

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

Follow Up of #21564

Commits
-------

205ced4 Updated PHPUnit namespaces
2017-02-20 13:35:45 +01:00
Peter Rehm
205ced409b Updated PHPUnit namespaces 2017-02-20 13:35:43 +01:00
David Maicher
ad59370241 [DoctrineBridge] Fixed validating custom doctrine type columns 2017-02-20 11:38:35 +01:00
Grégoire Pineau
1ef07515c1 [VarDumper] Added a way to print or not comma separator and/or trailing comma
Usecase: Be able to display a dump on one line.
It's already used in the following projets: https://github.com/bobthecow/psysh/blob/master/src/Psy/VarDumper/Dumper.php#L93-L95
2017-02-20 11:13:52 +01:00
Christian Flothmann
37ce682947 resolve parameters in definition classes 2017-02-20 09:01:13 +01:00
Christian Flothmann
dcd19f3cf9 fix priority ordering of security voters 2017-02-20 08:38:24 +01:00
Christian Flothmann
3953d76954 fix DUMP_EMPTY_ARRAY_AS_SEQUENCE flag value 2017-02-20 07:42:42 +01:00
Fabien Potencier
5037c2adbd Merge branch '3.2'
* 3.2:
  [Serializer] Removed duplicate operation in camelcase denormalization
  [Validator] do not guess getter method names
2017-02-19 16:48:52 -08:00
Fabien Potencier
8b0b2604f7 Merge branch '2.8' into 3.2
* 2.8:
  [Serializer] Removed duplicate operation in camelcase denormalization
  [Validator] do not guess getter method names
2017-02-19 16:48:41 -08:00
Fabien Potencier
3616d5e34f Merge branch '2.7' into 2.8
* 2.7:
  [Serializer] Removed duplicate operation in camelcase denormalization
  [Validator] do not guess getter method names
2017-02-19 16:48:26 -08:00
Fabien Potencier
50324777bf minor #21677 [Serializer] Removed duplicate operation in camelcase denormalization (gadelat)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21677).

Discussion
----------

[Serializer] Removed duplicate operation in camelcase denormalization

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

32fcd91397 [Serializer] Removed duplicate operation in camelcase denormalization
2017-02-19 15:30:59 -08:00
Gabriel Ostrolucký
32fcd91397 [Serializer] Removed duplicate operation in camelcase denormalization 2017-02-19 15:30:59 -08:00
Fabien Potencier
cf91b0af22 feature #21471 [Yaml] Allow dumping empty array as YAML sequence (c960657)
This PR was squashed before being merged into the 3.3-dev branch (closes #21471).

Discussion
----------

[Yaml] Allow dumping empty array as YAML sequence

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

PHP arrays are dumped as either YAML sequences or mappings, depending on whether the array has continuos integer keys or not.

An empty array is always dumped as a YAML mapping. Sometimes you want it dumped as a YAML sequence instead.

Commits
-------

87ffaf2b77 Bump version number
af7067c3cf Dump empty object as mapping
a6d94c1b53 [Yaml] Allow dumping empty array as YAML sequence
2017-02-19 15:22:09 -08:00
Fabien Potencier
6d77cdfd65 feature #21478 [Asset] Add support for preloading with links and HTTP/2 push (dunglas)
This PR was squashed before being merged into the 3.3-dev branch (closes #21478).

Discussion
----------

[Asset] Add support for preloading with links and HTTP/2 push

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

Allows compatible clients to preload mandatory assets like scripts, stylesheets or images according to [the "preload" working draft of the W3C](https://www.w3.org/TR/preload/).
Thanks to this PR, Symfony will automatically adds `Link` HTTP headers with a `preload` relation for mandatory assets.  If an intermediate proxy supports HTTP/2 push, it will convert preload headers. For instance [Cloudflare supports this feature](https://blog.cloudflare.com/using-http-2-server-push-with-php/).

It dramatically increases pages speed and make the web greener because only one TCP connection is used to fetch all mandatory assets (decrease servers and devices loads, improve battery lives).

Usage:

Updated version:

```html
<html>
    <body>
    Hello
    <script src="{{ preload(asset('/scripts/foo.js'), 'script') }}"></script>
    </body>
</html>
```

~~First proposal:~~

```html
<html>
    <body>
    Hello
    <script src="{{ preloaded_asset('/scripts/foo.js', 'script') }}"></script>
    </body>
</html>
```

- [x] Add tests

Commits
-------

7bab21700d [Asset] Add support for preloading with links and HTTP/2 push
2017-02-19 14:57:15 -08:00
Kévin Dunglas
7bab21700d [Asset] Add support for preloading with links and HTTP/2 push 2017-02-19 14:56:07 -08:00
Fabien Potencier
eb0ffaaee7 bug #21115 [Validator] do not guess getter method names (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] do not guess getter method names

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #5219, #18700
| License       | MIT
| Doc PR        | TODO

Commits
-------

bd3a90a0c3 [Validator] do not guess getter method names
2017-02-19 14:49:47 -08:00
Fabien Potencier
4abd0c6fcf feature #20632 [FrameworkBundle] Make use of stderr for non reliable output (chalasr, ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Make use of stderr for non reliable output

| 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        | n/a

Built-in commands should make use of the proper outputs.
As a feature on master, considering that people may actually rely on stdout and the fact commands have been changed a lot since 2.7, I think it's not worth doing this change on lower branches.

Please see also #20586 which adds a `SymfonyStyle::getErrorStyle()` shortcut for easily switching to stderr.

Commits
-------

7b262d8c29 [FrameworkBundle] Use getErrorStyle() when relevant
9a3a5686c8 Use stderr for some other commands
1ee48bfd60 [FrameworkBundle] Make use of stderr for non reliable output
2017-02-19 14:38:27 -08:00
Fabien Potencier
a399e7594b Merge branch '3.2'
* 3.2:
  [DependencyInjection] Fix using autowiring types when there are more than 2 services
  [DependencyInjection] Fix autowiring collisions detection
  [DI] Bug in autowiring collisions detection
2017-02-19 14:20:06 -08:00
Fabien Potencier
043c9ad7ef Merge branch '2.8' into 3.2
* 2.8:
  [DependencyInjection] Fix using autowiring types when there are more than 2 services
  [DependencyInjection] Fix autowiring collisions detection
  [DI] Bug in autowiring collisions detection
2017-02-19 14:13:25 -08:00
Gabriel Ostrolucký
50ca944278 [Serializer] Reduce complexity of NameConverter
Cleaner and faster implementation of camelcase normalization.
Speed improvement is particularly visible in long string input.
2017-02-19 23:03:20 +01:00
Fabien Potencier
3f5c0b1976 bug #21670 [DependencyInjection] Fix autowiring types when there are more than 2 services colliding (GuilhemN)
This PR was merged into the 2.8 branch.

Discussion
----------

[DependencyInjection] Fix autowiring types when there are more than 2 services colliding

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

There is a bug in the `AutowirePass`, when using more than 2 services colliding and you want to use the autowiring types: it may not work depending on their order because `notGuessableTypes` is not reset.

Commits
-------

5981278537 [DependencyInjection] Fix using autowiring types when there are more than 2 services
2017-02-19 09:43:44 -08:00
Fabien Potencier
3cfd04bd18 bug #21665 [DependencyInjection] Fix autowiring collisions detection (nicolas-grekas, GuilhemN)
This PR was merged into the 2.8 branch.

Discussion
----------

[DependencyInjection] Fix autowiring collisions detection

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

Fixes https://github.com/symfony/symfony/pull/21658 by implementing the second proposal of https://github.com/symfony/symfony/pull/21658#issuecomment-280858452:
> Another idea: store the types used previously and check that new services registered don't implement them.

Commits
-------

bb70472dce [DependencyInjection] Fix autowiring collisions detection
6f578ee514 [DI] Bug in autowiring collisions detection
2017-02-19 08:09:57 -08:00
Fabien Potencier
64ec5c5faf feature #21664 [Console] simplify the implementation of SymfonyStyle::comment() (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] simplify the implementation of SymfonyStyle::comment()

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

Commits
-------

2321491d3f [Console] simplify the implementation of SymfonyStyle::comment()
2017-02-19 06:39:30 -08:00
Guilhem Niot
5981278537
[DependencyInjection] Fix using autowiring types when there are more than 2 services 2017-02-19 12:40:30 +01:00
Guilhem Niot
bb70472dce
[DependencyInjection] Fix autowiring collisions detection 2017-02-18 21:00:29 +01:00
Fabien Potencier
42de1453e8 fixed Composer constraints 2017-02-18 11:16:58 -08:00
Fabien Potencier
85e5ef748b Merge branch '3.2'
* 3.2:
  fixed Composer constraints
  fixed Composer constraints
  fixed Composer constraints
2017-02-18 11:16:44 -08:00
Fabien Potencier
86eb217de7 fixed Composer constraints 2017-02-18 11:15:38 -08:00
Fabien Potencier
d6ffc73ced Merge branch '2.8' into 3.2
* 2.8:
  fixed Composer constraints
  fixed Composer constraints
2017-02-18 11:14:26 -08:00
Fabien Potencier
0e1596df25 fixed Composer constraints 2017-02-18 11:13:35 -08:00