PHPackages                             michaelpetri/typed-input - 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. michaelpetri/typed-input

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

michaelpetri/typed-input
========================

Type safe input wrapper for symfony input

1.4.0(5mo ago)41372.4k↓28.3%4[3 PRs](https://github.com/michaelpetri/typed-input/pulls)1MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Aug 31Pushed 2w ago3 watchersCompare

[ Source](https://github.com/michaelpetri/typed-input)[ Packagist](https://packagist.org/packages/michaelpetri/typed-input)[ RSS](/packages/michaelpetri-typed-input/feed)WikiDiscussions 1.x Synced 2d ago

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

Typed Input
===========

[](#typed-input)

[![Type Coverage](https://camo.githubusercontent.com/87d5a3c73d0bb6fff60b040ee2b8715d48a9cf9ca8eba70d0a86ef879190cf34/68747470733a2f2f73686570686572642e6465762f6769746875622f6d69636861656c70657472692f74797065642d696e7075742f636f7665726167652e737667)](https://shepherd.dev/github/michaelpetri/typed-input)[![Latest Stable Version](https://camo.githubusercontent.com/fa16d273ba4e7338c4f204176189568b85576c3a089be91d8c6fbb88049ae8f9/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c70657472692f74797065642d696e7075742f76)](//packagist.org/packages/michaelpetri/typed-input)[![License](https://camo.githubusercontent.com/50709029002c953d2d011a2dbd1c1bff142d47ffb656cb03d1e0a47f09d03a32/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c70657472692f74797065642d696e7075742f6c6963656e7365)](//packagist.org/packages/michaelpetri/typed-input)

Installation
------------

[](#installation)

```
composer require michaelpetri/typed-input
```

Usage
-----

[](#usage)

```
$typedInput = TypedInput::fromInput($input);

echo $typedInput->getOption('my-option')->asNonEmptyString();
echo $typedInput->getArgument('my-argument')->asInteger();
```

Available methods
-----------------

[](#available-methods)

- `asBoolean`
- `asBooleanOrNull`
- `asInteger`
- `asIntegerOrNull`
- `asPositiveInteger`
- `asPositiveIntegerOrNull`
- `asNaturalInteger`
- `asNaturalIntegerOrNull`
- `asString`
- `asStringOrNull`
- `asNonEmptyString`
- `asNonEmptyStringOrNull`
- `asNonEmptyStrings`
- `asDateTimeImmutable`

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance85

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91.4% 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 ~168 days

Recently: every ~226 days

Total

13

Last Release

105d ago

Major Versions

0.1.0 → 1.0.02020-12-30

1.2.0 → 2.x-dev2023-02-06

PHP version history (7 changes)0.1.0PHP ^7.1

1.0.0PHP ^7.4 || ^8.0

1.1.2PHP ^7.4 || ~8.0.0 || ~8.1.0

2.x-devPHP ~8.1.0 || ~8.2.0

1.3.2PHP ~8.2.0 || ~8.3.0

1.3.3PHP ~8.2.0 || ~8.3.0 || ~8.4.0

1.4.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4114292?v=4)[Michael Petri](/maintainers/michaelpetri)[@michaelpetri](https://github.com/michaelpetri)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (202 commits)")[![veliu](https://avatars.githubusercontent.com/u/30477425?v=4)](https://github.com/veliu "veliu (5 commits)")[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (5 commits)")[![nikital-c24](https://avatars.githubusercontent.com/u/196168036?v=4)](https://github.com/nikital-c24 "nikital-c24 (3 commits)")[![nicklog](https://avatars.githubusercontent.com/u/462920?v=4)](https://github.com/nicklog "nicklog (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

phpsymfony

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/michaelpetri-typed-input/health.svg)

```
[![Health](https://phpackages.com/badges/michaelpetri-typed-input/health.svg)](https://phpackages.com/packages/michaelpetri-typed-input)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5186.0k18](/packages/phel-lang-phel-lang)[php-soap/wsdl

Deals with WSDLs

184.0M19](/packages/php-soap-wsdl)[dagger/dagger

Dagger PHP SDK

261.1k](/packages/dagger-dagger)

PHPackages © 2026

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