---
title: "analyse/types"
pagination: false
---

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

Type declarations, type checks and inferred types. Also in [format](/docs/rules/format/types) (6) and [lint](/docs/rules/lint/types) (77).

**[argument](/docs/rules/analyse/types/argument)**

In the `analyse-basic` preset and every stricter one. Report only.

**[argument-not-numeric](/docs/rules/analyse/types/argument-not-numeric)**

In the `analyse-recommended` preset and every stricter one. Report only. Upstream gates: `bleedingEdge (featureToggles.checkParameterCastableToNumberFunctions)`.

**[argument-not-stringable](/docs/rules/analyse/types/argument-not-stringable)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[arrow-function-nullsafe-by-ref](/docs/rules/analyse/types/arrow-function-nullsafe-by-ref)**

In the `analyse-basic` preset and every stricter one. Report only.

**[arrow-function-param-default](/docs/rules/analyse/types/arrow-function-param-default)**

In the `analyse-essential` preset and every stricter one. Report only.

**[arrow-function-return](/docs/rules/analyse/types/arrow-function-return)**

In the `analyse-essential` preset and every stricter one. Report only.

**[assign-to-this](/docs/rules/analyse/types/assign-to-this)**

In the `analyse-basic` preset and every stricter one. Report only.

**[by-ref-foreach-on-expression](/docs/rules/analyse/types/by-ref-foreach-on-expression)**

In the `analyse-basic` preset and every stricter one. Report only. Upstream gates: `bleedingEdge (featureToggles.assignToByRefForeachExpr)`.

**[call-user-func-argument](/docs/rules/analyse/types/call-user-func-argument)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[catch-non-throwable](/docs/rules/analyse/types/catch-non-throwable)**

In the `analyse-basic` preset and every stricter one. Report only.

**[class-constant-value](/docs/rules/analyse/types/class-constant-value)**

In the `analyse-essential` preset and every stricter one. Report only.

**[clone-non-object](/docs/rules/analyse/types/clone-non-object)**

In the `analyse-essential` preset and every stricter one. Report only.

**[closure-param-default](/docs/rules/analyse/types/closure-param-default)**

In the `analyse-essential` preset and every stricter one. Report only.

**[closure-return](/docs/rules/analyse/types/closure-return)**

In the `analyse-essential` preset and every stricter one. Report only.

**[constant-value](/docs/rules/analyse/types/constant-value)**

In the `analyse-essential` preset and every stricter one. Report only. Upstream gates: `bleedingEdge (featureToggles.checkDynamicConstantNameValues)`.

**[dead-catch](/docs/rules/analyse/types/dead-catch)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[define-value](/docs/rules/analyse/types/define-value)**

In the `analyse-essential` preset and every stricter one. Report only. Upstream gates: `bleedingEdge (featureToggles.checkDynamicConstantNameValues)`.

**[echo-non-string](/docs/rules/analyse/types/echo-non-string)**

In the `analyse-essential` preset and every stricter one. Report only.

**[enum-template-not-allowed](/docs/rules/analyse/types/enum-template-not-allowed)**

In the `analyse-essential` preset and every stricter one. Report only.

**[foreach-non-iterable](/docs/rules/analyse/types/foreach-non-iterable)**

In the `analyse-essential` preset and every stricter one. Report only.

**[foreach-on-empty-array](/docs/rules/analyse/types/foreach-on-empty-array)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[function-return](/docs/rules/analyse/types/function-return)**

In the `analyse-essential` preset and every stricter one. Report only.

**[function-variance](/docs/rules/analyse/types/function-variance)**

In the `analyse-essential` preset and every stricter one. Report only.

**[generator](/docs/rules/analyse/types/generator)**

In the `analyse-essential` preset and every stricter one. Report only.

**[implode-non-string](/docs/rules/analyse/types/implode-non-string)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[interpolated-non-string](/docs/rules/analyse/types/interpolated-non-string)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-arrow-function-signature](/docs/rules/analyse/types/invalid-arrow-function-signature)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-assignment-target](/docs/rules/analyse/types/invalid-assignment-target)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-binary-operation](/docs/rules/analyse/types/invalid-binary-operation)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-cast](/docs/rules/analyse/types/invalid-cast)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-class-generics](/docs/rules/analyse/types/invalid-class-generics)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-class-template](/docs/rules/analyse/types/invalid-class-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-closure-signature](/docs/rules/analyse/types/invalid-closure-signature)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-comparison](/docs/rules/analyse/types/invalid-comparison)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-enum-generics](/docs/rules/analyse/types/invalid-enum-generics)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-function-signature](/docs/rules/analyse/types/invalid-function-signature)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-function-template](/docs/rules/analyse/types/invalid-function-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-hook-signature](/docs/rules/analyse/types/invalid-hook-signature)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-inc-dec](/docs/rules/analyse/types/invalid-inc-dec)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-interface-generics](/docs/rules/analyse/types/invalid-interface-generics)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-interface-template](/docs/rules/analyse/types/invalid-interface-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-method-signature](/docs/rules/analyse/types/invalid-method-signature)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-method-tag-template](/docs/rules/analyse/types/invalid-method-tag-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-method-template](/docs/rules/analyse/types/invalid-method-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-offset](/docs/rules/analyse/types/invalid-offset)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-pipe](/docs/rules/analyse/types/invalid-pipe)**

