PHPackages                             bayfrontmedia/array-schema - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. bayfrontmedia/array-schema

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bayfrontmedia/array-schema
==========================

A simple library used to force a predefined "schema" for a given array.

v2.1.1(1y ago)03761MITPHPPHP ^8.0

Since Nov 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bayfrontmedia/array-schema)[ Packagist](https://packagist.org/packages/bayfrontmedia/array-schema)[ Docs](https://github.com/bayfrontmedia/array-schema)[ RSS](/packages/bayfrontmedia-array-schema/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (1)

Array Schema
------------

[](#array-schema)

A simple library used to force a predefined "schema" for a given array.

- [License](#license)
- [Author](#author)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)

License
-------

[](#license)

This project is open source and available under the [MIT License](LICENSE).

Author
------

[](#author)

[![Bayfront Media](https://camo.githubusercontent.com/0c0163913b2092e97dbf9684970adaf86f2f25871298d3d28b2dff4bf75b2915/68747470733a2f2f63646e312e6f6e62617966726f6e742e636f6d2f62666d2f6272616e642f62666d2d6c6f676f2e737667)](https://camo.githubusercontent.com/0c0163913b2092e97dbf9684970adaf86f2f25871298d3d28b2dff4bf75b2915/68747470733a2f2f63646e312e6f6e62617966726f6e742e636f6d2f62666d2f6272616e642f62666d2d6c6f676f2e737667)

- [Bayfront Media homepage](https://www.bayfrontmedia.com?utm_source=github&utm_medium=direct)
- [Bayfront Media GitHub](https://github.com/bayfrontmedia)

Requirements
------------

[](#requirements)

- PHP `^8.0` (Tested up to `8.4`)

Installation
------------

[](#installation)

```
composer require bayfrontmedia/array-schema
```

Usage
-----

[](#usage)

The intended usage is for a custom schema to implement `Bayfront\ArraySchema\SchemaInterface`. The `Bayfront\ArraySchema\InvalidSchemaException` is provided for any exceptions thrown from a `SchemaInterface`to optionally extend, which can simplify the process of catching exceptions.

The `SchemaInterface` contains only one static method:

- [create](#create)

### create

[](#create)

**Description:**

Returns an array conforming to the desired schema.

**Parameters:**

- `$array` (array): Input array
- `$config = []` (array): Optional configuration array which can be used to pass options necessary to build the desired schema.

**Returns:**

- (array)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance40

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~251 days

Recently: every ~348 days

Total

7

Last Release

511d ago

Major Versions

v1.0.3 → v2.0.02023-01-26

PHP version history (2 changes)v1.0.0PHP &gt;=7.2.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ad62c8d0e69358fd63b16fdaa71d5359231cd0cf660bbc3419071dc705c63a8?d=identicon)[bayfrontmedia](/maintainers/bayfrontmedia)

---

Top Contributors

[![robinsonjohn](https://avatars.githubusercontent.com/u/24327848?v=4)](https://github.com/robinsonjohn "robinsonjohn (17 commits)")

---

Tags

phpjsonapirestarray

### Embed Badge

![Health badge](/badges/bayfrontmedia-array-schema/health.svg)

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

###  Alternatives

[marcin-orlowski/laravel-api-response-builder

Helps building nice, normalized and easy to consume Laravel REST API.

837458.6k3](/packages/marcin-orlowski-laravel-api-response-builder)[givebutter/laravel-keyable

Add API keys to your Laravel models

187144.5k2](/packages/givebutter-laravel-keyable)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)

PHPackages © 2026

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