Skip to content

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

License

Notifications You must be signed in to change notification settings

bayfrontmedia/array-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Array Schema

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

License

This project is open source and available under the MIT License.

Author

Bayfront Media

Requirements

  • PHP ^8.0 (Tested up to 8.4)

Installation

composer require bayfrontmedia/array-schema

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

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)

About

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

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages