Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/socheatsok78/laravel-psalm-helper
A zero-config installer for Psalm (a static analysis tool that’s designed to improve large PHP codebases by identifying both obvious and hard-to-spot bugs)
https://github.com/socheatsok78/laravel-psalm-helper
laravel laravel-helpers laravel-psalm-helper metapackage php-codebases psalm psalm-plugin spot-bugs static-analysis
Last synced: 2 days ago
JSON representation
A zero-config installer for Psalm (a static analysis tool that’s designed to improve large PHP codebases by identifying both obvious and hard-to-spot bugs)
- Host: GitHub
- URL: https://github.com/socheatsok78/laravel-psalm-helper
- Owner: socheatsok78
- License: mit
- Created: 2019-12-13T03:12:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T00:22:35.000Z (over 4 years ago)
- Last Synced: 2024-12-15T19:06:38.862Z (7 days ago)
- Topics: laravel, laravel-helpers, laravel-psalm-helper, metapackage, php-codebases, psalm, psalm-plugin, spot-bugs, static-analysis
- Homepage: https://packagist.org/packages/socheatsok78/laravel-psalm-helper
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Psalm Helper
A zero-config installer for Psalm (a static analysis tool that’s designed to improve large PHP codebases by identifying both obvious and hard-to-spot bugs)
[![Required: PHP7.2](https://img.shields.io/packagist/php-v/socheatsok78/laravel-psalm-helper)](https://packagist.org/packages/socheatsok78/laravel-psalm-helper) [![packagis](https://img.shields.io/packagist/v/socheatsok78/laravel-psalm-helper)](https://packagist.org/packages/socheatsok78/laravel-psalm-helper) [![packagis-download](https://img.shields.io/packagist/dm/socheatsok78/laravel-psalm-helper)](https://packagist.org/packages/socheatsok78/laravel-psalm-helper) [![License](https://img.shields.io/github/license/socheatsok78/laravel-psalm-helper)](./LICENSE)
## Installaion
```bash
composer require --dev socheatsok78/laravel-psalm-helper
```Add the following script to `composer.json`:
```json
"scripts": {
"psalm": [
"vendor/bin/psalm --show-info=false"
],
"psalm:info": [
"vendor/bin/psalm --show-info=true"
],
"psalm:dry-run": [
"vendor/bin/psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType --dry-run"
],
"psalm:alter": [
"vendor/bin/psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType"
]
}
```
Then later you can just run `composer run psalm`### Usage
Add a `psalm.xml` config:
```bash
./vendor/bin/psalm --init [source_directory=src] [config_level=3]
```where `config_level` represents how strict you want Psalm to be. `1` is the strictest, `8` is the most lenient.
Example:
```console
$ ./vendor/bin/psalm --init
Config file created successfully. Please re-run psalm.$ ./vendor/bin/psalm-plugin enable psalm/plugin-laravel
[OK] Plugin enabled
```Then run Psalm:
```bash
./vendor/bin/psalm
```See more at [Psalm Documentation](https://psalm.dev/docs/)
## What's inside?
This package will only install the following dependencies:
- [vimeo/psalm](https://github.com/vimeo/psalm)
- [psalm/laravel-psalm-plugin](https://github.com/psalm/laravel-psalm-plugin)## :memo: License
Licensed under the [MIT License](./LICENSE).