|
@@ -33,13 +33,13 @@ use PhpCsFixer\Tokenizer\Tokens;
|
|
*
|
|
*
|
|
* @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool}
|
|
* @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool}
|
|
* @phpstan-type _AutogeneratedInputConfiguration array{
|
|
* @phpstan-type _AutogeneratedInputConfiguration array{
|
|
- * map_types?: array<string, string>,
|
|
|
|
* scalar_types?: bool,
|
|
* scalar_types?: bool,
|
|
|
|
+ * types_map?: array<string, string>,
|
|
* union_types?: bool
|
|
* union_types?: bool
|
|
* }
|
|
* }
|
|
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
|
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
|
- * map_types: array<string, string>,
|
|
|
|
* scalar_types: bool,
|
|
* scalar_types: bool,
|
|
|
|
+ * types_map: array<string, string>,
|
|
* union_types: bool
|
|
* union_types: bool
|
|
* }
|
|
* }
|
|
*
|
|
*
|
|
@@ -97,7 +97,7 @@ abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implem
|
|
->setAllowedTypes(['bool'])
|
|
->setAllowedTypes(['bool'])
|
|
->setDefault(\PHP_VERSION_ID >= 8_00_00)
|
|
->setDefault(\PHP_VERSION_ID >= 8_00_00)
|
|
->getOption(),
|
|
->getOption(),
|
|
- (new FixerOptionBuilder('map_types', 'Map of custom types, eg template types from PHPStan.'))
|
|
|
|
|
|
+ (new FixerOptionBuilder('types_map', 'Map of custom types, e.g. template types from PHPStan.'))
|
|
->setAllowedTypes(['array<string, string>'])
|
|
->setAllowedTypes(['array<string, string>'])
|
|
->setDefault([])
|
|
->setDefault([])
|
|
->getOption(),
|
|
->getOption(),
|
|
@@ -219,8 +219,8 @@ abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implem
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- if (\array_key_exists($commonType, $this->configuration['map_types'])) {
|
|
|
|
- $commonType = $this->configuration['map_types'][$commonType];
|
|
|
|
|
|
+ if (\array_key_exists($commonType, $this->configuration['types_map'])) {
|
|
|
|
+ $commonType = $this->configuration['types_map'][$commonType];
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($this->scalarTypes[$commonType])) {
|
|
if (isset($this->scalarTypes[$commonType])) {
|