Reports a pipe callable whose first parameter is passed by reference. A pipe supplies a value, not a reference. The basic preset checks invokable $this receivers; essential and stricter presets check other callable expressions too.

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-property-assignment](/docs/rules/analyse/types/invalid-property-assignment)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-property-type](/docs/rules/analyse/types/invalid-property-type)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-regex](/docs/rules/analyse/types/invalid-regex)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-self-out-tag](/docs/rules/analyse/types/invalid-self-out-tag)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-throws-tag](/docs/rules/analyse/types/invalid-throws-tag)**

Reports `@throws` types that are not subtypes of `Throwable`. Standalone `void` means no exception is thrown. Both branches of a conditional type must be valid. A union containing `void` is invalid.

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-trait-method-tag-template](/docs/rules/analyse/types/invalid-trait-method-tag-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-trait-template](/docs/rules/analyse/types/invalid-trait-template)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-trait-use-generics](/docs/rules/analyse/types/invalid-trait-use-generics)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-unary-operand](/docs/rules/analyse/types/invalid-unary-operand)**

In the `analyse-essential` preset and every stricter one. Report only.

**[invalid-union-type](/docs/rules/analyse/types/invalid-union-type)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-unset](/docs/rules/analyse/types/invalid-unset)**

In the `analyse-basic` preset and every stricter one. Report only.

**[invalid-void-cast](/docs/rules/analyse/types/invalid-void-cast)**

In the `analyse-basic` preset and every stricter one. Report only.

**[method-param-default](/docs/rules/analyse/types/method-param-default)**

In the `analyse-essential` preset and every stricter one. Report only.

**[method-variance](/docs/rules/analyse/types/method-variance)**

In the `analyse-essential` preset and every stricter one. Report only.

**[missing-constant-type](/docs/rules/analyse/types/missing-constant-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-hook-throws](/docs/rules/analyse/types/missing-hook-throws)**

In the `analyse-max` preset. Report only. Upstream gates: `exceptions.check.missingCheckedExceptionInThrows`.

**[missing-method-param-type](/docs/rules/analyse/types/missing-method-param-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-method-return-type](/docs/rules/analyse/types/missing-method-return-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-method-throws](/docs/rules/analyse/types/missing-method-throws)**

In the `analyse-max` preset. Report only. Upstream gates: `exceptions.check.missingCheckedExceptionInThrows`.

**[missing-param-type](/docs/rules/analyse/types/missing-param-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-preg-quote-delimiter](/docs/rules/analyse/types/missing-preg-quote-delimiter)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[missing-property-type](/docs/rules/analyse/types/missing-property-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-return](/docs/rules/analyse/types/missing-return)**

In the `analyse-basic` preset and every stricter one. Report only.

**[missing-return-type](/docs/rules/analyse/types/missing-return-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-self-out-type](/docs/rules/analyse/types/missing-self-out-type)**

In the `analyse-strict` preset and every stricter one. Report only.

**[missing-throws](/docs/rules/analyse/types/missing-throws)**

In the `analyse-max` preset. Report only. Upstream gates: `exceptions.check.missingCheckedExceptionInThrows`.

**[nullsafe-by-ref-return](/docs/rules/analyse/types/nullsafe-by-ref-return)**

In the `analyse-basic` preset and every stricter one. Report only.

**[offset-assign](/docs/rules/analyse/types/offset-assign)**

In the `analyse-essential` preset and every stricter one. Report only.

**[offset-assign-op](/docs/rules/analyse/types/offset-assign-op)**

In the `analyse-essential` preset and every stricter one. Report only.

**[offset-assign-value](/docs/rules/analyse/types/offset-assign-value)**

In the `analyse-essential` preset and every stricter one. Report only.

**[param-default](/docs/rules/analyse/types/param-default)**

In the `analyse-essential` preset and every stricter one. Report only.

**[param-out](/docs/rules/analyse/types/param-out)**

In the `analyse-essential` preset and every stricter one. Report only.

**[param-out-at-end](/docs/rules/analyse/types/param-out-at-end)**

In the `analyse-essential` preset and every stricter one. Report only.

**[phpdoc-readonly-by-ref](/docs/rules/analyse/types/phpdoc-readonly-by-ref)**

In the `analyse-essential` preset and every stricter one. Report only.

**[phpdoc-readonly-property-write](/docs/rules/analyse/types/phpdoc-readonly-property-write)**

In the `analyse-essential` preset and every stricter one. Report only.

**[print-non-string](/docs/rules/analyse/types/print-non-string)**

In the `analyse-essential` preset and every stricter one. Report only.

