PHPackages                             try-again-later/pup - 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. try-again-later/pup

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

try-again-later/pup
===================

A small PHP library for value parsing and validation inspired by yup.

v0.1.3(3y ago)051MITPHPPHP &gt;=8.1.0CI passing

Since Jul 3Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/try-again-later/pup)[ Packagist](https://packagist.org/packages/try-again-later/pup)[ RSS](/packages/try-again-later-pup/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Pup
===

[](#pup)

 [ ![Tests](https://github.com/try-again-later/pup/actions/workflows/Tests.yml/badge.svg) ](https://github.com/try-again-later/pup/actions/workflows/Tests.yml) [ ![Latest Version](https://camo.githubusercontent.com/a583f3ad89cee973fc38f5c21304d210342ec43ceba690aec285d1e34d949209/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7472792d616761696e2d6c617465722f707570) ](https://packagist.org/packages/try-again-later/pup) [ ![Latest Version](https://camo.githubusercontent.com/0538ee4b47dff11e30b91e85686a0c20e61275bf7b127cbe022cac21672d5f36/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7472792d616761696e2d6c617465722f707570) ](https://packagist.org/packages/try-again-later/pup)

PHP библиотека для валидации с интерфейсом, вдохновлённым [yup](https://github.com/jquense/yup). Позволяет парсить и создавать объекты из сырых массивов в соответствии с наобором правил, указанных в атрибутах на полях класса.

---

PHP library for value parsing and validation with an interface inspired by [yup](https://github.com/jquense/yup). Allows you to parse and create objects from raw arrays according to the ruleset specified via attributes applied to the class fields.

Example
-------

[](#example)

```
use TryAgainLater\Pup\Attributes\{FromAssociativeArray, MakeParsed};
use TryAgainLater\Pup\Attributes\Generic\{ParsedProperty, Required};
use TryAgainLater\Pup\Attributes\Number\Positive;
use TryAgainLater\Pup\Attributes\String\MaxLength;

#[FromAssociativeArray]
class User
{
    #[ParsedProperty]
    #[Required]
    #[MaxLength(8)]
    private string $name;

    #[ParsedProperty]
    #[Positive]
    private int $age;

    use MakeParsed;
}

// Creates the object without any issues:
$user = User::from([
    'name' => 'John',
    'age' => 42,
]);

// Throws an exception because of negative age:
$user = User::from([
    'name' => 'John',
    'age' => -42,
]);

// Throws an exception because the name is too long:
$user = User::from([
    'name' => 'John Doe Blah Blah Blah',
    'age' => 42,
]);
```

More examples under the [examples folder](./examples/).

Running tests and linter (on the library iteself)
-------------------------------------------------

[](#running-tests-and-linter-on-the-library-iteself)

```
composer test
composer lint
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

4

Last Release

1372d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01ab757ee6f25445f1482847040318b048993b5d1d3a0d109a37440360f5c6ed?d=identicon)[try-again-later](/maintainers/try-again-later)

---

Top Contributors

[![try-again-later](https://avatars.githubusercontent.com/u/102386816?v=4)](https://github.com/try-again-later "try-again-later (39 commits)")

---

Tags

jsonphpvalidation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/try-again-later-pup/health.svg)

```
[![Health](https://phpackages.com/badges/try-again-later-pup/health.svg)](https://phpackages.com/packages/try-again-later-pup)
```

###  Alternatives

[webmozart/assert

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

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M450](/packages/nette-forms)[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)

PHPackages © 2026

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