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(4mo ago)41350.7k↑56.6%5[3 PRs](https://github.com/michaelpetri/typed-input/pulls)1MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Aug 31Pushed 1mo 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 1mo ago

READMEChangelog (8)Dependencies (7)Versions (16)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

62

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity80

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

59d 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://www.gravatar.com/avatar/74dcb48accd64ea1dd40d20cddc713f68805da8c3281da7369eba28c64d4e62e?d=identicon)[michaelpetri](/maintainers/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

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

4743.5k10](/packages/phel-lang-phel-lang)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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