PHPackages                             philiagus/parser - 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. philiagus/parser

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

philiagus/parser
================

PHP converter classes for asserting, parsing and converting of inputs.

v1.2.0(5y ago)17.3k↓50%[1 PRs](https://github.com/philiagus/parser/pulls)MITPHPPHP &gt;=7.2CI passing

Since Oct 13Pushed 3mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (15)Used By (0)

philiagus/parser
================

[](#philiagusparser)

PHP classes to assert, convert and parse data.

Is it tested?
=============

[](#is-it-tested)

Tested on the following PHP Version:

- PHP8.3

100% test covered. Test coverage generated on PHP8.3

Why do I need it?
-----------------

[](#why-do-i-need-it)

Making sure your inputs are what they should be is one of the core principles of secure coding.

Obviously there are more, but we must tackle them one step at a time.

The basic idea of the parsers is, that the developer defines a structure through code and later throws a set of data against it. The parsers make sure, that the data is following the rules of defined in the structure.

How does it work?
-----------------

[](#how-does-it-work)

A more in depth documentation and tutorials on how to write own parsers can be found [here](doc/index.md).

A simple example to assert that a provided value lies within defined boundaries:

```
