pedro-mendonca / glotpress-stubs
GlotPress function and class declaration stubs for static analysis.
Fund package maintenance!
pedro-mendonca
Installs: 8 150
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires (Dev)
- php: ^7.2
- ergebnis/composer-normalize: ^2.43.0
- php-stubs/generator: ^0.8.4
- php-stubs/wordpress-stubs: ^6.6.0
- dev-main
- 4.0.1
- 4.0.0
- 4.0.0-rc.1
- 4.0.0-beta.3
- 4.0.0-beta.2
- 4.0.0-beta.1
- 4.0.0-alpha.11
- 4.0.0-alpha.10
- 4.0.0-alpha.9
- 4.0.0-alpha.8
- 4.0.0-alpha.7
- 4.0.0-alpha.6
- 4.0.0-alpha.5
- 4.0.0-alpha.4
- 4.0.0-alpha.3
- 4.0.0-alpha.2
- 4.0.0-alpha.1
- 3.0.0
- 3.0.0-rc.4
- 3.0.0-rc.3
- 3.0.0-rc.2
- 3.0.0-rc.1
- 3.0.0-beta.1
- 3.0.0-alpha.4
- 3.0.0-alpha.3
- 3.0.0-alpha.2
- 3.0.0-alpha.1
- 2.3.1
This package is auto-updated.
Last update: 2024-10-26 00:10:00 UTC
README
GlotPress function and class declaration stubs for static analysis.
This package provides stub declarations for GlotPress functions, classes and interfaces.
These stubs can help plugin and theme developers leverage static analysis tools like PHPStan, which are unable to parse GlotPress as it is not clean OOP code.
Stubs are generated directly from the source using php-stubs/generator.
Requirements
- PHP >=7.2
Installation
Require this package as a development dependency with Composer.
composer require --dev pedro-mendonca/glotpress-stubs
Alternatively you may download glotpress-stubs.php
directly.
Usage in PHPStan
Include all stubs in PHPStan configuration file.
You can remove the # WordPress Stubs
lines if you already use WordPress extensions for PHPStan.
parameters: scanFiles: # WordPress Stubs - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php # GlotPress Stubs - %rootDir%/../../pedro-mendonca/glotpress-stubs/glotpress-stubs.php