PHPackages                             open-feature/validators-hook - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. open-feature/validators-hook

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

open-feature/validators-hook
============================

A validator hooks package for OpenFeature

1.0.0(1y ago)02.2kApache-2.0PHPPHP ^8

Since Jan 2Pushed 1y ago2 watchersCompare

[ Source](https://github.com/open-feature-php/validators-hook)[ Packagist](https://packagist.org/packages/open-feature/validators-hook)[ RSS](/packages/open-feature-validators-hook/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (22)Versions (10)Used By (0)

OpenFeature Validator Hooks
===========================

[](#openfeature-validator-hooks)

[![a](https://camo.githubusercontent.com/17e144567dd661fcbef070f93dddc42e62807a539ee3165e47d0ddc507bf15f1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736c61636b2d253430636e63662532466f70656e666561747572652d627269676874677265656e3f7374796c653d666c6174266c6f676f3d736c61636b)](https://cloud-native.slack.com/archives/C0344AANLA1)[![Latest Stable Version](https://camo.githubusercontent.com/836138e5260dfe491bd7bdadc97cfe01c79df5ecb8c38a847f507b6b675601d9/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f76616c696461746f72732d686f6f6b2f76)](https://packagist.org/packages/open-feature/validators-hook)[![Total Downloads](https://camo.githubusercontent.com/7cfe3721a886d358cdbbae8465b4dff34e24ed83071bb9c4715cea821d2fc087/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f76616c696461746f72732d686f6f6b2f646f776e6c6f616473)](https://packagist.org/packages/open-feature/validators-hook)[![PHP 8.0+](https://camo.githubusercontent.com/36d788d0f2d62c47ef64bc13d6f62e5921218d50977830b654730882e0d0f1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d626c75652e737667)](https://camo.githubusercontent.com/36d788d0f2d62c47ef64bc13d6f62e5921218d50977830b654730882e0d0f1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d626c75652e737667)[![License](https://camo.githubusercontent.com/992f97c0f0bf9e1df8e0945a0926902f23f84020b465adcc17cfc29f2d54f0e6/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f76616c696461746f72732d686f6f6b2f6c6963656e7365)](https://packagist.org/packages/open-feature/validators-hook)

Overview
--------

[](#overview)

Validator Hook constructs that provide means to execute validation against resolved feature flag values.

This package also builds on various PSRs (PHP Standards Recommendations) such as the Logger interfaces (PSR-3) and the Basic and Extended Coding Standards (PSR-1 and PSR-12).

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

[](#installation)

```
composer require open-feature/validators-hook
```

Usage
-----

[](#usage)

The following validator hook constructs are available, but more are being worked on over time:

- `RegexpValidatorHook`

```
use OpenFeature\Hooks\Validators\RegexpValidatorHook;

$alphanumericValidator = new RegexpValidatorHook('/^[A-Za-z0-9]+$/');
$hexadecimalValidator = new RegexpValidatorHook('/^[0-9a-f]+$/');
$asciiValidator = new RegexpValidatorHook('/^[ -~]$/');

// this specific invocation will use this validator
$client->resolveStringValue('test-flag', 'deadbeef', null, new EvaluationOptions([$hexadecimalValidator]));
```

For more examples, see the [examples](./examples/).

Development
-----------

[](#development)

### PHP Versioning

[](#php-versioning)

This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.

This package also has a `.tool-versions` file for use with PHP version managers like `asdf`.

### Installation and Dependencies

[](#installation-and-dependencies)

Install dependencies with `composer install`. `composer install` will update the `composer.lock` with the most recent compatible versions.

We value having as few runtime dependencies as possible. The addition of any dependencies requires careful consideration and review.

### Testing

[](#testing)

Run tests with `composer run test`.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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 ~87 days

Recently: every ~142 days

Total

8

Last Release

621d ago

Major Versions

0.8.0 → 1.0.02024-09-04

PHP version history (2 changes)0.0.1PHP ^7.4 || ^8

0.2.0PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/37b811aae08f6063ce4a6c9111849a2c8c5400b58718072c224c9eb8c46e5f17?d=identicon)[0xc](/maintainers/0xc)

---

Top Contributors

[![tcarrio](https://avatars.githubusercontent.com/u/8659099?v=4)](https://github.com/tcarrio "tcarrio (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![beeme1mr](https://avatars.githubusercontent.com/u/682996?v=4)](https://github.com/beeme1mr "beeme1mr (1 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

---

Tags

validatorHOOKfeatureflagsfeatureflaggingopenfeature

###  Code Quality

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/open-feature-validators-hook/health.svg)

```
[![Health](https://phpackages.com/badges/open-feature-validators-hook/health.svg)](https://phpackages.com/packages/open-feature-validators-hook)
```

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[seld/jsonlint

JSON Linter

1.3k217.8M205](/packages/seld-jsonlint)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k184.2M25](/packages/composer-spdx-licenses)[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15544.9M188](/packages/laminas-laminas-validator)[ergebnis/json-schema-validator

Provides a JSON schema validator, building on top of justinrainbow/json-schema.

3626.9M7](/packages/ergebnis-json-schema-validator)

PHPackages © 2026

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