src/Viserio/Component/OptionsResolver/Command/OptionsReader.php
public function readConfig(ReflectionClass $reflectionClass): array
    {
        $interfaces = \array_flip($reflectionClass->getInterfaceNames());

        if (isset($interfaces[RequiresConfigContract::class])) {
            $dimensions       = [];
            $defaultOptions   = [];
            $key              = null;

            if (isset($interfaces[RequiresComponentConfigContract::class])) {
                $dimensions = $reflectionClass->getName()::getDimensions();
                $key        = \end($dimensions);
            }

            if (isset($interfaces[ProvidesDefaultOptionsContract::class])) {
                $defaultOptions = $reflectionClass->getName()::getDefaultOptions();
            }

            if (isset($interfaces[RequiresMandatoryOptionsContract::class])) {
                $config = \array_merge_recursive(
                    $defaultOptions,
                    $this->readMandatoryOption($reflectionClass->getName(), $dimensions, $reflectionClass->getName()::getMandatoryOptions())
                );
            } else {
                $config = $defaultOptions;
            }

            if (\count($dimensions) !== 0) {
                $config = $this->buildMultidimensionalArray($dimensions, $config);
            }

            if ($key !== null) {
                return [$key => $config];
            }

            return $config;
        }

        return [];
    }
public function readConfig(ReflectionClass $reflectionClass): array
    {
        $interfaces = \array_flip($reflectionClass->getInterfaceNames());

        if (isset($interfaces[RequiresConfigContract::class])) {
            $dimensions       = [];
            $defaultOptions   = [];
            $key              = null;

            if (isset($interfaces[RequiresComponentConfigContract::class])) {
                $dimensions = $reflectionClass->getName()::getDimensions();
                $key        = \end($dimensions);
            }

            if (isset($interfaces[ProvidesDefaultOptionsContract::class])) {
                $defaultOptions = $reflectionClass->getName()::getDefaultOptions();
            }

            if (isset($interfaces[RequiresMandatoryOptionsContract::class])) {
                $config = \array_merge_recursive(
                    $defaultOptions,
                    $this->readMandatoryOption($reflectionClass->getName(), $dimensions, $reflectionClass->getName()::getMandatoryOptions())
                );
            } else {
                $config = $defaultOptions;
            }

            if (\count($dimensions) !== 0) {
                $config = $this->buildMultidimensionalArray($dimensions, $config);
            }

            if ($key !== null) {
                return [$key => $config];
            }

            return $config;
        }

        return [];
    }
@param \ReflectionClass $reflectionClass

@return array