elasticms/helpers
PHP Helpers wraps and simplifies common PHP functions into PHPStan-compliant helpers, making static analysis easier and code safer across elasticMS projects. Part of the elasticMS monorepo, with docs and issue tracking available on GitHub.
json_encode, file_get_contents, array/string functions) that return T|false or mixed and therefore generate static-analysis noise. This is a "build in an afternoon" candidate, not a strategic dependency. Decision framing: ~100 lines of in-house typed wrappers you own and can tune to your PHPStan baseline vs. an external package with 0 stars, 0 dependents, and no external users to surface bugs.@phpstan-ignore / baseline-triage work across teams, this is evidence for a standardized internal helpers module with a documented contract — which this package can inform as a reference design even if you don't adopt it.Consider it if:
false/mixed returns are a recurring, quantified source of baseline entries and silenced errors.Look elsewhere if:
phpstan-strict-rules, Larastan, and a handful of in-house wrappers cover most of the same ground with no third-party dependency and no license review.json_encode returning false, locale and float-precision behavior); they add types, not correctness. If you need validation or exceptions on failure, write your own contract.Executives (one paragraph): "This is a small code-quality utility, not a product feature. It wraps PHP built-in functions in type-safe signatures so our static analysis stops flagging legitimate code. The honest framing: the benefit is real but narrow — less time triaging false errors in CI, cleaner code review — and it's fully reproducible in-house in a few days. My recommendation is not to adopt it as a dependency. Instead, treat it as a free reference design for a small internal helpers module we own, which removes the supply-chain, licensing (LGPL-3.0), and single-maintainer risks entirely. If we do pilot it, scope it to one service and one quarter, with a measured baseline of PHPStan suppressions and CI failures before and after."
Engineering leadership: "This solves a genuine gap — native PHP functions return T|false and mixed, so strict PHPStan levels produce noise that teams silence rather than fix. The package's wrapper approach is sound and directly portable. Two caveats before we depend on it: (1) it has 0 stars, 0 external dependents, and versions that track the elasticMS platform rather than its own API, so we'd be the first real consumer; (2) LGPL-3.0 needs a legal pass. Concrete proposal: spend a sprint writing ~100 lines of equivalent typed wrappers in an internal package, use this repo's test cases as a spec, and lift our PHPStan level one notch on a single service. If the internal version is insufficient, we revisit — with evidence rather than a guess. Success criteria: measurable drop in baseline suppressions and PHPStan-related build failures, no regression in runtime benchmarks."
How can I help you explore Laravel packages today?