Commit Graph

35006 Commits

Author SHA1 Message Date
Fabien Potencier
258776b31d bug #25425 When available use AnnotationRegistry::registerUniqueLoader (jrjohnson)
This PR was merged into the 3.3 branch.

Discussion
----------

When available use AnnotationRegistry::registerUniqueLoader

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| References tickets | #24596
| License       | MIT

Take advantage of AnnotationRegistry::registerUniqueLoader which will only add 'class_exists' as an autoloader if it has not already been added. This helps alleviate a performance issue when the
same loader is added many times in tests.

Commits
-------

97c3f429eb Take advantage of AnnotationRegistry::registerUniqueLoader
2017-12-12 21:39:24 -08:00
Yonel Ceruto
16af89045a Remove redundant translation path 2017-12-12 23:37:05 -05:00
Jonathan Johnson
97c3f429eb
Take advantage of AnnotationRegistry::registerUniqueLoader
This method will only add 'class_exists' as an autoloader if it has not
already been added. This helps alleviate a performance issue when the
same loader is added many times in tests.
2017-12-12 15:38:57 -08:00
Fabien Potencier
020664e1ef bug #25474 [DI] Optimize Container::get() for perf (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Optimize Container::get() for perf

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

As outlined in #25159, our beloved container suffers from a perf hit just because it has a second argument, and this second argument's default value makes it slower.

Let's fix this by inlining the value. This will put Symfony at a better rank on eg:
https://github.com/kocsismate/php-di-container-benchmarks

