PHPackages                             klimick/decode - 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. klimick/decode

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

klimick/decode
==============

Decoding untrusted data in typesafe way

0.0.1(4y ago)881MITPHPPHP ^8.0

Since Jun 19Pushed 3y ago4 watchersCompare

[ Source](https://github.com/klimick/decode)[ Packagist](https://packagist.org/packages/klimick/decode)[ RSS](/packages/klimick-decode/feed)WikiDiscussions main Synced 5d ago

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

Decode
------

[](#decode)

[![psalm level](https://camo.githubusercontent.com/c61c01196ecc886b53db3936f1c262a9cd81ac27d7767280e933317af93b9e22/68747470733a2f2f73686570686572642e6465762f6769746875622f6b6c696d69636b2f6465636f64652f6c6576656c2e737667)](https://camo.githubusercontent.com/c61c01196ecc886b53db3936f1c262a9cd81ac27d7767280e933317af93b9e22/68747470733a2f2f73686570686572642e6465762f6769746875622f6b6c696d69636b2f6465636f64652f6c6576656c2e737667)[![psalm type coverage](https://camo.githubusercontent.com/a39aa409857112d48f689f9d716b5f1759d3a700bbc31396de30536fffb43aaa/68747470733a2f2f73686570686572642e6465762f6769746875622f6b6c696d69636b2f6465636f64652f636f7665726167652e737667)](https://camo.githubusercontent.com/a39aa409857112d48f689f9d716b5f1759d3a700bbc31396de30536fffb43aaa/68747470733a2f2f73686570686572642e6465762f6769746875622f6b6c696d69636b2f6465636f64652f636f7665726167652e737667)[![phpunit coverage](https://camo.githubusercontent.com/a30891a1b30fa85b4a30b47bc0df2dd7c975948a71f1c45b83808afc60524431/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b6c696d69636b2f6465636f64652f62616467652e737667)](https://coveralls.io/github/klimick/decode)

This library allow you to take untrusted data and check that it can be represented as type `T`.

- [Usage example](#usage-example)
- [Built in atomics](#builtin-type-atomics)
- [Generic types](#generic-types)
- [Higher order helpers](#higher-order-helpers)
- [Constraints](#constraints)

Usage example
-------------

[](#usage-example)

```
