php-decimal/stubs
IDE and static analysis stubs for the PHP Decimal extension. Provides PHP method/function signatures to improve autocompletion and type checking without requiring the extension source. For installing the actual extension, see php-decimal/php-decimal.
php-decimal extension, enabling better IDE autocompletion, static analysis (e.g., PHPStan, Psalm), and tooling support (e.g., PHPStorm, VSCode). It does not modify runtime behavior—it’s purely a developer experience (DX) enhancement.php-decimal: Requires the underlying php-decimal/php-decimal extension to be installed and functional. Without it, the stubs are inert.php-decimal without coupling to other systems.php-decimal extension (PECL or Docker-based).php-decimal/stubs).psalm.xml).php-decimal extension’s behavior, leading to:
php-decimal extension version.php-decimal evolves (e.g., new methods, deprecated features), stubs may become stale.
php-decimal updates and refresh stubs as needed.php-decimal already in use, or is this a new adoption?
php-decimal extension versioned?
php-decimal?
php-decimal for precise decimal arithmetic (e.g., financial apps).php-decimal extension is installed and functional.
php -m | grep decimal or php -r 'var_dump(class_exists("Decimal"));'.composer require --dev php-decimal/stubs
Settings > Languages & Frameworks > PHP > Stub files.psalm.xml:
<file-list include-internal-dirs="true">
<directory>vendor/php-decimal/stubs</directory>
</file-list>
psalm.xml.Decimal class methods.php-decimal itself changes.php-decimal version in use.
php-decimal:1.3.0, ensure stubs are from the same release.php-decimal extension and test basic functionality.php-decimal extension changes.php-decimal/stubs updates alongside the extension.composer.json to avoid surprises:
"require-dev": {
"php-decimal/stubs": "1.3.0"
}
composer show php-decimal/stubs to verify installed version.php-decimal/stubs repo.php-decimal extension issues, use its issue tracker.php-decimal.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Stubs version ≠ extension version | IDE warnings, static analysis errors | Pin versions in composer.json; validate alignment. |
| IDE misconfiguration | No autocompletion/static analysis | Document setup steps; provide templates. |
php-decimal extension missing |
Stubs are inert | Enforce extension as a runtime dependency. |
| Static analysis tool ignores stubs | False negatives/positives | Test tools with stubs in a staging environment. |
| Stub files corrupted | Broken IDE/tool integration | Use Composer’s vendor directory (versioned). |
How can I help you explore Laravel packages today?