Weave 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

No Floaters Laravel Package

roave/no-floaters

PHPStan plugin that bans floats: no float properties, parameters, return types, or assigning float values. Optional strict mode disallows any float-producing expression. Helps prevent rounding errors in domains like money, grading, or scientific calculations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Precision-Critical Applications: Continues to enable generic and conditional return type handling for floating-point detection, now with full alignment to PHPUnit v13 and explicit PHP 8.3 deprecation. This solidifies its role in financial, scientific, and measurement systems where IEEE-754 precision is non-negotiable.
  • Risk Mitigation: Proactively eliminates PHP 8.3 compatibility, forcing teams to migrate to supported versions (8.2 or lower) and reducing fragmentation in static analysis tooling. This aligns with PHP’s long-term support (LTS) roadmap and mitigates future technical debt.
  • Developer Productivity: Streamlines dependency management by upgrading to PHPUnit v13, reducing maintenance overhead for teams already using modern PHPUnit versions. The package now requires less manual intervention to stay updated.
  • Compliance & Audits: Strengthens audit readiness by dropping PHP 8.3 support, ensuring compliance with modern PHP best practices and reducing exposure to unsupported environments in regulated industries (e.g., fintech, healthcare).
  • Roadmap Prioritization:
    • Build vs. Buy: Reinforces the decision to adopt this package for floating-point static analysis, especially for teams using PHP 8.2 or lower with generics/conditional types. The PHP 8.3 deprecation acts as a forcing function for migration to supported versions.
    • Tech Debt Cleanup: Targets legacy codebases still on PHP 8.3 by incentivizing upgrades to leverage this package’s precision checks. Teams can now tie PHP version upgrades to static analysis improvements.
  • Use Cases:
    • Monetary Systems: E-commerce, banking, or tax calculators where floating-point errors in generic/conditional types could trigger compliance violations.
    • Data Science/ML: Pipelines or models where PHP 8.2’s type system is preferred over PHP 8.3’s, and floating-point precision is critical for reproducibility.
    • Embedded Systems: Devices using PHP 8.2 or lower with complex type hierarchies, where precision bugs could have safety implications.

When to Consider This Package

  • Adopt When:
    • Your application requires floating-point precision checks in generic or conditional return types (e.g., function(): float|int or function(): array{float}) and you’re using PHP 8.2 or lower.
    • You’re migrating from PHP 8.3 and want to leverage modern static analysis tooling (PHPUnit v13) for floating-point detection.
    • Your team prioritizes shift-left testing and needs to catch precision bugs early in CI/CD, especially in codebases with complex type systems.
    • You’re maintaining legacy or modernized PHP 8.2 codebases with undocumented floating-point logic in generics/conditional contexts.
    • You’re already using PHPStan/Psalm and want to integrate this package for enhanced floating-point validation without runtime overhead.
  • Look Elsewhere If:
    • Your project requires PHP 8.3+ due to feature dependencies, as this package no longer supports it. Consider alternatives like custom PHPStan rules or dedicated decimal libraries (e.g., brianium/paragonie_number).
    • Your use case doesn’t involve critical arithmetic (e.g., approximate calculations, UI animations, or non-financial analytics).
    • You’re not using generics or conditional return types and only need basic floating-point checks (e.g., simple arithmetic).
    • Your team lacks static analysis maturity or resists adopting new tooling, especially if PHP 8.3 migration is not imminent.
    • Performance is critical, and the package’s static analysis overhead (though minimal) conflicts with your pipeline constraints.

How to Pitch It (Stakeholders)

For Executives: "The latest update to no-floaters (1.16.0) drops PHP 8.3 support and upgrades to PHPUnit v13, making it the most reliable choice for catching floating-point precision bugs in generic and conditional return types. For teams using PHP 8.2 or lower—especially in financial, scientific, or measurement-dependent workflows—this is a must-have for avoiding costly runtime errors. The PHP 8.3 deprecation also acts as a catalyst for migrating legacy systems to supported versions, reducing technical debt. Investment is minimal (MIT-licensed, zero runtime cost), and the ROI comes from fewer production bugs and smoother audits. If your stack is PHP 8.3+, this package won’t work, but the upgrade to PHPUnit v13 alone justifies adoption for teams already aligned with PHP 8.2."

For Engineering: "1.16.0 is a cleanup release that drops PHP 8.3 support and updates to PHPUnit v13. If you’re on PHP 8.2 or lower and using generics/conditional return types, this is a non-negotiable update—it fixes a critical gap in floating-point detection (e.g., function(): array{float}). For PHP 8.3 users, this is a hard stop: you’ll need to migrate or switch to alternatives like custom PHPStan rules. Start by auditing your CI pipeline for PHP 8.3 dependencies and planning the upgrade. The PHPUnit v13 sync also means less maintenance overhead if you’re already on that version."

For Developers: "PHP 8.3 users: this package is no longer for you. If you’re on PHP 8.2 or lower, update to 1.16.0 for better floating-point detection in generics/conditional types (e.g., function(): T where T: float). The PHPUnit v13 upgrade means smoother dependency management, and the PHP 8.3 drop forces a clean break from unsupported versions. Pair this with bcmath for critical paths, and you’ve got a precision-proof workflow. Pro tip: Use it in CI to catch 0.1 + 0.2 bugs before they hit production."

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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core