Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/provokateurin/php-stubs-updater

Update your PHP stubs for Psalm and PHPStan
https://github.com/provokateurin/php-stubs-updater

Last synced: 7 days ago
JSON representation

Update your PHP stubs for Psalm and PHPStan

Awesome Lists containing this project

README

        

# PHP-Stubs-Generator

*Update your PHP stubs for Psalm and PHPStan.*

## Usage

1. Create a folder to store your stubs (e.g. `tests/stubs`)
2. Create empty files (inside your stubs folder) for the stubs you need following this pattern: `Some\Namespace\SomeClass` =>
`some_namespace_someclass.php`.
3. Collect the list of folders that contain PHP files you need stubs for. Make sure to make this as specific as possible
to reduce the time needed to update the stubs.
4. Run `update-stubs.php tests/stubs folder1 folder2 ...`

### Creating empty stub files

Instead of manually creating the empty stub files manually you can use `generate-empty-psalm-stubs.php` after adding all the stub entries to your psalm.xml.
All missing stub files will be created with empty content.