---
title: "lint/style/no-dynamic-static-call"
pagination: false
---

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

<RuleId id="lint/style/no-dynamic-static-call" />

In the [`coding-style`](/docs/rules/sets/coding-style) set. Report only. Upstream gates: `strictRules.noVariableVariables`.

## What it does

Disallows calling a static method by a variable name (`Foo::$method()`).

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/no-dynamic-static-call" = "error"
```

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

## Replaces

- [`VariableStaticMethodCallRule`](https://github.com/phpstan/phpstan-strict-rules#readme) (phpstan-classes)
- [`staticMethod.dynamicName`](https://phpstan.org/error-identifiers/staticMethod.dynamicName) (phpstan-strict-rules)

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