<?php

declare(strict_types=1);

/*
 * This file is part of vonRotenberg Shopware API Bundle.
 *
 * (c) vonRotenberg
 *
 * @license proprietary
 */

namespace vonRotenberg\ShopwareApiBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration implements ConfigurationInterface
{
    public function getConfigTreeBuilder(): TreeBuilder
    {
        $treeBuilder = new TreeBuilder('vonrotenberg_shopware_api');
        $treeBuilder
            ->getRootNode()
            ->children()
                ->arrayNode('credentials')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('client_id')
                            ->info('Your Shopware client ID.')
                            ->defaultValue('')
                        ->end()
                        ->scalarNode('client_secret')
                            ->info('Your Shopware client secret.')
                            ->defaultValue('')
                        ->end()
                        ->scalarNode('api_endpoint')
                            ->info('The endpoint URL of your Shopware installation.')
                            ->defaultValue('')
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}