PHPackages                             mascame/formality - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mascame/formality

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mascame/formality
=================

Form fields type guesser. Tries to detect the field type based on the name and the given config.

1.0.0(8y ago)0731MITPHPPHP &gt;=7.0.0

Since Apr 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/marcmascarell/formality)[ Packagist](https://packagist.org/packages/mascame/formality)[ Docs](https://github.com/marcmascarell/formality)[ RSS](/packages/mascame-formality/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (1)

Formality
=========

[](#formality)

[![Packagist](https://camo.githubusercontent.com/53bd86e139b77eff840bd73dbdf3aed89fdb5973680ed37fd31e56a53f3cf371/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617363616d652f666f726d616c6974792e7376673f6d61784167653d323539323030303f7374796c653d706c6173746963)](https://packagist.org/packages/mascame/formality)[![Travis](https://camo.githubusercontent.com/c4148279a0affc98e846e0b86d2bcce042d3f67c9e573a6330164c0ec2e9bd24/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6172636d6173636172656c6c2f666f726d616c6974792e7376673f6d61784167653d323539323030303f7374796c653d706c6173746963)](https://travis-ci.org/marcmascarell/formality)[![license](https://camo.githubusercontent.com/db6cb3d2731cc94eddd622bc5df1d8b229d8573f6e33c89f8af684a0ffda8874/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6172636d6173636172656c6c2f666f726d616c6974792e7376673f6d61784167653d323539323030303f7374796c653d706c6173746963)](https://github.com/marcmascarell/formality)

Form fields type guesser. Tries to detect the field type based on the name and the given config.

Installation
============

[](#installation)

`composer require mascame/formality`

Usage
=====

[](#usage)

```
$types = [
    'password' => [], // will match the keyword `password`
    'text' => [
        'autodetect' => [
            'title',
        ]
    ],
    'textarea' => [
        'autodetect' => [
            'body',
        ],
    ],
    'datetime' => [
        'regex' => [
            '/_at$/'
        ],
    ],
];

$parser = new Mascame\Formality\Parser\Parser($types);

print $parser->parse('title');  // text
print $parser->parse('body');  // textarea
print $parser->parse('created_at');  // datetime
print $parser->parse('password');  // password
```

Run Tests
=========

[](#run-tests)

`vendor/bin/codecept run unit`

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~103 days

Total

7

Last Release

3240d ago

Major Versions

0.0.6-beta → 1.0.02017-10-01

PHP version history (2 changes)0.0.2PHP &gt;=5.5.9

1.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9570e08dbb97ee61a22ae78624fd6b86ce62e0a89120fe40b5bde23d4a22eb6d?d=identicon)[marcmascarell](/maintainers/marcmascarell)

---

Top Contributors

[![marcmascarell](https://avatars.githubusercontent.com/u/642299?v=4)](https://github.com/marcmascarell "marcmascarell (49 commits)")

---

Tags

field detection

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/mascame-formality/health.svg)

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

###  Alternatives

[illuminate/pagination

The Illuminate Pagination package.

12234.6M1.1k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9350.2M310](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.8M410](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

224.7M144](/packages/illuminate-cookie)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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