---
title: "analyse/classes/invalid-static-method-callable"
pagination: false
---

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

<RuleId id="analyse/classes/invalid-static-method-callable" />

In the [`analyse-basic`](/docs/rules/presets/analyse-basic) preset and every stricter one. Report only.

## What it does

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.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"classes/invalid-static-method-callable" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`StaticMethodCallableRule`](https://phpstan.org/error-identifiers/callable.notSupported) (phpstan-classes)
- [`method.callToAbstract`](https://phpstan.org/error-identifiers/method.callToAbstract) (phpstan)
- [`method.staticCall`](https://phpstan.org/error-identifiers/method.staticCall) (phpstan)
- [`staticMethod.callToAbstract`](https://phpstan.org/error-identifiers/staticMethod.callToAbstract) (phpstan)
- [`staticMethod.nameCase`](https://phpstan.org/error-identifiers/staticMethod.nameCase) (phpstan)
- [`staticMethod.nonObject`](https://phpstan.org/error-identifiers/staticMethod.nonObject) (phpstan)

[More analyse/classes rules](/docs/rules/analyse/classes) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
