This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/PropertyInfo
Fabien Potencier 80e5a7fbd8 feature #37559 [PropertyInfo] fix array types with keys (array<string, string>) (digilist)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyInfo] fix array types with keys (array<string, string>)

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Array types with keys are currently not detected correctly from the PropertyInfo component:

```
@var array<string, string>
@var array<string, array<integer, string>>
```

Those are currently identified as object with class `rray<string, string>`.

This PR tries to fix it.

What I noticed while fixing this, is that union types in arrays are not supported in general at the moment, because the `Type` class supports only one collectionValueType and I do not see how to pass a Union Type there. But I guess that's a different issue and for those types I decided to return null as collection value type for now. (Or better throw on exception?)

Commits
-------

64f7bd7832 [PropertyInfo] fix array types with keys (array<string, string>)
2020-09-09 07:17:12 +02:00
..
DependencyInjection Added ConstructorExtractor which has higher priority than PhpDocExtractor and ReflectionExtractor 2020-08-26 09:35:07 +02:00
Extractor Merge branch '5.1' 2020-09-07 07:10:36 +02:00
Tests feature #37559 [PropertyInfo] fix array types with keys (array<string, string>) (digilist) 2020-09-09 07:17:12 +02:00
Util [PropertyInfo] fix array types with keys (array<string, string>) 2020-09-07 14:53:44 +02:00
.gitattributes add missing gitattributes for phpunit-bridge 2020-03-27 17:54:36 +01:00
.gitignore Add gitignore file for Symfony 3.4 2019-09-17 11:52:54 +02:00
CHANGELOG.md [PropertyAccess] Allow to disable magic __get & __set 2020-08-19 15:25:50 +02:00
composer.json [PropertyAccess] Allow to disable magic __get & __set 2020-08-19 15:25:50 +02:00
LICENSE Update year in license files 2020-01-01 12:03:25 +01:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
PropertyAccessExtractorInterface.php Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
PropertyDescriptionExtractorInterface.php Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
PropertyInfoCacheExtractor.php Merge branch '4.4' 2019-08-20 18:53:57 +02:00
PropertyInfoExtractor.php Merge branch '4.4' 2019-08-20 18:53:57 +02:00
PropertyInfoExtractorInterface.php
PropertyInitializableExtractorInterface.php fixed CS 2019-01-16 21:35:37 +01:00
PropertyListExtractorInterface.php Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
PropertyReadInfo.php Rebase, fix tests, review & update CHANGELOG 2020-01-28 10:54:57 +01:00
PropertyReadInfoExtractorInterface.php Rebase, fix tests, review & update CHANGELOG 2020-01-28 10:54:57 +01:00
PropertyTypeExtractorInterface.php Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
PropertyWriteInfo.php Add missing dots at the end of exception messages 2020-03-15 15:54:58 +01:00
PropertyWriteInfoExtractorInterface.php Rebase, fix tests, review & update CHANGELOG 2020-01-28 10:54:57 +01:00
README.md [PropertyInfo] Add missing documentation link in Readme 2019-05-16 16:10:36 +02:00
Type.php Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00

PropertyInfo Component

PropertyInfo extracts information about PHP class' properties using metadata of popular sources.

Resources