PHP stub declarations for the Freemius WordPress SDK to enhance IDE completion and static analysis capabilities. Generated using php-stubs/generator directly from the source code.
- Complete function, class, and interface declarations
- Constant definitions for proper static analysis
- IDE autocompletion support
- PHPStan integration
- Regular updates with latest Freemius SDK versions
- PHP >= 7.4
- Composer for dependency management
# Install as a development dependency
composer require --dev mralaminahamed/freemius-stubs
# Or specify a version
composer require --dev mralaminahamed/freemius-stubs:^2.0Download the stub files directly:
To use these stubs with PHPStan or your IDE, see our Usage Guide for detailed instructions.
<?php
// Your code will now have full IDE support
$fs = Freemius::instance();
// Constants are properly defined
if (WP_FS__SDK_VERSION) {
// Your implementation
}
// Interfaces and classes are available
class MyIntegration implements Freemius_Api_Interface {
// Your implementation
}For advanced usage examples, see the Usage Guide.
phpstan-freemius-stubs/
├── bin/ # Scripts for generating and releasing stubs
├── configs/ # Configuration files for stub generation
├── docs/ # Detailed documentation
│ ├── usage.md # Usage guide
│ └── contributing.md # Contribution guidelines
├── freemius-constants-stubs.stub # Constants stub file
├── freemius-stubs.stub # Main stubs file with classes and functions
├── freemius_versions.txt # Tracks supported Freemius SDK versions
├── lib/ # Helper libraries
├── phpstan.neon # PHPStan configuration
├── source/ # Source for generating stubs
└── tests/ # Test files
├── bootstrap.php # Test bootstrap
├── ConstantsTest.php # Constants tests
└── FreemiusTest.php # Freemius tests
For information on building stubs, running tests, and contributing to the project, please see our Contributing Guide.
For more detailed information, check out our documentation:
- Usage Guide
- Contributing Guide
- Freemius SDK Documentation
- PHPStan Documentation
- PHP Stubs Generator Documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Freemius for the WordPress SDK
- php-stubs/generator for the stub generation tools
- All contributors to this project
For bug reports and feature requests, please use the GitHub Issues.
For questions and discussions, please use the GitHub Discussions.