https://github.com/shipmonk-rnd/phpstan-dev
Smooth tests for PHPStan rules: inplace fixture asserts and autofix!
https://github.com/shipmonk-rnd/phpstan-dev
assert fixture inplace phpstan rule static-analysis
Last synced: 3 months ago
JSON representation
Smooth tests for PHPStan rules: inplace fixture asserts and autofix!
- Host: GitHub
- URL: https://github.com/shipmonk-rnd/phpstan-dev
- Owner: shipmonk-rnd
- License: mit
- Created: 2025-06-11T10:09:31.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2026-01-22T18:23:02.000Z (4 months ago)
- Last Synced: 2026-01-23T11:28:38.969Z (4 months ago)
- Topics: assert, fixture, inplace, phpstan, rule, static-analysis
- Language: PHP
- Homepage:
- Size: 28.3 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPStan Rules Development Utilities
Inplace fixture asserts and autofix for PHPStan rules.
No more manual line adjustments in tests when new code is added to rule fixtures.
## Installation
```bash
composer require --dev shipmonk/phpstan-dev
```
## Usage
```php
*/
class YourRuleTest extends \ShipMonk\PHPStanDev\RuleTestCase
{
public function testRule(): void
{
$this->analyzeFiles([__DIR__ . '/Data/code.php']);
}
}
```
Create test fixture at `code.php`:
```php
analyzeFiles([...], autofix: true);
}
```
**⚠️ Important**: Remove `autofix: true` before committing - tests will fail if autofix is enabled.
## Contributing
- Check your code by `composer check`
- Autofix coding-style by `composer fix:cs`
- All functionality must be tested
## License
MIT