<?php

namespace KupShop\PohodaBundle\Utils;

class Configuration
{
    private $defaultIndex = 0;
    private $configuration;

    public function setConfiguration(array $configuration): void
    {
        $this->configuration = $configuration;
    }

    public function has(string $name): bool
    {
        return isset($this->configuration[$name]);
    }

    public function get(string $name, $default = null)
    {
        if (!$this->has($name)) {
            return $default;
        }

        return $this->configuration[$name];
    }

    public function getDefaultIndex(): int
    {
        return $this->defaultIndex;
    }
}
