zerkalica/semaphore-bundle
Symfony bundle that brings semaphore-based locking to your app: guard critical sections and shared resources with a simple, configurable service so concurrent requests and workers don't collide. Lightweight integration for safe, predictable concurrency.
semaphore/semaphore functional-programming library. The decision it informs is "do we pay a dependency tax for container wiring we could write ourselves in an afternoon?"Maybe/Either-style types. That is a genuine architectural decision — null-returning repositories vs. explicit optionality, exceptions vs. typed failure values — that affects API contracts, test style, and onboarding for years. The bundle itself is just plumbing for that decision.if ($x === null) guards in a legacy Symfony service, giving a domain layer composable failure values instead of exception control flow, or normalizing collections with map/filter/reduce semantics.Consider only if all of the following hold:
composer.json — this is an old-generation bundle; do not assume PHP 8.x compatibility without reading it).semaphore/semaphore for Maybe/Either semantics, and container wiring is the only remaining friction.Look elsewhere (default recommendation) if any of the following apply:
?Type nullables, union types, readonly value objects, enums, and first-class callable syntax cover most of what a small Maybe shim buys you, with zero dependency risk. Write a 40-line Result class instead.php-standard-library, widmogrod/php-functional, or hand-rolled immutable result types) over a 2-star wrapper.To executives (recommendation: do not adopt as a dependency).
We evaluated
zerkalica/semaphore-bundle, a small Symfony integration for a PHP functional-programming library. Despite its listing, adoption risk outweighs benefit: it is a Symfony bundle (not Laravel-compatible), has 2 GitHub stars, zero dependent projects, and no evident maintenance. The capability it wraps — typed optional values and composable error results — is real and useful, but the wrapper adds no defensible value. Recommended path: if we want that pattern, implement a small internal result type (~1–2 days of engineering) that we own, test, and can evolve. This avoids an unmaintained third-party dependency in our stack for a benefit we can reproduce cheaply. Net: no roadmap impact, low cost to do it properly, unbounded cost to inherit it.
To engineering (if you want to pursue the underlying idea).
The library gives us
Maybe/Eitherso that "this might not exist" and "this can fail" are visible in the type signature instead of buried in docblocks andnullchecks. That makes refactors of legacy services safer and removes a class of null-handling bugs. The bundle only saves us container configuration — roughly 20–50 lines ofservices.yamland a compiler pass. Given the maintenance profile, the proposal is: use the pattern, not the package. We pin a single internalResult/Optionalimplementation, write it withreadonlyclasses against our current PHP version, and keep the door open to swap in a maintained library later. If someone strongly prefers the upstream library, pilot it in one bounded service behind an interface so it stays reversible.
Ask: approve ~1–2 engineer-days for an internal result type; add "no unmaintained wrappers around commodity patterns" to the dependency review checklist.
How can I help you explore Laravel packages today?