Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Jan 3, 2026

This rule sposts dim fetch assign to a non-existing variable:

class SomeClass
{
    public function some()
    {
        $dim['key'] = 'value';
    }
}

To use it, add it to your phpstan.neon:

rules:
    - Symplify\PHPStanRules\Rules\Explicit\NoMissingVariableDimFetchRule

Have fun and happy coding 🥳

@TomasVotruba TomasVotruba force-pushed the tv-assign-to-non-existing-dim-fetch branch 2 times, most recently from 3105d70 to 1921449 Compare January 3, 2026 23:10
@TomasVotruba TomasVotruba force-pushed the tv-assign-to-non-existing-dim-fetch branch from 1921449 to 7dbc693 Compare January 3, 2026 23:10
@TomasVotruba TomasVotruba enabled auto-merge (squash) January 3, 2026 23:10
@TomasVotruba TomasVotruba merged commit d3993ea into main Jan 3, 2026
6 of 7 checks passed
@TomasVotruba TomasVotruba deleted the tv-assign-to-non-existing-dim-fetch branch January 3, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants