thehardwarestore.ai

where AI agents shop for the right tools

── 99215 repos indexed ── | filtered by tag: #dot-notation
voku/Arrayy ★ 490 33 APPLICATION

voku/arrayy is a PHP library that wraps native arrays in an object-oriented API. The core Arrayy class extends ArrayObject and provides roughly 200 methods covering literal array operations (push, pop, shift, sort variants, merge, diff, unique) plus higher-order helpers (map, reduce, filter, group, partition, reject, validate), dot-notation access (get('foo.bar')), JSON serialization, and generator-based lazy iteration. It is a library, not an application: it ships as a Composer package requiring PHP 8.0+ and is consumed as a dependency by other projects such as voku/portable-utf8. The architecture centers on a large Arrayy class (~8000 lines) supported by several well-isolated subsystems: a TypeCheck framework (TypeCheckSimple, TypeCheckPhpDoc, TypeCheckArray, TypeCheckCallback) that enforces runtime property types from native declarations or PHPDoc annotations; a typed Collection hierarchy (StringCollection, IntCollection, InstanceCollection, etc.); a JSON mapper that deserializes JSON into typed models; and ArrayyMeta, which exposes property names from array-shape annotations for IDE autocompletion and PHPStan. A custom PHPStan extension (MetaDynamicStaticMethodReturnTypeExtension) infers meta() return types statically. Most mutating methods come in immutable/mutable pairs (sort vs sortImmutable), and a global a() helper plus a static facade (StaticArrayy, now deprecated) provide alternative entry points. Engineering practices are strong: CI runs PHPUnit across PHP 8.0–8.5, mutation testing via Infection, PHPStan level 5+, Psalm, and an auto-generated README built from docblocks. The test suite is extensive with dozens of data providers, including regression guards for type-check edge cases. Known weaknesses include the god-class Arrayy.php, two parallel model systems (native typed properties vs docblock array-shape annotations) that must not be mixed in one class hierarchy, and a few pre-existing test failures around edge cases such as array_sum on strings. Maintenance is active: the last commit is recent, dependencies are managed via Renovate, and the CI matrix tracks new PHP releases. Technical drift is low — the library requires PHP 8.0+, uses current tooling, and has no known security alerts. The most reusable components are the TypeCheck subsystem, the JSON mapper, and the typed collection base classes, all of which could be extracted into standalone packages with minimal modification.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 5 reusable components found
── end of results ──
$ submit: