use Symfony\Component\OptionsResolver\OptionsResolver; $optionsResolver = new OptionsResolver(); $optionsResolver->setDefaults([ 'date_format' => 'd/m/Y', ]); $optionsResolver->setNormalizer('date_format', function ($options, $value) { // Ensure the value is in a standard format return date('Y-m-d', strtotime($value)); }); $options = $optionsResolver->resolve([ 'date_format' => '31/12/2022', ]); // Output: array('date_format' => '2022-12-31') print_r($options);In this example, the setNormalizer() method is used to specify a callback function that normalizes the date_format option. The callback function converts the date to the Y-m-d format using the strtotime() and date() PHP functions. Overall, the Symfony\Component\OptionsResolver\OptionsResolver package library provides a powerful set of tools for configuring and validating options in PHP applications.