src/Viserio/Component/OptionsResolver/Traits/OptionsResolverTrait.php
private static function checkMandatoryOptions(
        string $configClass,
        array $mandatoryOptions,
        $config,
        array $interfaces
    ): void {
        foreach ($mandatoryOptions as $key => $mandatoryOption) {
            $useRecursion = ! \is_scalar($mandatoryOption);

            if (! $useRecursion && \array_key_exists($mandatoryOption, (array) $config)) {
                continue;
            }

            if ($useRecursion && isset($config[$key])) {
                self::checkMandatoryOptions($configClass, $mandatoryOption, $config[$key], $interfaces);

                return;
            }

            throw new MandatoryOptionNotFoundException(
                isset($interfaces[RequiresComponentConfigContract::class]) ? $configClass::getDimensions() : [],
                $useRecursion ? $key : $mandatoryOption
            );
        }
    }
private static function checkMandatoryOptions(
        string $configClass,
        array $mandatoryOptions,
        $config,
        array $interfaces
    ): void {
        foreach ($mandatoryOptions as $key => $mandatoryOption) {
            $useRecursion = ! \is_scalar($mandatoryOption);

            if (! $useRecursion && \array_key_exists($mandatoryOption, (array) $config)) {
                continue;
            }

            if ($useRecursion && isset($config[$key])) {
                self::checkMandatoryOptions($configClass, $mandatoryOption, $config[$key], $interfaces);

                return;
            }

            throw new MandatoryOptionNotFoundException(
                isset($interfaces[RequiresComponentConfigContract::class]) ? $configClass::getDimensions() : [],
                $useRecursion ? $key : $mandatoryOption
            );
        }
    }
Checks if a mandatory param is missing, supports recursion.

@param string             $configClass
@param array              $mandatoryOptions
@param array|\ArrayAccess $config
@param array              $interfaces

@throws \Viserio\Component\Contract\OptionsResolver\Exception\MandatoryOptionNotFoundException

@return void