PHPackages                             zingle-com/array-model - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zingle-com/array-model

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zingle-com/array-model
======================

Model primitive arrays.

1.0.2(6y ago)019.2k↓91.7%1MITPHPPHP ~7.2CI failing

Since Oct 6Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Zingle/array-model)[ Packagist](https://packagist.org/packages/zingle-com/array-model)[ RSS](/packages/zingle-com-array-model/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (5)Used By (0)

Zingle Community - Array Model
==============================

[](#zingle-community---array-model)

[![Build Status](https://camo.githubusercontent.com/5315386c7076770a436821c0e0c3b7b1168ef0dd496b473725ded7846f024b14/68747470733a2f2f7472617669732d63692e636f6d2f5a696e676c652f61727261792d6d6f64656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Zingle/array-model)[![Coverage Status](https://camo.githubusercontent.com/aa8475ce21feed475dc49820ad88d0dd5ddbc59c3a5378569aea2aceb1303bc9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f5a696e676c652f61727261792d6d6f64656c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Zingle/array-model?branch=master)

What and why?
-------------

[](#what-and-why)

Model associative array's as objects. This is useful when you would like some description of what is in associative array for future reference. Often times, in code you're also need to model certain kinds of behavior around data from various sources (api responses, arbitrary database queries, etc.).

Usage
-----

[](#usage)

Extend the `ZingleCom\ArrayModel\AbstractModel` class and add annotations to describe the kinds of data it models. Example:

```
use ZingleCom\ArrayModel\AbstractModel;

/**
 * @method int getId()
 * @method string getUsername()
 * @method bool isActive()
 * @method array getFriends()
 */
class SomeApiReponse extends AbstractModel {}

// later in code
// @var array $response
$response = $httpClient->get('/user/123');

// $response suppose arr now contains an associative array like:
// [
//      'id' => 123,
//      'username' => 'bob',
//      'active' => true,
//      'friends' => [234, 345],
// ]
$model = new SomeApiResponse($response);
echo $model->getId(); // prints 123
echo $model->getUsername(); // prints bob
echo $model->isActive() ? 'YES' : 'NO'; // prints YES
echo json_encode($model->getFriends()) // prints [234, 345]
```

Contributing
------------

[](#contributing)

Open a PR against master. If you see any serious concerns email me at `zach dot quintana  at gmail dot com`.

Happy coding!

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~315 days

Total

4

Last Release

1515d ago

Major Versions

1.0.2 → v2.x-dev2022-05-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/c07c0c54fce53a4e3d0f13300de39fcce4925cbe91cb4d6b294690a97e83b7c1?d=identicon)[zquintana](/maintainers/zquintana)

---

Top Contributors

[![zquintana](https://avatars.githubusercontent.com/u/130444?v=4)](https://github.com/zquintana "zquintana (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zingle-com-array-model/health.svg)

```
[![Health](https://phpackages.com/badges/zingle-com-array-model/health.svg)](https://phpackages.com/packages/zingle-com-array-model)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M280](/packages/illuminate-pipeline)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[illuminate/redis

The Illuminate Redis package.

8314.6M374](/packages/illuminate-redis)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
