Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 1, 2024 via composer

symfony/options-resolver v7.0.0

Provides an improved replacement for the array_replace PHP function
Package summary
Share
0
issues
1
license
2
MIT
Package created
16 May 2012
Version published
8 Aug 2023
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
symfony/deprecation-contracts@v3.4.0
symfony/options-resolver@v7.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of symfony/options-resolver 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
symfony/deprecation-contractsv3.4.03.27 kBMIT
prod

Visualizations

Frequently Asked Questions

What does symfony/options-resolver do?

The Symfony OptionsResolver component is an advanced replacement for the PHP array_replace function. It facilitates complex options system creation with support for required options, defaults, validation (by type or value), normalization amongst other features. These improvements over the standard array_replace function make it significantly more robust & flexible when dealing with data collections.

How do you use symfony/options-resolver?

To begin using the symfony/options-resolver in a PHP environment, you need to first ensure the package is included in your project. This can be accomplished with Composer, as follows: composer require symfony/options-resolver.

The options resolver can be used to create an options system, define defaults, and define required options. Here's a simple example of how to use it:

use Symfony\Component\OptionsResolver\OptionsResolver;

$resolver = new OptionsResolver();
$resolver->setDefaults([
    'default_option' => 'value',
]);
$resolver->setRequired([
    'required_option',
]);
$options = $resolver->resolve([
    'required_option' => 'value',
]);

The OptionsResolver first sets default options. These options will be merged with the options passed into the resolve method. After that, it sets required options. If these options are not present when the resolve method is called, a MissingOptionsException will be thrown.

Where are the symfony/options-resolver docs?

You can find comprehensive options-resolver documentation on the Symfony's official documentation page. This documentation covers installation, usage examples, contribution guidelines, and how to report issues. Expand your knowledge of symfony/options-resolver and its applications by referencing the Symfony docs to fully exploit this powerful tool in your PHP development.