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↓50%1MITPHPPHP ~7.2

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 1mo ago

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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

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

1469d 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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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