Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Stubs Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Precision Financial Calculations: Enables seamless integration of the php-decimal extension for high-precision arithmetic (e.g., banking, e-commerce, or scientific computing) by providing IDE autocompletion and static analysis support.
  • Developer Productivity: Reduces onboarding time for engineers unfamiliar with the php-decimal extension by offering IDE-friendly stubs (e.g., PhpStorm, VSCode) for type hints, method signatures, and documentation.
  • Static Analysis & CI/CD: Facilitates linting, type-checking (e.g., PHPStan, Psalm), and IDE warnings by ensuring the extension’s API is recognized as a first-class citizen in tooling.
  • Roadmap for PHP-Native Decimals: Supports a future where PHP natively handles arbitrary-precision decimals (e.g., via RFCs like RFC for Decimal Type) by bridging the gap with the php-decimal extension today.
  • Build vs. Buy: Avoids reinventing stubs for the php-decimal extension, saving dev time while maintaining compatibility with existing PHP tooling.

When to Consider This Package

  • Adopt if:

    • Your product requires arbitrary-precision decimal arithmetic (e.g., currency, tax calculations, or statistical models) and PHP’s native float/double types are insufficient.
    • Your team uses PHPStorm, VSCode, or other IDEs with PHP support and wants autocompletion, parameter hints, and static analysis for the php-decimal extension.
    • You’re integrating php-decimal into a greenfield or legacy project and need to ensure IDE/tooling compatibility from day one.
    • Your CI/CD pipeline relies on static analyzers (PHPStan, Psalm) and you want to avoid false positives/negatives related to the php-decimal API.
  • Look elsewhere if:

    • You don’t use the php-decimal extension (this is purely a stub package; the core library is php-decimal/php-decimal).
    • Your team doesn’t rely on IDE tooling (e.g., you’re using a lightweight editor like Sublime or Vim without PHP plugins).
    • You’re evaluating alternative decimal libraries (e.g., bcl/libphpdecimal, gmp, or JavaScript-based solutions for hybrid apps).
    • Your project is PHP 8.1+ and you’re waiting for native decimal support (monitor PHP RFCs).

How to Pitch It (Stakeholders)

For Executives/Business Leaders:

"This lightweight package enables our engineering team to leverage the php-decimal extension—critical for precise financial calculations—without sacrificing developer productivity. By providing IDE autocompletion and static analysis support, we reduce bugs in decimal-heavy workflows (e.g., payments, audits) and accelerate onboarding for new hires. It’s a no-code, low-risk dependency that future-proofs our stack against floating-point inaccuracies, aligning with our [precision/accuracy] goals."

For Engineering/Tech Leads:

"The php-decimal/stubs package is a free, MIT-licensed companion to the php-decimal extension that plugs into our existing PHP tooling (PHPStan, IDEs, etc.). It eliminates ‘unknown class/method’ warnings and speeds up development by surfacing the extension’s API in real-time. Since it’s maintained by the same team as the core library, we get updates for free. Tradeoff: Minimal overhead (just a composer require), but critical for teams using php-decimal in production. Recommend adopting if we’re committed to the extension long-term."

For Developers:

*"If you’re using php-decimal and tired of IDE red squiggles or static analysis errors, this package adds type hints and method stubs so your editor treats the extension like a first-party PHP class. Example:

use Decimal\Decimal;
$amount = new Decimal('123.456'); // No more 'Class not found' errors!

It’s a 5-minute setup (composer require php-decimal/stubs) with zero runtime impact—just better dev experience."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky