PHPackages                             steevanb/symfony-options-resolver - 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. steevanb/symfony-options-resolver

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

steevanb/symfony-options-resolver
=================================

Add features to Symfony OptionsResolver component.

1.1.0(6y ago)110.6kMITPHPPHP ^7.1.

Since Sep 27Pushed 6y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

[![version](https://camo.githubusercontent.com/499900d04874220b0188718e7787525891e3dd2347088409f113d51429a30a90/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e302d677265656e2e737667)](https://github.com/steevanb/symfony-options-resolver/tree/1.1.0)[![doctrine](https://camo.githubusercontent.com/55de3b0629361a379890ebd57cf9f777f77617cff32f7464287493f2279c0437/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792f6f7074696f6e735f7265736f6c7665722d253545322e36253743253743253545332e30253743253743253545342e302d626c75652e737667)](https://github.com/symfony/options-resolver)[![php](https://camo.githubusercontent.com/2dcf2757d7a2ae7d144c6e7d9b63bd3383509e6b70bacccb3bd8ad04d1c2541c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e312d626c75652e737667)](http://www.php.net)[![Lines](https://camo.githubusercontent.com/154671ce69b1e55773700818d4fdf739673c2d8a17c50cd607ebf8eb648f6612/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d3435342d677265656e2e737667)](https://camo.githubusercontent.com/154671ce69b1e55773700818d4fdf739673c2d8a17c50cd607ebf8eb648f6612/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d3435342d677265656e2e737667)[![Total Downloads](https://camo.githubusercontent.com/5f37c0a5e4aa185145af3274477e5ab497a77140dc1c6b1ea94ae96737c9f1ec/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f73796d666f6e792d6f7074696f6e732d7265736f6c7665722f646f776e6c6f616473)](https://camo.githubusercontent.com/5f37c0a5e4aa185145af3274477e5ab497a77140dc1c6b1ea94ae96737c9f1ec/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f73796d666f6e792d6f7074696f6e732d7265736f6c7665722f646f776e6c6f616473)[![Scrutinizer](https://camo.githubusercontent.com/2587e7065f2febf165347c804f31da56829db082f0683bc9da882cd6c7bc056b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7374656576616e622f73796d666f6e792d6f7074696f6e732d7265736f6c7665722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/steevanb/symfony-options-resolver/)

### symfony-options-resolver

[](#symfony-options-resolver)

Add features to Symfony [OptionsResolver](https://github.com/symfony/options-resolver) component.

[Changelog](changelog.md)

### Installation

[](#installation)

```
composer require "steevanb/symfony-options-resolver": "^1.1.0"
```

### Examples

[](#examples)

Define an optional option with a default value:

```
use steevanb\SymfonyOptionsResolver\OptionsResolver;

$optionsResolver = new OptionsResolver();

# Configure an optional option
$optionsResolver->configureOption('foo', ['string'], 'default', ['default', 'value1', 'value2']);

# Equivalent to call original OptionsResolver methods:
$optionsResolver
    ->setDefined('foo')
    ->setAllowedTypes('foo', ['string'])
    ->setDefault('foo', 'default')
    ->setAllowedValues('foo', ['default', 'value1', 'value2']);
```

Define a required option:

```
use steevanb\SymfonyOptionsResolver\OptionsResolver;

$optionsResolver = new OptionsResolver();

# Configure a required option
$optionsResolver->configureRequiredOption('foo', ['string'], ['value1', 'value2']);

# Equivalent to call original OptionsResolver methods:
$optionsResolver
    ->setRequired('foo')
    ->setAllowedTypes('foo', ['string'])
    ->setAllowedValues('foo', ['value1', 'value2']);
```

Allow unknown keys:

```
use steevanb\SymfonyOptionsResolver\OptionsResolver;

# This will not throw an exception because extraKey is not configured
(new OptionsResolver())
    ->configureRequiredOption('foo', ['string'], ['value1', 'value2'])
    ->setAllowUnknownKeys(true)
    ->resolve(['foo' => 'value1', 'extraKey' => 'extraValue']);
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

3

Last Release

2355d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e59638521a0ca6412cd2fa506834e384d4bac92197159891d4ccfe8e4b3d61eb?d=identicon)[steevanb](/maintainers/steevanb)

---

Top Contributors

[![steevanb](https://avatars.githubusercontent.com/u/5063383?v=4)](https://github.com/steevanb "steevanb (5 commits)")

---

Tags

options-resolverphpsymfony

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/steevanb-symfony-options-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/steevanb-symfony-options-resolver/health.svg)](https://phpackages.com/packages/steevanb-symfony-options-resolver)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[symfony/rate-limiter

Provides a Token Bucket implementation to rate limit input and output in your application

27047.2M147](/packages/symfony-rate-limiter)[symfony/ldap

Provides a LDAP client for PHP on top of PHP's ldap extension

1407.5M46](/packages/symfony-ldap)[php-soap/ext-soap-engine

An ext-soap engine implementation

443.2M7](/packages/php-soap-ext-soap-engine)[phpbench/container

Simple, configurable, service container.

1512.9M6](/packages/phpbench-container)[symfony/ux-toggle-password

Toggle visibility of password inputs for Symfony Forms

26508.0k5](/packages/symfony-ux-toggle-password)

PHPackages © 2026

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