1<?php 2 3declare(strict_types=1); 4 5/* 6 * This file is part of the league/config package. 7 * 8 * (c) Colin O'Dell <colinodell@gmail.com> 9 * 10 * For the full copyright and license information, please view the LICENSE 11 * file that was distributed with this source code. 12 */ 13 14namespace League\Config; 15 16use League\Config\Exception\UnknownOptionException; 17use League\Config\Exception\ValidationException; 18 19/** 20 * Interface for reading configuration values 21 */ 22interface ConfigurationInterface 23{ 24 /** 25 * @param string $key Configuration option path/key 26 * 27 * @psalm-param non-empty-string $key 28 * 29 * @return mixed 30 * 31 * @throws ValidationException if the schema failed to validate the given input 32 * @throws UnknownOptionException if the requested key does not exist or is malformed 33 */ 34 public function get(string $key); 35 36 /** 37 * @param string $key Configuration option path/key 38 * 39 * @psalm-param non-empty-string $key 40 * 41 * @return bool Whether the given option exists 42 * 43 * @throws ValidationException if the schema failed to validate the given input 44 */ 45 public function exists(string $key): bool; 46} 47