PHPackages                             medialib/proptypes - 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. medialib/proptypes

AbandonedArchivedTypo3-flow-package[Validation &amp; Sanitization](/categories/validation)

medialib/proptypes
==================

PropType validation for PHP project inspired by React

0.1.1(9y ago)0596[1 issues](https://github.com/medialibtv/PropTypes/issues)PHP

Since Jun 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/medialibtv/PropTypes)[ Packagist](https://packagist.org/packages/medialib/proptypes)[ RSS](/packages/medialib-proptypes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Medialib.PropTypes
==================

[](#medialibproptypes)

Validate the properties passed to your constructor with class annotation. Can be used in any Flow Framework project. Your constructor must support a single variable and this variable should be an array. You can also enfore default values.

Validation and default value enforcement are done with AOP.

**This package require Flow 2.3, not compatibile with Flow 3.0 currently**

**This is a preliminary realease, not considered stable and complet, API should change, and performance must be improved**

How to use it ?
---------------

[](#how-to-use-it-)

```
use Medialib\PropTypes\Annotations as Props;

/**
 * EmitMessageOptions
 *
 * @api
 *
 * @Props\Types(
 *    subject = "string.isRequired",
 *    payload = "array",
 *    unique = "bool",
 *    connection = "string"
 * )
 *
 * @Props\Defaults(
 *    connection = "default"
 * )
 */
class EmitMessageOptions
{
    /**
     * @param array $options
     */
    public function __construct(array $options)
    {
        $this->subject = $options['subject'];
        $this->payload = $options['payload'];
        $this->unique = $options['unique'];
        $this->connection = $options['connection'];
    }
}

```

Supported types
---------------

[](#supported-types)

- any
- array
- bool
- func
- number
- object
- string

Supported options
-----------------

[](#supported-options)

- isRequired

Acknowledgments
---------------

[](#acknowledgments)

Development sponsored by [ttree ltd - neos solution provider](http://ttree.ch) and [medialib.tv](http://medialib.tv).

We try our best to craft this package with a lots of love, we are open to sponsoring, support request, ... just contact us.

License
-------

[](#license)

Licensed under MIT, see [LICENSE](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

3445d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fff2a04ee593017eefb9cf8b7850e3647e8bd0aebd38b87abf8bbb60c9088d9c?d=identicon)[medialibtv](/maintainers/medialibtv)

---

Top Contributors

[![dfeyer](https://avatars.githubusercontent.com/u/221173?v=4)](https://github.com/dfeyer "dfeyer (5 commits)")

### Embed Badge

![Health badge](/badges/medialib-proptypes/health.svg)

```
[![Health](https://phpackages.com/badges/medialib-proptypes/health.svg)](https://phpackages.com/packages/medialib-proptypes)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1052.9M11](/packages/xemlock-htmlpurifier-html5)

PHPackages © 2026

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