Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soyhuce/phpstan-extension
Extra rules for phpstan analysis
https://github.com/soyhuce/phpstan-extension
hacktoberfest laravel phpstan
Last synced: 2 months ago
JSON representation
Extra rules for phpstan analysis
- Host: GitHub
- URL: https://github.com/soyhuce/phpstan-extension
- Owner: Soyhuce
- License: mit
- Created: 2022-03-11T07:19:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T07:12:24.000Z (7 months ago)
- Last Synced: 2024-11-24T20:50:10.720Z (2 months ago)
- Topics: hacktoberfest, laravel, phpstan
- Language: PHP
- Homepage:
- Size: 76.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Extra rules for phpstan analysis
[![Latest Version on Packagist](https://img.shields.io/packagist/v/soyhuce/phpstan-extension.svg?style=flat-square)](https://packagist.org/packages/soyhuce/phpstan-extension)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/soyhuce/phpstan-extension/run-tests?label=tests)](https://github.com/soyhuce/phpstan-extension/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/soyhuce/phpstan-extension/Check%20&%20fix%20styling?label=code%20style)](https://github.com/soyhuce/phpstan-extension/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![GitHub PHPStan Action Status](https://img.shields.io/github/workflow/status/soyhuce/phpstan-extension/PHPStan?label=phpstan)](https://github.com/soyhuce/phpstan-extension/actions?query=workflow%3APHPStan+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/soyhuce/phpstan-extension.svg?style=flat-square)](https://packagist.org/packages/soyhuce/phpstan-extension)Strict rules for PHPStan and helpers for Laravel
## Installation
You can install the package via composer:
```bash
composer require --dev soyhuce/phpstan-extension
```If you use `phpstan/extension-installer`, the extension is automatically installed and you're all set.
Otherwise, you need to add the extension in your `phpstan.neon` file:
```neon
includes:
- ./vendor/soyhuce/phpstan-extension/extension.neon
```If you want only a subset of the rules, check the `/vendor/soyhuce/phpstan-extension/extension.neon` file and copy the
rules you want to use.## Rules
### CarbonCopyRule
Forbids usage of `\Carbon\CarbonInterface::copy()` because it is probably linked to usage of a mutable DateTime.
```php
copy()->addDay(); // ko
$datetime->addDay(); // ok
```### NoAliasUseRule
Forbids usage of Laravel aliases and suggests to use the real class name instead.
```php
date('published_at'); // CarbonImmutable|null
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Bastien Philippe](https://github.com/bastien-phi)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.