Code Quality & Maintainability:
Developer Productivity:
Arrays::flatten, Assert::notNull) instead of reinventing them.Consistency & Best Practices:
Assert::isArray, Assert::greaterThan) across services, reducing edge-case bugs.Arrays::groupBy, Arrays::diff) to ensure predictable behavior.Roadmap Alignment:
Closures::unfold to lazy-load heavy services (e.g., external APIs) behind feature flags.Arrays::mapAssoc/Arrays::reindex for API payload transformations in new integrations.if (empty($var)) checks with fluent assertions (e.g., Assert::nonEmptyArray($data)) in validation-heavy flows.Build vs. Buy:
array_key_exists() with Arrays::contains()).Assert::notNull() with custom failure messages).ComparableInterface/EquatableInterface support) for complex data structures (e.g., DTOs, collections)."This utility package is a force multiplier for our development team. By adopting digitalrevolution/utils, we can:
Arrays::equals() ensures predictable comparisons).Assert::nonEmptyString() for input validation).For a one-time Composer install (composer require digitalrevolution/utils), we gain a reusable toolkit used internally by a 50+ developer team at 123inkt. This aligns with our goal to [reduce technical debt] while keeping costs minimal."
"This package solves three key pain points:
array_map, array_filter, and nested foreach loops with fluent methods like Arrays::flatten(), Arrays::groupBy(), and Arrays::fetchByPath().
$grouped = Arrays::groupBy($users, fn($user) => $user['department']);
if chains with expressive assertions:
Assert::nonEmptyArray($payload)->notNull($payload['id'])->positiveInt($payload['quantity']);
ComparableInterface.Closures::unfold() for lazy initialization (e.g., feature flags) and Stringify::value() for debugging.Migration Path:
Arrays::mapAssoc for payload transformations).unfold for deferred service initialization.Risks: Minimal—package is MIT-licensed, PHP 8.3+, and actively maintained. We can phase adoption by service."*
How can I help you explore Laravel packages today?