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

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

Class, interface, trait and enum declarations and their members. Also in [format](/docs/rules/format/classes) (8) and [lint](/docs/rules/lint/classes) (15).

**[abstract-method-in-concrete-class](/docs/rules/analyse/classes/abstract-method-in-concrete-class)**

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

**[abstract-private-method](/docs/rules/analyse/classes/abstract-private-method)**

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

**[callable-property-type](/docs/rules/analyse/classes/callable-property-type)**

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

**[class-named-constant](/docs/rules/analyse/classes/class-named-constant)**

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

**[conflicting-trait-constant](/docs/rules/analyse/classes/conflicting-trait-constant)**

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

**[constant-in-trait](/docs/rules/analyse/classes/constant-in-trait)**

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

**[constructor-with-return-type](/docs/rules/analyse/classes/constructor-with-return-type)**

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

**[disallowed-subtype](/docs/rules/analyse/classes/disallowed-subtype)**

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

**[duplicate-declaration](/docs/rules/analyse/classes/duplicate-declaration)**

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

**[duplicate-trait-member](/docs/rules/analyse/classes/duplicate-trait-member)**

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

**[dynamic-static-call](/docs/rules/analyse/classes/dynamic-static-call)**

In the `analyse-strict` preset and every stricter one. Report only. Upstream gates: `strictRules.dynamicCallOnStaticMethod`.

**[dynamic-static-callable](/docs/rules/analyse/classes/dynamic-static-callable)**

In the `analyse-strict` preset and every stricter one. Report only. Upstream gates: `strictRules.dynamicCallOnStaticMethod`.

**[enum-case-outside-enum](/docs/rules/analyse/classes/enum-case-outside-enum)**

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

**[final-constant-not-supported](/docs/rules/analyse/classes/final-constant-not-supported)**

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

**[final-private-constant](/docs/rules/analyse/classes/final-private-constant)**

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

**[final-private-method](/docs/rules/analyse/classes/final-private-method)**

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

**[get-hook-without-read](/docs/rules/analyse/classes/get-hook-without-read)**

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

**[inaccessible-class-constant](/docs/rules/analyse/classes/inaccessible-class-constant)**

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

**[inaccessible-method](/docs/rules/analyse/classes/inaccessible-method)**

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

**[inaccessible-property](/docs/rules/analyse/classes/inaccessible-property)**

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

**[incompatible-constant-override](/docs/rules/analyse/classes/incompatible-constant-override)**

Reports overrides of final constants, reduced constant visibility, and incompatible native or PHPDoc constant types. Native and PHPDoc covariance checks run with the essential preset and stricter presets.

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

**[incompatible-override](/docs/rules/analyse/classes/incompatible-override)**

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

**[incompatible-property-override](/docs/rules/analyse/classes/incompatible-property-override)**

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

**[inconsistent-constructor](/docs/rules/analyse/classes/inconsistent-constructor)**

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

**[internal-class-usage](/docs/rules/analyse/classes/internal-class-usage)**

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

**[internal-constant-access](/docs/rules/analyse/classes/internal-constant-access)**

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

**[internal-method-call](/docs/rules/analyse/classes/internal-method-call)**

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

**[internal-method-callable](/docs/rules/analyse/classes/internal-method-callable)**

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

**[internal-property-access](/docs/rules/analyse/classes/internal-property-access)**

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

**[internal-static-method-call](/docs/rules/analyse/classes/internal-static-method-call)**

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

**[internal-static-method-callable](/docs/rules/analyse/classes/internal-static-method-callable)**

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

**[internal-static-property-access](/docs/rules/analyse/classes/internal-static-property-access)**

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

**[invalid-dynamic-constant-fetch](/docs/rules/analyse/classes/invalid-dynamic-constant-fetch)**

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

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

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

**[invalid-enum-implements](/docs/rules/analyse/classes/invalid-enum-implements)**

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

**[invalid-extends](/docs/rules/analyse/classes/invalid-extends)**

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

**[invalid-implements](/docs/rules/analyse/classes/invalid-implements)**

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

**[invalid-interface-extends](/docs/rules/analyse/classes/invalid-interface-extends)**

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

**[invalid-interface-property](/docs/rules/analyse/classes/invalid-interface-property)**

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

**[invalid-method-callable](/docs/rules/analyse/classes/invalid-method-callable)**

Checks the receiver, method existence and visibility when creating a first-class instance method callable. Callable creation does not pass arguments to the method. The check-function-name-case option also checks method spelling.

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

**[invalid-new](/docs/rules/analyse/classes/invalid-new)**

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

**[invalid-phpdoc-readonly](/docs/rules/analyse/classes/invalid-phpdoc-readonly)**

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

**[invalid-promoted-property](/docs/rules/analyse/classes/invalid-promoted-property)**

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

**[invalid-property-declaration](/docs/rules/analyse/classes/invalid-property-declaration)**

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

**[invalid-property-hook](/docs/rules/analyse/classes/invalid-property-hook)**

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

**[invalid-readonly-property](/docs/rules/analyse/classes/invalid-readonly-property)**

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

**[invalid-static-method-callable](/docs/rules/analyse/classes/invalid-static-method-callable)**

Checks class and method existence, visibility, static-call rules and abstract methods when creating a first-class static method callable. Callable creation does not pass arguments. The check-function-name-case option also checks method spelling.

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

**[missing-method-implementation](/docs/rules/analyse/classes/missing-method-implementation)**

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

**[missing-parent-constructor-call](/docs/rules/analyse/classes/missing-parent-constructor-call)**

In the `analyse-strict` preset and every stricter one. Report only. Upstream gates: `strictRules.requireParentConstructorCall`.

**[missing-required-interface](/docs/rules/analyse/classes/missing-required-interface)**

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

**[missing-required-parent](/docs/rules/analyse/classes/missing-required-parent)**

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

**[missing-serialize-methods](/docs/rules/analyse/classes/missing-serialize-methods)**

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

**[new-as-callable](/docs/rules/analyse/classes/new-as-callable)**

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

**[new-static-in-abstract](/docs/rules/analyse/classes/new-static-in-abstract)**

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

**[non-public-interface-method](/docs/rules/analyse/classes/non-public-interface-method)**

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

**[private-consistent-constructor](/docs/rules/analyse/classes/private-consistent-constructor)**

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

**[read-write-only-property](/docs/rules/analyse/classes/read-write-only-property)**

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

**[readonly-class-not-supported](/docs/rules/analyse/classes/readonly-class-not-supported)**

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

**[set-hook-without-assign](/docs/rules/analyse/classes/set-hook-without-assign)**

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

**[typed-constant-not-supported](/docs/rules/analyse/classes/typed-constant-not-supported)**

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

**[uninitialized-phpdoc-readonly](/docs/rules/analyse/classes/uninitialized-phpdoc-readonly)**

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

**[uninitialized-property](/docs/rules/analyse/classes/uninitialized-property)**

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

**[uninitialized-readonly](/docs/rules/analyse/classes/uninitialized-readonly)**

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

**[unsafe-new-static](/docs/rules/analyse/classes/unsafe-new-static)**

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