---
title: "rector/type-declaration set"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Rector's `type-declaration` set: the Pun lint rules its Rector rules map to, and nothing else.

```toml
[lint]
sets = ["rector/type-declaration"]
```

A rule merged from several Rector rules runs only the rewrites of this set's Rector rules, unless a [preset](/docs/configuration/presets#lint-presets) also turns it on. Rector rules that are format rules in Pun run under `[format]` instead. Laravel, Pest, and PHPUnit rules also need their [extension](/docs/configuration/pun-toml#extensions).

## Rules (61)

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`lint/phpunit/add-closure-return-type-from-assert`](/docs/rules/lint/phpunit/add-closure-return-type-from-assert) | `ClosureReturnTypeFromAssertInstanceOfRector` | Ported |
| [`lint/phpunit/add-data-provider-iterator-return-type`](/docs/rules/lint/phpunit/add-data-provider-iterator-return-type) | `ReturnIteratorInDataProviderRector` | Ported |
| [`lint/phpunit/add-property-type-container-get`](/docs/rules/lint/phpunit/add-property-type-container-get) | `TypedPropertyFromContainerGetSetUpRector` | Ported |
| [`lint/phpunit/add-property-type-create-mock`](/docs/rules/lint/phpunit/add-property-type-create-mock) | `TypedPropertyFromCreateMockAssignRector` | Ported |
| [`lint/phpunit/add-property-type-setup`](/docs/rules/lint/phpunit/add-property-type-setup) | `TypedPropertyFromStrictSetUpRector` | Ported |
| [`lint/phpunit/add-property-type-setup-docblock`](/docs/rules/lint/phpunit/add-property-type-setup-docblock) | `TypedPropertyFromDocblockSetUpDefinedRector` | Ported |
| [`lint/phpunit/add-return-type-from-mock-object`](/docs/rules/lint/phpunit/add-return-type-from-mock-object) | `ReturnTypeFromMockObjectRector` | Ported |
| [`lint/phpunit/add-test-void-return`](/docs/rules/lint/phpunit/add-test-void-return) | `AddTestsVoidReturnTypeWhereNoReturnRector` | Ported |
| [`lint/types/add-array-return-type`](/docs/rules/lint/types/add-array-return-type) | `ReturnTypeFromReturnDirectArrayRector` | Ported |
| [`lint/types/add-arrow-function-return-type`](/docs/rules/lint/types/add-arrow-function-return-type) | `AddArrowFunctionReturnTypeRector` | Ported |
| [`lint/types/add-bool-return-type`](/docs/rules/lint/types/add-bool-return-type) | `BoolReturnTypeFromBooleanStrictReturnsRector` | Ported |
| [`lint/types/add-bool-return-type-from-const`](/docs/rules/lint/types/add-bool-return-type-from-const) | `BoolReturnTypeFromBooleanConstReturnsRector` | Ported |
| [`lint/types/add-bool-return-type-from-mixed-returns`](/docs/rules/lint/types/add-bool-return-type-from-mixed-returns) | `BoolReturnTypeFromBooleanConstAndStrictReturnsRector` | Ported |
| [`lint/types/add-closure-never-return`](/docs/rules/lint/types/add-closure-never-return) | `AddClosureNeverReturnTypeRector` | Ported |
| [`lint/types/add-closure-return-type`](/docs/rules/lint/types/add-closure-return-type) | `ClosureReturnTypeRector` | Ported |
| [`lint/types/add-closure-void-return`](/docs/rules/lint/types/add-closure-void-return) | `AddClosureVoidReturnTypeWhereNoReturnRector` | Ported |
| [`lint/types/add-datetime-property-type`](/docs/rules/lint/types/add-datetime-property-type) | `MergeDateTimePropertyTypeDeclarationRector` | Ported |
| [`lint/types/add-fluent-return-type`](/docs/rules/lint/types/add-fluent-return-type) | `ReturnTypeFromStrictFluentReturnRector` | Ported |
| [`lint/types/add-function-void-return`](/docs/rules/lint/types/add-function-void-return) | `AddFunctionVoidReturnTypeWhereNoReturnRector` | Ported |
| [`lint/types/add-magic-method-return-type`](/docs/rules/lint/types/add-magic-method-return-type) | `KnownMagicClassMethodTypeRector` | Ported |
| [`lint/types/add-method-void-return`](/docs/rules/lint/types/add-method-void-return) | `AddVoidReturnTypeWhereNoReturnRector` | Ported |
| [`lint/types/add-never-return-type`](/docs/rules/lint/types/add-never-return-type) | `ReturnNeverTypeRector` | Ported |
| [`lint/types/add-nullable-return-type`](/docs/rules/lint/types/add-nullable-return-type) | `ReturnNullableTypeRector` | Ported |
| [`lint/types/add-numeric-return-type`](/docs/rules/lint/types/add-numeric-return-type) | `NumericReturnTypeFromStrictReturnsRector` | Ported |
| [`lint/types/add-numeric-return-type-from-scalar`](/docs/rules/lint/types/add-numeric-return-type-from-scalar) | `NumericReturnTypeFromStrictScalarReturnsRector` | Ported |
| [`lint/types/add-param-type-array-any-all`](/docs/rules/lint/types/add-param-type-array-any-all) | `AddArrayAnyAllClosureParamTypeRector` | Ported |
| [`lint/types/add-param-type-array-dim-fetch`](/docs/rules/lint/types/add-param-type-array-dim-fetch) | `StrictArrayParamDimFetchRector` | Ported |
| [`lint/types/add-param-type-array-function`](/docs/rules/lint/types/add-param-type-array-function) | `AddArrayFunctionClosureParamTypeRector` | Ported |
| [`lint/types/add-param-type-array-map`](/docs/rules/lint/types/add-param-type-array-map) | `AddClosureParamTypeForArrayMapRector` | Ported |
| [`lint/types/add-param-type-array-reduce`](/docs/rules/lint/types/add-param-type-array-reduce) | `AddClosureParamTypeForArrayReduceRector` | Ported |
| [`lint/types/add-param-type-arrow-dim-fetch`](/docs/rules/lint/types/add-param-type-arrow-dim-fetch) | `AddArrowFunctionParamArrayWhereDimFetchRector` | Ported |
| [`lint/types/add-param-type-data-provider`](/docs/rules/lint/types/add-param-type-data-provider) | `AddParamTypeBasedOnPHPUnitDataProviderRector` | Ported |
| [`lint/types/add-param-type-dim-fetch-key`](/docs/rules/lint/types/add-param-type-dim-fetch-key) | `AddParamFromDimFetchKeyUseRector` | Ported |
| [`lint/types/add-param-type-iterable-method-call`](/docs/rules/lint/types/add-param-type-iterable-method-call) | `AddClosureParamTypeFromIterableMethodCallRector` | Ported |
| [`lint/types/add-param-type-method-call`](/docs/rules/lint/types/add-param-type-method-call) | `AddMethodCallBasedStrictParamTypeRector` | Ported |
| [`lint/types/add-param-type-property`](/docs/rules/lint/types/add-param-type-property) | `AddParamTypeFromPropertyTypeRector` | Ported |
| [`lint/types/add-param-type-spl-fixed-array`](/docs/rules/lint/types/add-param-type-spl-fixed-array) | `AddParamTypeSplFixedArrayRector` | Ported |
| [`lint/types/add-param-type-variable-call`](/docs/rules/lint/types/add-param-type-variable-call) | `AddClosureParamTypeFromVariableCallRector` | Ported |
| [`lint/types/add-private-method-array-return-type`](/docs/rules/lint/types/add-private-method-array-return-type) | `PrivateMethodReturnTypeFromStrictNewArrayRector` | Ported |
| [`lint/types/add-property-type-assigns`](/docs/rules/lint/types/add-property-type-assigns) | `TypedPropertyFromAssignsRector` | Ported |
| [`lint/types/add-property-type-constructor`](/docs/rules/lint/types/add-property-type-constructor) | `TypedPropertyFromStrictConstructorRector` | Ported |
| [`lint/types/add-property-type-get-repository`](/docs/rules/lint/types/add-property-type-get-repository) | `TypedPropertyFromGetRepositorySetUpRector` | Ported |
| [`lint/types/add-property-type-setter-getter`](/docs/rules/lint/types/add-property-type-setter-getter) | `PropertyTypeFromStrictSetterGetterRector` | Ported |
| [`lint/types/add-return-type-from-cast`](/docs/rules/lint/types/add-return-type-from-cast) | `ReturnTypeFromReturnCastRector` | Ported |
| [`lint/types/add-return-type-from-constant`](/docs/rules/lint/types/add-return-type-from-constant) | `ReturnTypeFromStrictConstantReturnRector` | Ported |
| [`lint/types/add-return-type-from-get-repository`](/docs/rules/lint/types/add-return-type-from-get-repository) | `ReturnTypeFromGetRepositoryDocblockRector` | Ported |
| [`lint/types/add-return-type-from-native-call`](/docs/rules/lint/types/add-return-type-from-native-call) | `ReturnTypeFromStrictNativeCallRector` | Ported |
| [`lint/types/add-return-type-from-new`](/docs/rules/lint/types/add-return-type-from-new) | `ReturnTypeFromReturnNewRector` | Ported |
| [`lint/types/add-return-type-from-new-array`](/docs/rules/lint/types/add-return-type-from-new-array) | `ReturnTypeFromStrictNewArrayRector` | Ported |
| [`lint/types/add-return-type-from-param`](/docs/rules/lint/types/add-return-type-from-param) | `ReturnTypeFromStrictParamRector` | Ported |
| [`lint/types/add-return-type-from-parent`](/docs/rules/lint/types/add-return-type-from-parent) | `AddReturnTypeDeclarationBasedOnParentClassMethodRector` | Ported |
| [`lint/types/add-return-type-from-property`](/docs/rules/lint/types/add-return-type-from-property) | `ReturnTypeFromStrictTypedPropertyRector` | Ported |
| [`lint/types/add-return-type-from-ternary`](/docs/rules/lint/types/add-return-type-from-ternary) | `ReturnTypeFromStrictTernaryRector` | Ported |
| [`lint/types/add-return-type-from-try-catch`](/docs/rules/lint/types/add-return-type-from-try-catch) | `AddReturnTypeFromTryCatchTypeRector` | Ported |
| [`lint/types/add-return-type-from-typed-call`](/docs/rules/lint/types/add-return-type-from-typed-call) | `ReturnTypeFromStrictTypedCallRector` | Ported |
| [`lint/types/add-return-type-from-yield`](/docs/rules/lint/types/add-return-type-from-yield) | `AddReturnTypeDeclarationFromYieldsRector` | Ported |
| [`lint/types/add-string-return-type`](/docs/rules/lint/types/add-string-return-type) | `StringReturnTypeFromStrictStringReturnsRector` | Ported |
| [`lint/types/add-string-return-type-from-scalar`](/docs/rules/lint/types/add-string-return-type-from-scalar) | `StringReturnTypeFromStrictScalarReturnsRector` | Ported |
| [`lint/types/add-union-return-type`](/docs/rules/lint/types/add-union-return-type) | `ReturnUnionTypeRector` | Ported |
| [`lint/types/prefer-narrow-param-type`](/docs/rules/lint/types/prefer-narrow-param-type) | `NarrowArrayAnyAllNullableParamTypeRector` | Ported |
| [`lint/types/prefer-specific-return-type`](/docs/rules/lint/types/prefer-specific-return-type) | `NarrowObjectReturnTypeRector` | Ported |
