Commit Graph

36734 Commits

Author SHA1 Message Date
wimg
27207c3056 [HttpFoundation][Lock] Connection parameter corrected 2019-11-11 14:09:26 +01:00
Nicolas Grekas
6be5cc75a4 [HttpFoundation] fix guessing mime-types of files with leading dash 2019-11-11 13:53:10 +01:00
Nicolas Grekas
d446d7733a [VarExporter] fix exporting some strings 2019-11-11 13:48:54 +01:00
Nicolas Grekas
6c9157bbc2 [ErrorHandler] merge and remove the ErrorRenderer component 2019-11-10 18:54:30 +01:00
Fabien Potencier
10a349c37d feature #34309 [HttpKernel] make ExceptionEvent able to propagate any throwable (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] make ExceptionEvent able to propagate any throwable

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

An alternative to #34306.

As a reminder, the goal of this series of PRs is to remove the `FatalThrowableError` wrapper that we introduced to seamlessly handle throwables when they were introduced in PHP 7.

From the changelog of `HttpKernel`:
 * Deprecated methods `ExceptionEvent::get/setException()`, use `get/setThrowable()` instead
 * Deprecated class `ExceptionListener`, use `ErrorListener` instead

And the final target: removed `Symfony\Component\ErrorHandler\Exception\ErrorException` (`FatalThrowableError` is already deprecated.)

Commits
-------

6f67f0e0c0 [HttpKernel] make ExceptionEvent able to propagate any throwable
2019-11-10 14:19:52 +01:00
Valentin Udaltsov
7b9f752b47 Removed declare(strict_types=1) in DispatchAfterCurrentBusStamp 2019-11-10 12:50:21 +03:00
Nicolas Grekas
6f67f0e0c0 [HttpKernel] make ExceptionEvent able to propagate any throwable 2019-11-10 10:37:33 +01:00
Robin Chalas
2377418443 [Security] Avoid unnecessary usage of Reflection 2019-11-09 23:08:03 +01:00
Robin Chalas
040d93d5b5 minor add missing loop break 2019-11-09 13:08:24 +01:00
Fabien Potencier
758e266f48 bug #34304 [Security] Fix defining multiple roles per access_control rule (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fix defining multiple roles per access_control rule

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        |  https://github.com/symfony/symfony-docs/pull/12371 needs to be reverted

#33584 deprecated passing multiple attributes to `AccessDecisionManager::decide()`, but this change must not impact `access_control` as you cannot define multiple rules with the same criteria for request matching (the first match wins).

Commits
-------

338b3dfd9f [Security] Fix defining multiple roles per access_control rule
2019-11-09 12:16:35 +01:00
Fabien Potencier
d688a79b5a feature #34139 [Security] Add migrating encoder configuration (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Add migrating encoder configuration

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        |

Commits
-------