I benched also with the following script. The result is surprising (but matches the finding in #25159):
without the patch, it takes 2s, and with the patch, it's down to 1s (opcache enabled).

```php

require './vendor/autoload.php';

use Symfony\Component\DependencyInjection\Container;

$c = new Container();
$c->set('foo', new \stdClass());

$i = 10000000;

$s = microtime(1);

while (--$i) {
    $c->get('foo');
}

echo microtime(true) - $s, "\n";
```

Commits
-------

4fe2551545 [DI] Optimize Container::get() for perf
2017-12-12 15:28:37 -08:00
Nicolas Grekas
4fe2551545 [DI] Optimize Container::get() for perf 2017-12-12 22:54:52 +01:00
Christian Flothmann
e54109b0a0 sync upgrade and changelog files 2017-12-12 20:03:06 +01:00
Nicolas Grekas
b49998ebd8 minor #25463 [HttpFoundation] Fix tests (chalasr)
This PR was merged into the 3.3 branch.

Discussion
----------

[HttpFoundation] Fix tests

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

Remains filesystem ones due to #25420, going to have a look in this PR in the next hour if nobody does before.

Commits
-------

ef6adb8 Fix tests
2017-12-12 13:02:43 +01:00
Nicolas Grekas
79b64ce328 fix merge 2017-12-12 13:01:02 +01:00
Robin Chalas
ef6adb89ef Fix tests 2017-12-12 12:55:28 +01:00
Robin Chalas
28bf816e74 Merge branch '4.0'
* 4.0:
  add missing logout_on_user_change options
  [HttpFoundation] Add immutable to setCache's PHPDoc
2017-12-12 12:47:36 +01:00
Robin Chalas
bf61b7b969 Merge branch '3.4' into 4.0
* 3.4:
  add missing logout_on_user_change options
  [HttpFoundation] Add immutable to setCache's PHPDoc
2017-12-12 12:44:17 +01:00
Robin Chalas
24e274d5f2 minor #25461 [SecurityBundle] add missing logout_on_user_change options (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] add missing logout_on_user_change options

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

fde1f48 add missing logout_on_user_change options
2017-12-12 12:43:14 +01:00
Christian Flothmann
fde1f48874 add missing logout_on_user_change options 2017-12-12 12:26:50 +01:00
Nicolas Grekas
05ab1cd00d Merge branch '2.8' into 3.3
* 2.8:
  Refactoring tests.
2017-12-12 12:20:26 +01:00
Nicolas Grekas
263eda3dd6 Merge branch '2.7' into 2.8
* 2.7:
  Refactoring tests.
2017-12-12 12:12:43 +01:00
Nicolas Grekas
e77545ab8d minor #25420 Refactoring tests (carusogabriel)
This PR was merged into the 2.7 branch.

Discussion
----------

Refactoring tests

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

I've refactored some tests, using:
- `assertCount` instead of `count` function;
- `assertArrayHasKey`, `assertArrayNotHasKey`, `assertObjectHasAttribute` and `assertObjectNotHasAttribute` instead of `isset` function;
- `assertContains` instead of `in_array` function;
- `assertSame` and `assertNotSame` instead os strict comparisons `===`;
- `assertNotFalse` instead of strict comparisons `!==` with `false` keyword;
- `assertGreaterThan`, `assertLessThan` and `assertLessThanOrEqual` for mathematical comparisons;

Commits
-------

567e0ab Refactoring tests.
2017-12-12 12:07:15 +01:00
Nicolas Grekas
6f3de947ac minor #25458 [TwigBridge] Fix workflow test with deps=low (Simperfit)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[TwigBridge] Fix workflow test with deps=low

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

In the original PR the tests were not failling but we should not use the new feature with deps=low until it fetch the branch with the new feature. So this fix the test for the WorkflowExtension in TwigBridge.

Commits
-------

e5c6b92 [TwigBridge] Fix workflow test with deps=low
2017-12-12 11:59:38 +01:00
Amrouche Hamza
e5c6b92e76
[TwigBridge] Fix workflow test with deps=low 2017-12-12 11:54:15 +01:00
Nicolas Grekas
193b98a1aa minor #25460 [FrameworkBundle] Move AbstractController::getParameter() from the trait to the class & use PSR-11 (nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] Move AbstractController::getParameter() from the trait to the class & use PSR-11

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

Feels more specific this way to me. Ping @chalasr

Commits
-------

3051289 [FrameworkBundle] Move AbstractController::getParameter() from the trait to the class & use PSR-11
2017-12-12 11:40:51 +01:00
Nicolas Grekas
8151661f02 minor #25455 [HttpFoundation] Add immutable to setCache's PHPDoc (dunglas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Add immutable to setCache's PHPDoc

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

6e248ca [HttpFoundation] Add immutable to setCache's PHPDoc
2017-12-12 11:35:23 +01:00
Nicolas Grekas
3051289791 [FrameworkBundle] Move AbstractController::getParameter() from the trait to the class & use PSR-11 2017-12-12 11:27:48 +01:00
Nicolas Grekas
72e189a356 Merge branch '4.0'
* 4.0:
  fix merge
2017-12-12 10:23:59 +01:00
Nicolas Grekas
527f7e4907 Merge branch '3.4' into 4.0
* 3.4:
  fix merge
2017-12-12 10:23:46 +01:00
Nicolas Grekas
76176d993c fix merge 2017-12-12 10:23:32 +01:00
Nicolas Grekas
7ecfc7fedc Merge branch '4.0'
* 4.0: (25 commits)
  [Form] fix how form type is referenced in test
  fix merge
  [Console] Fix console tests by adding the missing condition
  [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files
  Fixed exit code with non-integer throwable code
  [HttpFoundation] Support 0 bit netmask in IPv6 ()
  [DI] Impossible to set an environment variable and then an array as container parameter
  [Process] remove false-positive BC breaking exception on Windows
  Tweaking class not found autowiring error
  [LDAP] added missing dots at the end of some exception messages.
  [TwigBridge] Add missing dev requirement for workflow
  fixed #25440
  empty lines don't count for indent detection
  Set `width: auto` on WebProfiler toolbar's reset.
  [Lock] Fix incorrect phpdoc
  [Process] Dont rely on putenv(), it fails on ZTS PHP
  [HttpKernel] detect deprecations thrown by container initialization during tests
  [HttpKernel] Fix logging of post-terminate errors/exceptions
  [DI] Add context to service-not-found exceptions thrown by service locators
  [Debug] Fix catching fatal errors in case of nested error handlers
  ...
2017-12-12 09:59:50 +01:00
Nicolas Grekas
b23ffea41f Merge branch '3.4' into 4.0
* 3.4:
  [Form] fix how form type is referenced in test
  [Console] Fix console tests by adding the missing condition
2017-12-12 09:58:23 +01:00
Nicolas Grekas
55374b5f36 Merge branch '3.3' into 3.4
* 3.3:
  [Form] fix how form type is referenced in test
  [Console] Fix console tests by adding the missing condition
2017-12-12 09:58:07 +01:00
Nicolas Grekas
33f16981c2 Merge branch '2.8' into 3.3
* 2.8:
  [Form] fix how form type is referenced in test
2017-12-12 09:57:55 +01:00
Nicolas Grekas
bff5014aa4 minor #25454 [Form] fix how form type is referenced in test (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] fix how form type is referenced in test

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

f859ae9 [Form] fix how form type is referenced in test
2017-12-12 09:56:51 +01:00
Robin Chalas
e56c2659fa minor #25453 [Console] Fix console tests by adding the missing condition (Simperfit)
This PR was merged into the 3.3 branch.

Discussion
----------

[Console] Fix console tests by adding the missing condition

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        |

The old conditions was testing that the exit code is different than 0. I just add this tests back since it is needed.
![resized_20171211_192030_2217](https://user-images.githubusercontent.com/3451634/33872253-5db07958-df16-11e7-85e9-4fc0cb5002ce.jpeg)

Commits
-------

57f8129 [Console] Fix console tests by adding the missing condition
2017-12-12 09:48:06 +01:00
Nicolas Grekas
15915fddf1 Merge branch '3.4' into 4.0
* 3.4: (22 commits)
  fix merge
  [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files
  Fixed exit code with non-integer throwable code
  [HttpFoundation] Support 0 bit netmask in IPv6 ()
  [DI] Impossible to set an environment variable and then an array as container parameter
  [Process] remove false-positive BC breaking exception on Windows
  Tweaking class not found autowiring error
  [LDAP] added missing dots at the end of some exception messages.
  [TwigBridge] Add missing dev requirement for workflow
  fixed #25440
  empty lines don't count for indent detection
  Set `width: auto` on WebProfiler toolbar's reset.
  [Lock] Fix incorrect phpdoc
  [Process] Dont rely on putenv(), it fails on ZTS PHP
  [HttpKernel] detect deprecations thrown by container initialization during tests
  [HttpKernel] Fix logging of post-terminate errors/exceptions
  [DI] Add context to service-not-found exceptions thrown by service locators
  [Debug] Fix catching fatal errors in case of nested error handlers
  [VarDumper] Fixed file links leave blank pages when ide is configured
  Fix hidden currency element with Bootstrap 3 theme
  ...
2017-12-12 09:41:51 +01:00
Kévin Dunglas
6e248cabe3
[HttpFoundation] Add immutable to setCache's PHPDoc 2017-12-12 09:38:51 +01:00
Christian Flothmann
f859ae9f1e [Form] fix how form type is referenced in test 2017-12-12 09:37:06 +01:00
Nicolas Grekas
6aa18bf6a8 Merge branch '3.3' into 3.4
* 3.3:
  fix merge
  [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files
  Fixed exit code with non-integer throwable code
  Add suggestions
  Added instructions to upgrade Symfony applications to 4.x
2017-12-12 09:27:14 +01:00
Nicolas Grekas
5b51491c18 Merge branch '2.8' into 3.3
* 2.8:
  fix merge
2017-12-12 09:25:59 +01:00
Nicolas Grekas
fb52f94722 fix merge 2017-12-12 09:25:42 +01:00
Nicolas Grekas
6e29f187b7 minor #25026 [MonologBridge][WebServerBundle] Add suggestions for using the log server (maidmaid)
This PR was merged into the 3.3 branch.

Discussion
----------

[MonologBridge][WebServerBundle] Add suggestions for using the log server

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

If you want launch `server:log`, you need the monolog bridge and the VarDumper. Optionally, you need EL if you want use `server:log --filter`.

Commits
-------

aca0ddd Add suggestions
2017-12-12 09:03:31 +01:00
Amrouche Hamza
57f8129598
[Console] Fix console tests by adding the missing condition 2017-12-12 08:26:14 +01:00
Gabriel Caruso
567e0ab7e6 Refactoring tests. 2017-12-12 05:05:30 -02:00
Fabien Potencier
b4e0a45acf bug #24594 [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files (BjornTwachtmann)
This PR was squashed before being merged into the 3.3 branch (closes #24594).

Discussion
----------

[Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files

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

This PR fixes the bug in #24593. It's not the absolutely ideal way to address the issue, but I don't see how else to handle it without either dropping support for pips in translation strings, or rearchitecting the code that feeds translations to the MessageSelector as pipe separated in the first place.

Commits
-------

fea815b2f5 [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files
2017-12-11 15:28:37 -08:00
Bjorn Twachtmann
fea815b2f5 [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files 2017-12-11 15:28:24 -08:00
Fabien Potencier
1725b50929 minor #24721 Added instructions to upgrade Symfony applications to 4.x (javiereguiluz)
This PR was merged into the 3.3 branch.

Discussion
----------

Added instructions to upgrade Symfony applications to 4.x

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

### Context

Related to #24718 and lots of past questions received in Slack, Stack Overflow, etc.

The UPGRADE guides are great for individual Symfony components/bundles, but we're lacking instructions to upgrade a whole Symfony app from 2.x to 3.x or from 3.x to 4.x.

In the past we had problems with the changes introduced in https://github.com/symfony/symfony-standard which were not documented in the main UPGRADE files.

### Proposal

We could:

1) Add a new section int he UPGRADE file to explain the upgrading process for whole Symfony apps. This is what this PR proposes (but it's still just a draft).
2) We could move the changes of this PR to a new article in the Symfony Docs.
3) We could move the entire UPGRADE files to the Symfony Docs and explain the changes for individual components and whole Symfony apps.
4) ... ?

Commits
-------

de4f8ac21d Added instructions to upgrade Symfony applications to 4.x
2017-12-11 15:22:19 -08:00
Fabien Potencier
e19a34d338 feature #25148 Pr/workflow name as graph label (shdev)
This PR was squashed before being merged into the 4.1-dev branch (closes #25148).

Discussion
----------

Pr/workflow name as graph label

| 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 pull request added an option to the workflow dumper command, which allows you to add a graph label with the workflow name to the output. Without the option nothing changed the behavior from before.

Example call:

```bash
bin/console workflow:dump <workflowname> --label=custom_label
```

Commits
-------

0afce8db58 Pr/workflow name as graph label
2017-12-11 15:18:50 -08:00
shdev
0afce8db58 Pr/workflow name as graph label 2017-12-11 15:18:49 -08:00
Amrouche Hamza
dee00f8393
[PropertyAccess] add more information to NoSuchPropertyException Message 2017-12-11 23:43:31 +01:00
Wouter J
dfef227837 Fixed exit code with non-integer throwable code 2017-12-11 14:27:15 -08:00
Fabien Potencier
033e7529cc bug #24951 [Console] Fixed exit code with non-integer throwable code (wouterj)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Console] Fixed exit code with non-integer throwable code

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

The exception/error code in PHP doesn't have to be an integer:

 > Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).
> http://php.net/manual/en/exception.getcode.php#refsect1-exception.getcode-returnvalues

This means that a "Return value of Symfony\Component\Console\Event\ConsoleErrorEvent::getExitCode() must be of the type integer, string returned" error is shown when e.g. an uncatched PDOException is handled by the console error event.

Commits
-------

ca86e65da4 Fixed exit code with non-integer throwable code
2017-12-11 14:26:04 -08:00
Fabien Potencier
29f86d4193 minor #25452 [Validator][HttpFoundation] fix the message test (Simperfit)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Validator][HttpFoundation] fix the message test

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

@fabpot I just forgot to update HttpFoundation test and there was one I missed when modifying the tests.

Commits
-------

d2d8049313 [Validator][HttpFoundation] fix the message test
2017-12-11 14:22:33 -08:00
Amrouche Hamza
d2d8049313
[Validator][HttpFoundation] fix the message test 2017-12-11 23:15:39 +01:00
Fabien Potencier
428731fe63 feature #25324 [HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize() (Simperfit)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize()

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #23791
| License       | MIT
| Doc PR        | none

Replace the wrong named and documented method by another with better doc and better naming

Commits
-------

b1363202ed [HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize()
2017-12-11 14:09:40 -08:00