**[printf-argument](/docs/rules/analyse/types/printf-argument)**

In the `analyse-recommended` preset and every stricter one. Report only. Upstream gates: `bleedingEdge (featureToggles.checkPrintfParameterTypes)`.

**[property-assign](/docs/rules/analyse/types/property-assign)**

In the `analyse-essential` preset and every stricter one. Report only.

**[property-default](/docs/rules/analyse/types/property-default)**

In the `analyse-essential` preset and every stricter one. Report only.

**[property-variance](/docs/rules/analyse/types/property-variance)**

In the `analyse-essential` preset and every stricter one. Report only.

**[random-int-range](/docs/rules/analyse/types/random-int-range)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[readonly-property-by-ref](/docs/rules/analyse/types/readonly-property-by-ref)**

In the `analyse-essential` preset and every stricter one. Report only.

**[readonly-property-write](/docs/rules/analyse/types/readonly-property-write)**

In the `analyse-essential` preset and every stricter one. Report only.

**[redundant-array-values](/docs/rules/analyse/types/redundant-array-values)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[renamed-parameter-in-subtype](/docs/rules/analyse/types/renamed-parameter-in-subtype)**

In the `analyse-basic` preset and every stricter one. Report only.

**[return](/docs/rules/analyse/types/return)**

In the `analyse-essential` preset and every stricter one. Report only.

**[return-by-ref-finally](/docs/rules/analyse/types/return-by-ref-finally)**

In the `analyse-essential` preset and every stricter one. Report only. **Planned: not in Pun yet.** Enabling it is a config error.

**[sort-non-stringable](/docs/rules/analyse/types/sort-non-stringable)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[this-in-global](/docs/rules/analyse/types/this-in-global)**

In the `analyse-basic` preset and every stricter one. Report only.

**[this-in-static](/docs/rules/analyse/types/this-in-static)**

In the `analyse-basic` preset and every stricter one. Report only.

**[throw-non-throwable](/docs/rules/analyse/types/throw-non-throwable)**

In the `analyse-essential` preset and every stricter one. Report only.

**[throws-not-covariant](/docs/rules/analyse/types/throws-not-covariant)**

In the `analyse-basic` preset and every stricter one. Report only. Upstream gates: `exceptions.check.throwTypeCovariance`.

**[throws-void-function](/docs/rules/analyse/types/throws-void-function)**

In the `analyse-essential` preset and every stricter one. Report only.

**[throws-void-hook](/docs/rules/analyse/types/throws-void-hook)**

In the `analyse-essential` preset and every stricter one. Report only.

**[throws-void-method](/docs/rules/analyse/types/throws-void-method)**

In the `analyse-essential` preset and every stricter one. Report only.

**[too-wide-arrow-function-return](/docs/rules/analyse/types/too-wide-arrow-function-return)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[too-wide-closure-return](/docs/rules/analyse/types/too-wide-closure-return)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[too-wide-function-param-out](/docs/rules/analyse/types/too-wide-function-param-out)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[too-wide-function-return](/docs/rules/analyse/types/too-wide-function-return)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[too-wide-method-param-out](/docs/rules/analyse/types/too-wide-method-param-out)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[too-wide-method-return](/docs/rules/analyse/types/too-wide-method-return)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[too-wide-property](/docs/rules/analyse/types/too-wide-property)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[unpack-non-iterable](/docs/rules/analyse/types/unpack-non-iterable)**

In the `analyse-essential` preset and every stricter one. Report only.

**[unpack-string-key](/docs/rules/analyse/types/unpack-string-key)**

In the `analyse-essential` preset and every stricter one. Report only.

**[unused-hook-throws-type](/docs/rules/analyse/types/unused-hook-throws-type)**

In the `analyse-recommended` preset and every stricter one. Report only. Upstream gates: `exceptions.check.tooWideThrowType`.

**[unused-method-throws-type](/docs/rules/analyse/types/unused-method-throws-type)**

In the `analyse-recommended` preset and every stricter one. Report only. Upstream gates: `exceptions.check.tooWideThrowType`.

**[unused-throws-type](/docs/rules/analyse/types/unused-throws-type)**

In the `analyse-recommended` preset and every stricter one. Report only. Upstream gates: `exceptions.check.tooWideThrowType`.

**[useless-array-filter](/docs/rules/analyse/types/useless-array-filter)**

In the `analyse-recommended` preset and every stricter one. Report only.

**[void-match-used](/docs/rules/analyse/types/void-match-used)**

In the `analyse-essential` preset and every stricter one. Report only.

**[write-to-readonly-property](/docs/rules/analyse/types/write-to-readonly-property)**

In the `analyse-basic` preset and every stricter one. Report only.

**[yield-from-non-iterable](/docs/rules/analyse/types/yield-from-non-iterable)**

In the `analyse-essential` preset and every stricter one. Report only.

**[yield-outside-function](/docs/rules/analyse/types/yield-outside-function)**

In the `analyse-essential` preset and every stricter one. Report only.