80955be45d [Security] Add migrating encoder configuration
2019-11-09 12:12:07 +01:00
Robin Chalas
80955be45d [Security] Add migrating encoder configuration 2019-11-09 11:20:37 +01:00
Nicolas Grekas
12a8b6937b [Translator] fix compat with translation-contracts v2 2019-11-09 10:30:00 +01:00
Nicolas Grekas
55559f48b5 [IdentityTranslator] fix compat with translation-contracts v2 2019-11-09 09:49:52 +01:00
Robin Chalas
338b3dfd9f [Security] Fix defining multiple roles per access_control rule 2019-11-09 09:18:51 +01:00
Nicolas Grekas
a20e1ad138 Merge branch '4.3' into 4.4
* 4.3:
  [Workflow] Simplified EventDispatcherMock.
  [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
2019-11-09 09:06:11 +01:00
Fabien Potencier
fd7c676172 minor #34303 [Messenger] Fixed bad event dispatcher mocks (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fixed bad event dispatcher mocks

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

`EventDispatcherInterface::dispatch()` must return the passed event object. This PR fixes two mocks that violated this contract.

Commits
-------

103930039b [Messenger] Fixed bad event dispatcher mocks.
2019-11-09 07:45:24 +01:00
Fabien Potencier
4463791d0e minor #34299 [Routing] revert the return type for UrlGeneratorInterface::generate to remove null (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] revert the return type for UrlGeneratorInterface::generate to remove null

…to remove null

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (only)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

Bit of a casualty of commit tennis this:

A change to add `null` here as an option for how `UrlGeneratorInterface::generate()` (rather than the concrete `UrlGenerator`) was merged in https://github.com/symfony/symfony/pull/28321, but then [reverted](90494c20cc) for the reason [that this could be seen as a BC break](https://github.com/symfony/symfony/pull/28321#issuecomment-418540080), as the `null` return had not previously been documented (and is still not as part of the interface method docs).

However, in a subsequent change (https://github.com/symfony/symfony/pull/33252) with a wider scope, this doc change was added _back_ in order to reflect the underlying implementation as a result of a PHPStorm plugin complaining. There's no indication though of what a `null` return here though would mean, and for the same reason as the first revert (that this should be seen as a BC break), I'd like to submit this to be reverted for the 3.4 branch. (In 4.4 the `null` has already been removed.)

Having the interface indicating that this method can return `null` necessitates introducing a lot of actually redundant null checks in code that is covered by static analysis tools such as PHPStan.

Commits
-------

9f853f324f [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
2019-11-09 07:39:26 +01:00
Fabien Potencier
e4ddc75549 minor #34302 [Workflow] Simplified EventDispatcherMock (derrabus)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Simplified EventDispatcherMock

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

This PR simplifies the Workflow component's mock implementation of the event dispatcher by implementing the much simpler contracts interface instead of the full-blown component interface.

Commits
-------

5aee181c83 [Workflow] Simplified EventDispatcherMock.
2019-11-09 07:38:43 +01:00
Fabien Potencier
f4c925418b feature #32194 [HttpFoundation] Add a way to anonymize IPs (Seldaek)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Add a way to anonymize IPs

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features --> TODO

This is helpful for GDPR compliance reasons, and it isn't much code saved but it's also good if you don't have to think about how to do it.

Commits
-------

9e62330bc4 [HttpFoundation] Add a way to anonymize IPs
2019-11-09 07:36:01 +01:00
Alexander M. Turek
103930039b [Messenger] Fixed bad event dispatcher mocks. 2019-11-09 00:05:14 +01:00
Nicolas Grekas
9e554cee75 [EventDispatcher] dont allow event-dispatcher-contracts ^2 2019-11-08 23:40:51 +01:00
Alexander M. Turek
5aee181c83 [Workflow] Simplified EventDispatcherMock. 2019-11-08 23:25:20 +01:00
Nicolas Grekas
b148114116 [FrameworkBundle] fix lower dep 2019-11-08 23:04:53 +01:00
Nicolas Grekas
522bd5d99d [DI] fix loading env while env loaders are loaded 2019-11-08 21:45:30 +01:00
Douglas Greenshields
9f853f324f
[Routing] revert the return type for UrlGeneratorInterface::generate to remove null 2019-11-08 17:25:00 +00:00
Jordi Boggiano
9e62330bc4
[HttpFoundation] Add a way to anonymize IPs 2019-11-08 18:11:01 +01:00
Nicolas Grekas
7c111bdcf3 minor #34290 [DI] Remove LazyString from 4.4, before adding back to the String component (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Remove LazyString from 4.4, before adding back to the String component

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In #34190 I'm proposing to move LazyString to the Service contracts, but String might be a better fit actually. Let's remove the class from 4.4 where it's not really needed, and add it back on 5.0 in the String component.

Commits
-------

b1a3ee76ac [DI] Remove LazyString from 4.4, before adding back to the String component
2019-11-08 17:26:52 +01:00
Nicolas Grekas
f459fd01a2 Merge branch '4.3' into 4.4
* 4.3:
  [DI] fix locators with numeric keys
  Fix error when we use VO for the marking property
2019-11-08 17:24:33 +01:00
Nicolas Grekas
bc726f7d50 bug #34294 [Workflow] Fix error when we use ValueObject for the marking property (FabienSalles)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Fix error when we use ValueObject for the marking property

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #28203 #22031
| License       | MIT

Fix Illegal offset type in `MethodMarkingStore` class when we use Value Object for
the marking property.

Now, we can avoid to use only a string an we can have a Subject class with a Value Object like this :
```php
final class State
{
    public const DRAFT = 'draft';
    public const REVIEWED = 'reviewed';
    public const REJECTED = 'rejected';
    public const PUBLISHED = 'published';

     /** @var string */
    private $state;

    public function __construct(string $state)
    {
        // some validation
        $this->state = $state;
    }

    public function __toString()
     {
         return $this->state;
    }

    public static function Draft()
     {
         return new self(self::DRAFT);
     }
    ...
}

final class Subject
{
    private $marking;

    public function __construct(State $marking = null)
    {
        $this->marking = $marking;
    }

    public function getMarking()
    {
        return $this->marking;
    }

    public function setMarking($marking)
    {
        $this->marking = $marking instanceof State ? $marking : new State($marking);
    }

```

Commits
-------

6570d5cbe2 Fix error when we use VO for the marking property
2019-11-08 17:23:33 +01:00
Nicolas Grekas
618aec6abe Merge branch '3.4' into 4.3
* 3.4:
  [DI] fix locators with numeric keys
2019-11-08 17:22:27 +01:00
Nicolas Grekas
dad4344793 [DI] fix locators with numeric keys 2019-11-08 17:18:30 +01:00
Nicolas Grekas
97577aea66 feature #34252 [Console] Add support for NO_COLOR env var (Seldaek)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Add support for NO_COLOR env var

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        |

Adds support for https://no-color.org/ - ideally this would be considered a bugfix and added to older releases IMO, but submitting as new feature for now.

cc @johnstevenson

Commits
-------

c1b0a8e956 Add support for NO_COLOR env var
2019-11-08 17:06:42 +01:00
Jordi Boggiano
c1b0a8e956
Add support for NO_COLOR env var 2019-11-08 16:59:14 +01:00
Nicolas Grekas
ba2148fff3 [DI][FrameworkBundle] add EnvVarLoaderInterface - remove SecretEnvVarProcessor 2019-11-08 15:47:02 +01:00
FabienSalles
6570d5cbe2 Fix error when we use VO for the marking property
Fix Illegal offset type when we use ValueObject instead of string for
the marking property #28203 #22031
2019-11-08 12:45:38 +01:00
Nicolas Grekas
b1a3ee76ac [DI] Remove LazyString from 4.4, before adding back to the String component 2019-11-08 11:42:01 +01:00
Nicolas Grekas
585c0df909 feature #31310 [DependencyInjection] Added option ignore_errors: not_found for imported config files (pulzarraider)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Added option `ignore_errors: not_found` for imported config files

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

If someone want to add optional config file. The only available choice was to add `ignore_errors: true` option

e.g.
```
imports:
    - { resource: parameters.yml, ignore_errors: true }
```

But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.

This PR introduce new possible value `not_found` for `ignore_errors` option. It can be used for optional config files like the `ignore_errors: true`, but it will ignore only the file non-existence, not the possible syntax errors inside.

Usage:
```
imports:
    - { resource: parameters.yml, ignore_errors: not_found}
```

Commits
-------

e0ee01c10d [DependencyInjection] Added option `ignore_errors: not_found` while importing config files
2019-11-08 09:53:35 +01:00
Nicolas Grekas
7a8b85cc67 bug #34285 [FrameworkBundle] fix SodiumVault after stof review (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix SodiumVault after stof review

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

As spotted by @stof in https://github.com/symfony/symfony/pull/34275#pullrequestreview-313355834

Commits
-------

a594599078 [FrameworkBundle] fix SodiumVault after stof review
2019-11-08 09:34:16 +01:00
Nicolas Grekas
8aaa8c5fc6 Merge branch '4.3' into 4.4
* 4.3:
  [DI] Dont cache classes with missing parents
  [HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
  [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
  [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2019-11-08 09:33:02 +01:00
Nicolas Grekas
a1fc280bf2 Merge branch '3.4' into 4.3
* 3.4:
  [DI] Dont cache classes with missing parents
  [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
2019-11-08 09:31:27 +01:00
Nicolas Grekas
1606430cfd [DI] Dont cache classes with missing parents 2019-11-08 09:28:59 +01:00
Kévin Dunglas
d2c5ffda52 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() 2019-11-08 09:23:45 +01:00
Thomas Calvet
da454db947 Unallow symfony/http-kernel ^5.0 2019-11-07 18:22:59 +01:00
Nicolas Grekas
a594599078 [FrameworkBundle] fix SodiumVault after stof review 2019-11-07 17:20:24 +01:00
Peter Schultz
e98731aabf [HttpClient] allow arbitrary JSON values in requests
Allow arbitrary values in the "json" request option. Previously values were
limitated to arrays and objects of type JsonSerializable. This doesn't account
for scalar values and classes with public properties (which don't need to
implement JsonSerializable), all of which are perfectly acceptable arguments to
json_encode.
2019-11-07 13:44:51 +01:00
Andrej Hudec
e0ee01c10d [DependencyInjection] Added option ignore_errors: not_found while importing config files 2019-11-07 12:06:31 +01:00
Nicolas Grekas
326284ae95 [FrameworkBundle] allow using secrets when the sodium ext is missing 2019-11-07 08:50:00 +01:00
Fabien Potencier
4056baf0f4 bug #34129 [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33992
| License       | MIT
| Doc PR        | -

The cache file name needs to depend on the scanned directories list. Otherwise, when a new directory is added, even if the container is rebuilt and the `FWB Translator` gets the new scanned directories list, the cached catalogue name is still the same and is resolved accordingly.

An alternative would be to make the `Translation Translator` `getCatalogueCachePath()` method and `fallbackLocales` `@internal` and `protected` to just override everything in the `FWB Translator`. The `cacheVary` argument has the benefit to be reusable by all the `Translation` component users.

Note that there is a negative minor performance impact that increases when the list of scanned directories grows.

Commits
-------

6cbee0944c [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2019-11-07 00:21:49 +01:00
Yonel Ceruto
ba07cda358 minor #34249 [TwigBridge] Fix switch-custom changelog entry (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Fix switch-custom changelog entry

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Relates to #33954
| License       | MIT
| Doc PR        | N/A

As it doesn't really mention `switch-custom` is a css class.

Commits
-------

b03b7f4 [TwigBridge] Fix switch-custom changelog entry
2019-11-06 12:55:14 -05:00
Nicolas Grekas
403fdf4a59 Skip validation of services that make the CI fail 2019-11-06 17:48:56 +01:00
Nicolas Grekas
a1155ea6e2 Merge branch '4.3' into 4.4
* 4.3:
  [Serializer] Use context to compute MetadataAwareNameConverter cache
2019-11-06 17:13:44 +01:00
Anto
0ac5346bf5
[Serializer] Use context to compute MetadataAwareNameConverter cache 2019-11-06 17:10:14 +01:00
Thomas Calvet
d25b60961f [VarDumper] Mark StubCaster as @final 2019-11-06 17:06:09 +01:00
Nicolas Grekas
ca398df11f [DoctrineBridge] conflict with validator < 4.4 2019-11-06 16:07:32 +01:00
Nicolas Grekas
50633f2579 fix typo (bis) 2019-11-06 15:43:50 +01:00
Nicolas Grekas
9641215656 fix typo 2019-11-06 15:42:57 +01:00
Nicolas Grekas
4c401ebdd6 [HttpKernel] backport FC compat code 2019-11-06 15:42:08 +01:00
Nicolas Grekas
bd7da14243 minor #34261 [DoctrineBridge] fix min version of http-kernel (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] fix min version of http-kernel

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Required after #34257 and #34230

Commits
-------

69ba86ba66 [DoctrineBridge] fix min version of http-kernel
2019-11-06 15:29:25 +01:00
Nicolas Grekas
69ba86ba66 [DoctrineBridge] fix min version of http-kernel 2019-11-06 15:26:48 +01:00
Nicolas Grekas
3a4d60f298 minor #34260 [Messenger] conflict with FrameworkBundle < 4.4 (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] conflict with FrameworkBundle < 4.4

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

cddf3e9083 conflict with FrameworkBundle < 4.4
2019-11-06 15:12:58 +01:00
Nicolas Grekas
777ff14c75 minor #34257 [DoctrineBridge] Reopen DoctrineDataCollector to extensibility (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Reopen DoctrineDataCollector to extensibility

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

DoctrineBundle is using it (0d20a98fb8/DataCollector/DoctrineDataCollector.php (L41)) and we don't want to prevent them from doing it.

Commits
-------

af021248bf [DoctrineBridge] Reopen DoctrineDataCollector to extensibility
2019-11-06 15:12:17 +01:00
Christian Flothmann
cddf3e9083 conflict with FrameworkBundle < 4.4 2019-11-06 15:11:47 +01:00
Thomas Calvet
af021248bf [DoctrineBridge] Reopen DoctrineDataCollector to extensibility 2019-11-06 14:58:24 +01:00
Nicolas Grekas
370c4379a5 [HttpClient] fix support for NTLM auth 2019-11-06 14:41:42 +01:00
Nicolas Grekas
62bf1f5002 bug #34255 [HttpClient] fix after merge from 4.3 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix after merge from 4.3

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

3c6dc96ab4 [HttpClient] fix after merge from 4.3
2019-11-06 13:03:36 +01:00
Nicolas Grekas
3932642619 bug #34250 [VarDumper] fix tests & displaying generators (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] fix tests & displaying generators

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Replaces #34248

Commits
-------

bcf43a4593 [VarDumper] fix tests & displaying generators
2019-11-06 13:03:12 +01:00
Nicolas Grekas
dac61d0667 Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] expose only gzip when doing transparent compression
  add species to inflector and inflector tests
2019-11-06 13:02:32 +01:00
Nicolas Grekas
3c6dc96ab4 [HttpClient] fix after merge from 4.3 2019-11-06 12:53:36 +01:00
Nicolas Grekas
6571dddc4c [HttpClient] expose only gzip when doing transparent compression 2019-11-06 11:21:02 +01:00
Nicolas Grekas
bcf43a4593 [VarDumper] fix tests & displaying generators 2019-11-06 10:36:47 +01:00
Maxime Steinhausser
b03b7f4ef5 [TwigBridge] Fix switch-custom changelog entry
As it doesn't really mention `switch-custom` is a css class.
2019-11-06 09:18:31 +01:00
Thomas Calvet
906b82eb97 Fix WeekType tests 2019-11-05 23:24:16 +01:00
Fabien Potencier
9151698d85 minor #34135 [Validator] Add the missing translations for the Hebrew ("he") locale and fix 2 typos (Tamarpe)
This PR was squashed before being merged into the 3.4 branch (closes #34135).

Discussion
----------

[Validator] Add the missing translations for the Hebrew ("he") locale and fix 2 typos

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #30166
| License       | MIT

Ref #30166

Commits
-------

022cf67f19 [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
2019-11-05 23:03:38 +01:00
tamar peled
022cf67f19 [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos 2019-11-05 23:03:33 +01:00
jeffreymoelands
cc87e40a8f add species to inflector and inflector tests 2019-11-05 20:58:22 +01:00
Alexander Schranz
cfece10569 Add handling for delayed message to redis transport 2019-11-05 19:40:51 +01:00
Tobias Schultze
201f159303 [Messenger] use events consistently in worker 2019-11-05 18:28:25 +01:00
Thomas Calvet
abef506e89 Deprecate things that prevent \Throwable from bubbling down 2019-11-05 18:23:20 +01:00
Nicolas Grekas
4cd3dc8d7f Merge branch '4.3' into 4.4
* 4.3: (26 commits)
  [Console] Fix #33915, Detect dimensions using mode CON if vt100 is supported
  [HttpKernel][DataCollectorInterface] Ease compatibility
  Add tests to ensure defaultLocale is properly passed to the URL generator
  [DependencyInjection] Fix broken references in tests
  [HttpClient] Retry safe requests when then fail before the body arrives
  Avoid using of kernel after shutdown
  Simplify PHP CS Fixer configuration
  [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
  [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
  [Serializer] Fix property name usage for denormalization
  Name test accordingly to the tested class
  Fix MockFileSessionStorageTest::sessionDir being used after it's unset
  bumped Symfony version to 4.3.7
  updated VERSION for 4.3.6
  updated CHANGELOG for 4.3.6
  bumped Symfony version to 3.4.34
  updated VERSION for 3.4.33
  update CONTRIBUTORS for 3.4.33
  updated CHANGELOG for 3.4.33
  [HttpClient] Fix perf issue when doing thousands of requests with curl
  ...
2019-11-05 17:11:08 +01:00
Nicolas Grekas
620e8942a2 bug #34085 [Console] Detect dimensions using mode CON if vt100 is supported (rtek)
This PR was merged into the 4.3 branch.

Discussion
----------

[Console] Detect dimensions using mode CON if vt100 is supported

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33915
| License       | MIT

This fixes color support detection for users of Win10 + git-bash.  If vt100 support is detected, the terminal will not try to use `stty` to test for dimensions. Calling such command implicitly disables vt100 support on STDOUT.

Commits
-------

fdeceff85e [Console] Fix #33915, Detect dimensions using mode CON if vt100 is supported
2019-11-05 16:00:49 +01:00
rtek
fdeceff85e [Console] Fix #33915, Detect dimensions using mode CON if vt100 is supported 2019-11-05 16:00:28 +01:00
Nicolas Grekas
e0c7ab0700 bug #34199 [HttpClient] Retry safe requests using HTTP/1.1 when HTTP/2 fails (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Retry safe requests using HTTP/1.1 when HTTP/2 fails

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

cURL support of HTTP/2 is not as robust as HTTP/1.1. When doing >1k requests, the stream can break for buggy reasons. New versions of cURL are fixed already, but let's make our logic more resilient anyway, and switch to HTTP/1.1 when a *safe* request fails for send/recv reasons.

Commits
-------

9f7cd66004 [HttpClient] Retry safe requests when then fail before the body arrives
2019-11-05 15:50:06 +01:00
Nicolas Grekas
448d0d6728 Merge branch '3.4' into 4.3
* 3.4:
  [DependencyInjection] Fix broken references in tests
  Avoid using of kernel after shutdown
  Simplify PHP CS Fixer configuration
  [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
  Fix MockFileSessionStorageTest::sessionDir being used after it's unset
  bumped Symfony version to 3.4.34
  updated VERSION for 3.4.33
  update CONTRIBUTORS for 3.4.33
  updated CHANGELOG for 3.4.33
  [Stopwatch] Fixed a bug in stopwatch event getStartTime
  [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
  Adding some validations tags on validators.et.xlf
  add missing translation for 94 (it)
2019-11-05 15:48:09 +01:00
Nicolas Grekas
a2bccc6910 minor #33950 [FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase (alexander-schranz)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #...
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

I had sadly something like this in my codebase:

```php
if (!static::$kernel) {
    static::bootKernel();
}
```

As the $kernel is never set again to null a old $kernel was still there. I would not only set the $container also the $kernel variable to null. ~~As this could be a BC Break I'm targeting master~~.

Commits
-------

49b58ed45e Avoid using of kernel after shutdown
2019-11-05 15:21:40 +01:00
Nicolas Grekas
d056c17286 minor #34188 [PhpUnitBridge] Also search for composer.phar in git root folder (MaPePeR)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Also search for composer.phar in git root folder

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features
| Bug fix?      | kindof
| New feature?  | addition to existing feature
| Deprecations? | no
| Tickets       | Related: https://github.com/symfony/symfony/issues/26637#issuecomment-390749681
| License       | MIT

When you don't have a system `composer` installation, but a `composer.phar` in the project folder, you cannot use the `simple-phpunit` script from a subfolder of the project with e.g. `../vendor/bin/simple-phpunit`.

This change also searches for the `composer.phar` in the current git root folder if it was not found at any other places to increase the likelihood of it being found.

Commits
-------

97fd204d16 [PhpUnitBridge] Also search for composer.phar in git root folder
2019-11-05 14:50:02 +01:00
MaPePeR
97fd204d16 [PhpUnitBridge] Also search for composer.phar in git root folder 2019-11-05 14:49:56 +01:00
Thomas Calvet
761df46993 [HttpKernel][DataCollectorInterface] Ease compatibility 2019-11-05 14:42:27 +01:00
Nicolas Grekas
dc8bb309b5 feature #34184 [VarDumper] display the method we're in when dumping stack traces (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] display the method we're in when dumping stack traces

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This PR adds the line in blue:
![image](https://user-images.githubusercontent.com/243674/68152006-131bee00-ff43-11e9-8270-1d547732a7e5.png)

Without it, we're missing some context as the method is from a trait. This allows knowing which class is actually importing and using the method.

Commits
-------

23600cc8e1 [VarDumper] display the method we're in when dumping stack traces
2019-11-05 00:35:38 +01:00
Nicolas Grekas
a56ac78269 bug #34192 [Routing] Fix URL generator instantiation (X-Coder264, HypeMC)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] Fix URL generator instantiation

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

After merging my fix (PR https://github.com/symfony/symfony/pull/31023) from the 4.2 branch to 4.3 (which was master at the time) one code path which instantiates the url generator was missed. This new code path was added via https://github.com/symfony/symfony/pull/28865 and was missed during the merge because there was no merge conflict there as that code path didn't exist on 4.2.

So the current state on the 4.3 branch is:

- https://github.com/symfony/symfony/blob/v4.3.5/src/Symfony/Component/Routing/Router.php#L356 (default locale is properly passed to the constructor)

- https://github.com/symfony/symfony/blob/v4.3.5/src/Symfony/Component/Routing/Router.php#L372 (default locale is **NOT** properly passed to the constructor)

- https://github.com/symfony/symfony/blob/v4.3.5/src/Symfony/Component/Routing/Router.php#L378 (default locale is properly passed to the constructor)

I noticed this in my app because tests started to fail on the branch where we are upgrading our app from SF 4.2 to 4.3 due to this. This PR fixes the inconsistency (now the default locale is passed on all three places) which fixes the bug.

Commits
-------

9aa66e2f59 Add tests to ensure defaultLocale is properly passed to the URL generator
16c9bafee4 Fix URL generator instantiation
2019-11-04 21:23:21 +01:00
HypeMC
9aa66e2f59 Add tests to ensure defaultLocale is properly passed to the URL generator 2019-11-04 21:23:03 +01:00
Chi-teck
bd1ead251c [DependencyInjection] Fix broken references in tests 2019-11-04 20:58:26 +01:00
Nicolas Grekas
23600cc8e1 [VarDumper] display the method we're in when dumping stack traces 2019-11-04 20:39:01 +01:00
Nicolas Grekas
9f7cd66004 [HttpClient] Retry safe requests when then fail before the body arrives 2019-11-04 16:10:28 +01:00
Fabien Potencier
14080ce5b5 minor #34197 [ErrorRenderer] Show generic message in non-debug mode (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] Show generic message in non-debug mode

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

I agree with @Tobion here https://github.com/symfony/symfony/pull/34158#issuecomment-548181099, so let's always show the detail message, but for 5xx errors we'll send a generic message instead.

/cc @dunglas wdyt?

Commits
-------

45f1a5ee06 Show generic message in non-debug mode
2019-11-04 13:48:39 +01:00
Fabien Potencier
e4c661901e feature #33732 [Console] Rename some methods related to redraw frequency (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch (closes #33732).

Discussion
----------

[Console] Rename some methods related to redraw frequency

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In #26339 we added `preventRedrawFasterThan()` and `forceRedrawSlowerThan()`. While merging the docs for them (https://github.com/symfony/symfony-docs/pull/12364) I thought that the method names are a bit hard to understand.

In this PR I propose a renaming for your consideration. Thanks!

In the following example, we want to update the progress bar every 100 iterations, but not faster than 100ms or slower than 200ms.

**Before**

```php
$progressBar = new ProgressBar($output, 50000);
$progressBar->start();

$progressBar->setRedrawFrequency(100);
$progressBar->preventRedrawFasterThan(0.1);
$progressBar->forceRedrawSlowerThan(0.2);
```

**After**

```php
$progressBar = new ProgressBar($output, 50000);
$progressBar->start();

$progressBar->setRedrawFrequency(100);
$progressBar->maxRefreshInterval(0.1);
$progressBar->minRefreshInterval(0.2);
```

Commits
-------

e6ee7b07f3 [Console] Rename some methods related to redraw frequency
2019-11-04 13:46:19 +01:00
Javier Eguiluz
e6ee7b07f3 [Console] Rename some methods related to redraw frequency 2019-11-04 13:46:13 +01:00
Nicolas Grekas
13dd18c8a6 feature #31587 [Routing][Config] Allow patterns of resources to be excluded from config loading (tristanbes)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing][Config] Allow patterns of resources to be excluded from config loading

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

The PR will fix the following RFC: #31516

Like resource loading for services, this PR offers a way to exclude patterns of resources like:

```yml
// config/routes/annotations.yaml
controllers:
    resource: ../../src/Controller/*
    type: annotation
    exclude: '../src/Controller/{DebugEmailController}.php'
```

All the annotation routes inside `Controller/` will be loaded in this example except all the one present inside the `Controller/DebugEmailController.php`

Commits
-------

332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading
2019-11-04 11:53:20 +01:00
Nicolas Grekas
29fd51f272 feature #32256 [DI] Add compiler pass and command to check that services wiring matches type declarations (alcalyn, GuilhemN, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Add compiler pass and command to check that services wiring matches type declarations

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

PR replacing https://github.com/symfony/symfony/pull/27825.

It adds a `lint:container` command asserting the type hints used in your code are correct.

Commits
-------

8230a1543e Make it really work on real apps
4b3e9d4c96 Fix comments, improve the feature
a6292b917b [DI] Add compiler pass to check arguments type hint
2019-11-04 11:27:29 +01:00
Fabien Potencier
e057a9c89f bug #34134 [Messenger] fix retry of messages losing the routing key and properties (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix retry of messages losing the routing key and properties

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #32994 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        |

Messages sent for retry in rabbitmq lost the routing key and properties like the priority. Now we read those original properties and sent the retry message with the same properties (unless those properties have already been set manually before).

Commits
-------

75c674debc [Messenger] fix retry of messages losing the routing key and properties
2019-11-04 07:59:16 +01:00