PHPackages                             weew/config-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. weew/config-schema

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

weew/config-schema
==================

Schema builder for the weew/config package.

v1.4.2(9y ago)01122MITPHP

Since Aug 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/weew/config-schema)[ Packagist](https://packagist.org/packages/weew/config-schema)[ RSS](/packages/weew-config-schema/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (6)Versions (10)Used By (2)

Config Schema
=============

[](#config-schema)

[![Build Status](https://camo.githubusercontent.com/99b04069cf5d3349b02ccd98847ebd2a3489d17e504b770e1f561dcc32429cd9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f776565772f636f6e6669672d736368656d612e737667)](https://travis-ci.org/weew/config-schema)[![Code Quality](https://camo.githubusercontent.com/5a2d16a36bd4a441af40408320a2f2b0584203ac286e608ec3b5a10a1e5ddd66/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f776565772f636f6e6669672d736368656d612e737667)](https://scrutinizer-ci.com/g/weew/config-schema)[![Test Coverage](https://camo.githubusercontent.com/efb9b1787e0801bdf2248f7b15bdce43378815d3a2b69eab617c0c0100a74bd8/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f776565772f636f6e6669672d736368656d612e737667)](https://coveralls.io/github/weew/config-schema)[![Version](https://camo.githubusercontent.com/0c3eaa2818b3889ef9b313d48aa1d008145c773bc8f4289f852b07f344e6a2a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776565772f636f6e6669672d736368656d612e737667)](https://packagist.org/packages/weew/config-schema)[![Licence](https://camo.githubusercontent.com/a08de986b4048812dfb21e506d1fa658bbaaea5300e2bd4961cd2faef723ba23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776565772f636f6e6669672d736368656d612e737667)](https://packagist.org/packages/weew/config-schema)

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Introduction](#introduction)
- [Usage](#usage)

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

[](#installation)

`composer require weew/config-schema`

Introduction
------------

[](#introduction)

This package allows easy config validation and is used in combination with the [weew/config](https://github.com/weew/config) package.

Usage
-----

[](#usage)

You can describe your config schema like this:

```
$config = new Config([
    'some' => 'value',
    'items' => ['foo', 'bar'],
    'name' => 'John Doe',
]);
$schema = new ConfigSchema($config);

$schema
    ->hasValue('some')
    ->hasArray('items')->allowed(['foo', 'baz'])
    ->hasString('name')->min(3)->max(10)
;
```

After you've described your schema, you can either validate it, which will return you an instance of `IValidationResult`, or assert it, which will throw an exception.

```
$result = $schema->check();

foreach ($result->getErrors() as $error) {
    echo $error->getSubject() . ' ' . $error->getMessage();
}

// or

try {
    $schema->assert();
} catch (ConfigValidationException $ex) {
    $result = $ex->getValidationResult();
}
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

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

Total

9

Last Release

3593d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10b2b854b5829dd13a15967c000ed2119b5faef67aca24d94c653c8ac550d85e?d=identicon)[weew](/maintainers/weew)

### Embed Badge

![Health badge](/badges/weew-config-schema/health.svg)

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

###  Alternatives

[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2111.3M7](/packages/yireo-magento2-webp2)[alekseon/widget-forms

N/A

5041.8k1](/packages/alekseon-widget-forms)[naif/address_autocomplete

An address field that autocomplete the user input to show suggested addresses using Google Place service.

1722.7k](/packages/naif-address-autocomplete)

PHPackages © 2026

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