Commit Graph

43754 Commits

Author SHA1 Message Date
Valentin Udaltsov
7b9f752b47 Removed declare(strict_types=1) in DispatchAfterCurrentBusStamp 2019-11-10 12:50:21 +03:00
Nicolas Grekas
72166c439d Merge branch '3.4' into 4.3
* 3.4:
  [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
2019-11-09 09:05:42 +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
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
Douglas Greenshields
9f853f324f
[Routing] revert the return type for UrlGeneratorInterface::generate to remove null 2019-11-08 17:25:00 +00: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
98e9fc8aee bug #34297 [DI] fix locators with numeric keys (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix locators with numeric keys

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

Commits
-------

dad4344793 [DI] fix locators with numeric keys
2019-11-08 17:22:08 +01:00
Nicolas Grekas
dad4344793 [DI] fix locators with numeric keys 2019-11-08 17:18:30 +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
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
b8cdc6e6bb bug #34282 [DI] Dont cache classes with missing parents (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Dont cache classes with missing parents

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Closes #34239
| License       | MIT
| Doc PR        | -

Commits
-------

1606430cfd [DI] Dont cache classes with missing parents
2019-11-08 09:30:13 +01:00
Nicolas Grekas
1606430cfd [DI] Dont cache classes with missing parents 2019-11-08 09:28:59 +01:00
Nicolas Grekas
201d17181a bug #34287 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() (dunglas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Fix a crash when calling CurlHttpClient::__destruct()

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

I've not identified the exact issue, but when the profiler is enabled, an HttpClient instance is created and not used, then a crash occurs when `__destruct()` is called because `$this->mutli->handle` value is `0` has this point, while `curl_multi_setopt` expect a `resource`.

This PR fixes the issue, but it's maybe not the good approach.

Reproducer: symfony/mercure-bundle#14

curl version: 7.67.0

```
php -v
PHP 7.3.11 (cli) (built: Oct 24 2019 11:29:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.11, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.27.1~mac-x64-non_zts73, https://blackfire.io, by Blackfire
```

Commits
-------

d2c5ffda52 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
2019-11-08 09:24:00 +01:00
Kévin Dunglas
d2c5ffda52 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() 2019-11-08 09:23:45 +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
Nicolas Grekas
e91488cd0a bug #34246 [Serializer] Use context to compute MetadataAwareNameConverter cache (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Serializer] Use context to compute MetadataAwareNameConverter cache

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

This is a follow up PR to #34035 to address @nicolas-grekas 's [comment](https://github.com/symfony/symfony/pull/34035#issuecomment-549867560)

The static cache has been re-introduced and the context is used to compute the cache key used for denormalization

Commits
-------

0ac5346bf5 [Serializer] Use context to compute MetadataAwareNameConverter cache
2019-11-06 17:12:31 +01:00
Anto
0ac5346bf5
[Serializer] Use context to compute MetadataAwareNameConverter cache 2019-11-06 17:10:14 +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
4f04bedd00 bug #34251 [HttpClient] expose only gzip when doing transparent compression (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] expose only gzip when doing transparent compression

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

Commits
-------

6571dddc4c [HttpClient] expose only gzip when doing transparent compression
2019-11-06 13:01:29 +01:00
Nicolas Grekas
6571dddc4c [HttpClient] expose only gzip when doing transparent compression 2019-11-06 11:21:02 +01:00
Nicolas Grekas
ddf9e0fa1c bug #34244 [Inflector] add support for 'species' (jeffreymoelands)
This PR was merged into the 4.3 branch.

Discussion
----------

[Inflector] add support for 'species'

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

This PR improves the inflection of the word 'species'
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

cc87e40a8f add species to inflector and inflector tests
2019-11-06 09:52:55 +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
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
1a573c387e minor #34230 [HttpKernel][DataCollectorInterface] Ease compatibility (fancyweb)
This PR was submitted for the 3.4 branch but it was merged into the 4.3 branch instead.

Discussion
----------

[HttpKernel][DataCollectorInterface] Ease compatibility

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/33065/files#r342109866
| License       | MIT
| Doc PR        | -

To ease data collectors being compatible from 4.3 to 5.0.

Commits
-------

761df46993 [HttpKernel][DataCollectorInterface] Ease compatibility
2019-11-05 14:42:35 +01:00
Thomas Calvet
761df46993 [HttpKernel][DataCollectorInterface] Ease compatibility 2019-11-05 14:42:27 +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
Nicolas Grekas
9cebe4bc09 minor #34229 [DependencyInjection] Fix broken references in tests (Chi-teck)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

[DependencyInjection] Fix broken references in tests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  |no
| Deprications? | no
| License       | MIT

Commits
-------

bd1ead251c [DependencyInjection] Fix broken references in tests
2019-11-04 20:58:33 +01:00
Chi-teck
bd1ead251c [DependencyInjection] Fix broken references in tests 2019-11-04 20:58:26 +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
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
Fabien Potencier
ee0988cb06 minor #34227 Simplify PHP CS Fixer configuration (keradus)
This PR was merged into the 3.4 branch.

Discussion
----------

Simplify PHP CS Fixer configuration

Possible after updating PHP CS Fixer on fabbot.io to 2.16

Commits
-------

0b0e5b50d5 Simplify PHP CS Fixer configuration
2019-11-03 20:59:03 +01:00
Alexander Schranz
49b58ed45e Avoid using of kernel after shutdown 2019-11-03 20:32:26 +01:00
Fabien Potencier
0af10ccd0d minor #34160 Adding some validations tags on validators.et.xlf (glodzienski)
This PR was merged into the 3.4 branch.

Discussion
----------

Adding some validations tags on validators.et.xlf

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/30160
| License       | MIT

I saw an issue in the **Issues Page** and i want to help to improve the repository, even with a simple modification

Commits
-------

16bd71b5b1 Adding some validations tags on validators.et.xlf
2019-11-03 18:41:53 +01:00
Fabien Potencier
78bdf1a307 minor #34153 [Validator] add missing translation for 94 (it) (garak)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add missing translation for 94 (it)

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | None
| License       | MIT
| Doc PR        | not needed

Italian translation for validator is missing last item (id 94)

Commits
-------

1dc7ce1159 add missing translation for 94 (it)
2019-11-03 18:21:08 +01:00
Fabien Potencier
9162892fd4 bug #34181 [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods

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

When running multiple periods in StopwatchEvent (start multiple times and not stop them all), the getDuration() method would return unexpected values.

This was because at every stop, the last entry in the `started` array was removed, while the `getDuration` method was still expecting all the started events to still be there.

Now, when calling `getDuration`, the duration of all the finished periods are added together with the unfinished counts.

Commits
-------

af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
2019-11-03 18:17:59 +01:00
Dariusz Ruminski
0b0e5b50d5 Simplify PHP CS Fixer configuration 2019-11-03 15:37:51 +01:00
Fabien Potencier
142bdddece bug #34165 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements (happyproff)
This PR was squashed before being merged into the 4.3 branch (closes #34165).

Discussion
----------

[PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements

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

When an annotation is declared as `int[]|null`, it is handled like `(int|null)[]|null`. So array values are also nullable.

Now this behavior is fixed that `int[]|null` is either a collection of integers only or null.

How to reproduce:
```php
class Dummy
{
    /** @var int[]|null */
    public $nullableCollectionOfNonNullableElements;
}

/** @var Type[] $types */
$types = (new PhpDocExtractor())->getTypes(Dummy::class, 'nullableCollectionOfNonNullableElements');

$collectionType = $types[0];
assert($collectionType->isCollection() === true); // OK
assert($collectionType->isNullable() === true); // OK
assert($collectionType->getCollectionValueType()->getBuiltinType() === Type::BUILTIN_TYPE_INT); // OK
assert($collectionType->getCollectionValueType()->isNullable() === false); // FAILED
```

Commits
-------

5e394c40f0 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
2019-11-03 13:19:19 +01:00
Stanislav Gamayunov
5e394c40f0 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements 2019-11-03 13:19:12 +01:00