Commit Graph

38551 Commits

Author SHA1 Message Date
Nicolas Grekas
443bd119b1 [VarExporter] fix more edge cases 2018-09-11 10:35:53 +02:00
Nicolas Grekas
b2718d7666 Remove all usages of call_user_func_array() 2018-09-11 09:53:26 +02:00
Robin Chalas
86a5d92ce7 minor #28409 [Console] Document what is validated before and after Command::initialize() (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] Document what is validated before and after Command::initialize()

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

Commits
-------

b1aff99 [Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions
2018-09-10 19:22:51 +02:00
Nicolas Grekas
444e7b9886 bug #28396 [Intl] Blacklist Eurozone and United Nations in Region Data Generator (gregurco)
This PR was merged into the 2.8 branch.

Discussion
----------

[Intl] Blacklist Eurozone and United Nations in Region Data Generator

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

Commits
-------

e2e4049721 [Intl] Blacklist Eurozone and United Nations in Region Data Generator
2018-09-10 18:51:10 +02:00
Samuel ROZE
a3e6e8300c bug #28418 [FrameworkBundle] Register the messenger data collector only when the profiler is enabled (pierredup)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] Register the messenger data collector only when the profiler is enabled

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28350
| License       | MIT
| Doc PR        | N/A

The data collector for the messenger is currently unconditionally registered, which causes increased memory usage even in production. Instead, it should only be registered along with the rest of the data collectors only when the profiler is enabled

Commits
-------

bd3a66bc59 Register the messenger data collector only when the profiler is enabled
2018-09-10 12:40:37 +02:00
Nicolas Grekas
deae538245 feature #28422 [VarExporter] throw component-specific exceptions (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] throw component-specific exceptions

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

This makes "serializing/unserializing" with the component diverge a bit from native serialize/unserialize (wich can throw plain "Exception" instances), but I think we should still do it.

Commits
-------

2c444927bc [VarExporter] throw component-specific exceptions
2018-09-10 11:27:28 +02:00
Robin Chalas
b1aff9993c [Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions 2018-09-10 11:03:26 +02:00
Robin Chalas
0417d6caad bug #28393 [Console] fixed corrupt error output for unknown multibyte short option (downace)
This PR was squashed before being merged into the 2.8 branch (closes #28393).

Discussion
----------

[Console] fixed corrupt error output for unknown multibyte short option

| Q             | A
| ------------- | ---
| Branch?       | 2.8 <!-- see below -->
| 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 | #28320   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

[Console] Fixed #28320 by using mb_substr instead of index access
<!--
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.
-->

Commits
-------

0f86156 [Console] fixed corrupt error output for unknown multibyte short option
2018-09-10 10:47:57 +02:00
downace
0f861568aa [Console] fixed corrupt error output for unknown multibyte short option 2018-09-10 10:47:50 +02:00
Nicolas Grekas
2c444927bc [VarExporter] throw component-specific exceptions 2018-09-10 10:23:43 +02:00
Fabien Potencier
ed5ddf9c39 feature #28415 [FrameworkBundle] Deprecate ContainerAwareCommand (chalasr)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate ContainerAwareCommand

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/10307

Follow up of the recent `Controller` deprecation.

I think people are widely used to register their commands as services and use proper dependency injection, we made the move for core commands in 3.4, let's deprecate `ContainerAwareCommand` for 4.2.

Commits
-------

744bf0e7ac [FrameworkBundle] Deprecate ContainerAwareCommand
2018-09-10 10:18:44 +02:00
Robin Chalas
744bf0e7ac [FrameworkBundle] Deprecate ContainerAwareCommand 2018-09-10 10:14:57 +02:00
Fabien Potencier
1c759a1719 minor #28374 [Console] fixed PHPDoc for setArgument/setOption in InputInterface (liarco)
This PR was squashed before being merged into the 2.8 branch (closes #28374).

Discussion
----------

[Console] fixed PHPDoc for setArgument/setOption in InputInterface

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

Methods now accept a value of any type except objects not implementing __toString().

**Example use case:** when using array arguments/options I can't set them programmatically without getting errors about type mismatch (from the IDE). With this patch it now works as expected.

Commits
-------

61529f3cd7 [Console] fixed PHPDoc for setArgument/setOption in InputInterface
2018-09-10 10:11:29 +02:00
Marco Lipparini
61529f3cd7 [Console] fixed PHPDoc for setArgument/setOption in InputInterface 2018-09-10 10:11:22 +02:00
Fabien Potencier
766a82bddf feature #28419 [Messenger] Change AmqpExt classes constructor signature (fabpot)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Change AmqpExt classes constructor signature

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| 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

This pull requests does 2 things:

 * It makes `Connection` a first argument of AmqpExt classes. I think it makes sense as this is the most important argument for those classes.

 * As the `Serializer` is now a second argument, I propose to make it optional and use the default serializer that we've added recently if `null` (`Serializer::create()`)

It makes the component even more user friendly when not using Symfony full stack (and provide good defaults).

Commits
-------

2d55ae5212 [Messenger] changed AmqpExt classes constructor signature
2018-09-10 09:51:35 +02:00
Fabien Potencier
05410c5a63 minor #28398 Remove usage of backticks in exception messages (fabpot)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Remove usage of backticks in exception messages

| 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 | n/a
| License       | MIT
| Doc PR        | n/a

Exception messages are not formatted in Markdown, so let's use `"` instead everywhere for more consistency.

Commits
-------

e5bb5e24bd removed usage of backticks in exception messages
2018-09-10 09:45:50 +02:00
Fabien Potencier
e5bb5e24bd removed usage of backticks in exception messages 2018-09-10 09:26:34 +02:00
Fabien Potencier
2d55ae5212 [Messenger] changed AmqpExt classes constructor signature 2018-09-10 08:21:34 +02:00
Pierre du Plessis
bd3a66bc59
Register the messenger data collector only when the profiler is enabled 2018-09-10 08:11:11 +02:00
Fabien Potencier
0cd1da66d7 feature #28405 [Messenger] Uses a messenger serializer, not an individual encoder/decoder (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Uses a messenger serializer, not an individual encoder/decoder

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

Makes the component-based even simpler.

**Before**
```php
        $encoderDecoder = Serializer::create();
        $middleware = [new SendMessageMiddleware(new SenderLocator([
            Message::class => new AmqpTransport($encoderDecoder, $encoderDecoder, $connection),
        ]))];
```

**After**
```php
       $middleware = [new SendMessageMiddleware(new SenderLocator([
            Message::class => new AmqpTransport(Serializer::create(), $connection),
        ]))];
```

Commits
-------

5b93f5f45e Uses a messenger serializer, not an individual encoder/decoder
2018-09-10 08:01:02 +02:00
Nicolas Grekas
3b931fe6c9 bug #28414 [VarExporter] fix exporting final serializable classes extending internal ones (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] fix exporting final serializable classes extending internal ones

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

Another edge case, discovered while reading https://github.com/doctrine/instantiator/issues/39

Commits
-------

a5bf9b0445 [VarExporter] fix exporting final serializable classes extending internal ones
2018-09-09 23:08:05 +02:00
Nicolas Grekas
2c428d130d [FrameworkBundle] bind "ContainerInterface $parameterBag" arguments to the "parameter_bag" service 2018-09-09 21:29:59 +02:00
kevin.nadin
f75fffa997 Trigger deprecation notices when inherited class calls parent method but misses adding new arguments 2018-09-09 20:06:02 +02:00
Nicolas Grekas
a5bf9b0445 [VarExporter] fix exporting final serializable classes extending internal ones 2018-09-09 17:25:49 +02:00
Vlad Gregurco
e2e4049721 [Intl] Blacklist Eurozone and United Nations in Region Data Generator 2018-09-09 13:16:33 +02:00
Samuel ROZE
5b93f5f45e Uses a messenger serializer, not an individual encoder/decoder 2018-09-09 11:28:13 +01:00
Nicolas Grekas
1a46605746 feature #28298 [WebServerBundle] Add support for Xdebug's Profiler (maidmaid)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[WebServerBundle] Add support for Xdebug's Profiler

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

> Xdebug's Profiler is a powerful tool that gives you the ability to analyze your PHP code and determine bottlenecks or generally see which parts of your code are slow and could use a speed boost.

https://xdebug.org/docs/profiler

When we run/start the web server, it would be useful to enable the trigger for the Xdebug's Profiler. That means we could easily trigger the creation of a Xdebug profile and analysing it [thanks to PhpStorm](https://www.jetbrains.com/help/phpstorm/analyzing-xdebug-profiling-data.html) which provides an **Execution Statistics** panel (examine the summary information about execution metrics of every called function) and a **Call Tree** panel (explore the execution paths of all called functions). You can see these two panels in action [here](https://youtu.be/_ua_O01IICg?t=1m22s) for a better understanding.

Commits
-------

0f4c0a6eaf Add support for Xdebug Profiler
2018-09-09 11:51:19 +02:00
Dany Maillard
0f4c0a6eaf Add support for Xdebug Profiler 2018-09-09 11:48:27 +02:00
Nicolas Grekas
d4e1cd9869 Merge branch '4.1'
* 4.1:
  [Debug] fix detecting overriden final/internal methods implemented using traits
  [Controller][ServiceValueResolver] Making method access case insensitive
2018-09-09 11:23:23 +02:00
Nicolas Grekas
92a22b02d3 Merge branch '3.4' into 4.1
* 3.4:
  [Debug] fix detecting overriden final/internal methods implemented using traits
  [Controller][ServiceValueResolver] Making method access case insensitive
2018-09-09 11:23:09 +02:00
Nicolas Grekas
90e79450d3 bug #28411 [Debug] fix detecting overriden final/internal methods implemented using traits (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] fix detecting overriden final/internal methods implemented using traits

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

Commits
-------

d638237f09 [Debug] fix detecting overriden final/internal methods implemented using traits
2018-09-09 11:20:33 +02:00
Nicolas Grekas
be05bbf4b7 bug #28404 [Controller][ServiceValueResolver] Making method access case insensitive (nicoweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Controller][ServiceValueResolver] Making method access case insensitive

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

Fix #28254 by making the method access insensitive in `ServiceValueResolver`.

Commits
-------

cc6f82769b [Controller][ServiceValueResolver] Making method access case insensitive
2018-09-09 11:18:43 +02:00
Nicolas Grekas
d638237f09 [Debug] fix detecting overriden final/internal methods implemented using traits 2018-09-09 11:07:24 +02:00
Robin Chalas
344b8cee42 Merge branch '4.1'
* 4.1:
  [Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default
2018-09-08 21:04:21 +02:00
Robin Chalas
492eb5fe24 Merge branch '3.4' into 4.1
* 3.4:
  [Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default
2018-09-08 21:04:07 +02:00
Robin Chalas
49992c5dfb Merge branch '2.8' into 3.4
* 2.8:
  [Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default
2018-09-08 21:02:09 +02:00
Robin Chalas
d32d7685c2 bug #28401 [Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/26885
| License       | MIT
| Doc PR        | n/a

There is an inconsistency between `SymfonyStyle::askQuestion(new ChoiceQuestion(...))` and `SymfonyStyle::choice(...)`, the former does not support to have a choice value as default instead of a choice key while the latter handles both.
This is causing an `undefined index` notice breaking interactive command testing, fixed here.

Commits
-------

c51dda0 [Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default
2018-09-08 20:52:26 +02:00
Nicolas Grekas
4cf1ae4e07 [VarExporter] minor CS tweak 2018-09-08 20:19:57 +02:00
Nicolas Grekas
f3c3c0b4d6 bug #28408 [VarExporter] fix exporting instances of final classes that extend internal ones (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] fix exporting instances of final classes that extend internal ones

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

Another PHP oddity found today.

Commits
-------

4a16b6ca65 [VarExporter] fix exporting instances of final classes that extend internal ones
2018-09-08 20:14:47 +02:00
Nicolas Grekas
4a16b6ca65 [VarExporter] fix exporting instances of final classes that extend internal ones 2018-09-08 19:59:25 +02:00
nicoweb
cc6f82769b [Controller][ServiceValueResolver] Making method access case insensitive 2018-09-08 16:49:17 +02:00
Nicolas Grekas
004c315b0c Merge branch '4.1'
* 4.1:
  [DI] configure inlined services before injecting them when dumping the container
  Consistently throw exceptions on a single line
  fix fopen calls
  Update .editorconfig
2018-09-08 15:42:43 +02:00
Nicolas Grekas
2716e5374d minor #28407 Add missing UPGRADE-4.2 entry for Controller deprecation (chalasr)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Add missing UPGRADE-4.2 entry for Controller deprecation

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

Forgot in #28243, removal documented in UPGRADE-5.0

Commits
-------

cc23f5d5fd Add missing UPGRADE-4.2 entry for Controller deprecation
2018-09-08 15:26:25 +02:00
Nicolas Grekas
6fec32c0d0 Merge branch '3.4' into 4.1
* 3.4:
  [DI] configure inlined services before injecting them when dumping the container
  Consistently throw exceptions on a single line
  fix fopen calls
  Update .editorconfig
2018-09-08 15:24:10 +02:00
Robin Chalas
cc23f5d5fd Add missing UPGRADE-4.2 entry for Controller deprecation 2018-09-08 15:15:53 +02:00
Nicolas Grekas
8bc014c211 Merge branch '2.8' into 3.4
* 2.8:
  Consistently throw exceptions on a single line
  fix fopen calls
  Update .editorconfig
2018-09-08 15:15:14 +02:00
Fabien Potencier
1f996f4116 minor #28406 [Messenger] Remove the experimental annotations (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Remove the experimental annotations

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

As part of the plan... Messenger is stable in 4.2: let's commit to this 💃

Commits
-------

d16277b560 Remove the experimental annotations
2018-09-08 15:13:14 +02:00
Samuel ROZE
d16277b560 Remove the experimental annotations 2018-09-08 14:04:14 +01:00
Nicolas Grekas
f408a676c5 minor #28403 Consistently throw exceptions on a single line (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

Consistently throw exceptions on a single line

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

Just to be consistent. Prepared using php-cs-fixer + manual  tweaks.

Commits
-------

721dc8661f Consistently throw exceptions on a single line
2018-09-08 15:00:18 +02:00
Nicolas Grekas
5e237db55e bug #28388 [DI] configure inlined services before injecting them when dumping the container (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] configure inlined services before injecting them 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 | #28304
| License       | MIT
| Doc PR        | -

#28060 introduced a change in the way inline services are dumped: these instances could end up being configured *after* being injected. This breaks e.g. using Doctrine's Configuration instances, which are expected to be fully defined before being injected into their consumers.

Fixing this required a significant refactorization because I was just unable to reason with the heavily scrambled logic in place right now. The new logic is still non-trivial, but at least it's manageable, thus easier to get correct.

(Replaces #28385 which is the same applied to 4.1 - should help with merges.)

Commits
-------

e5c54053c4 [DI] configure inlined services before injecting them when dumping the container
2018-09-08 14:58:42 +02:00