blob: 983c98cb30f0eebdee7763a02dbcb4d17f6c77f3 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Adldap\Configuration\Validators;
4
5/**
6 * Class Validator.
7 *
8 * Validates configuration values.
9 */
10abstract class Validator
11{
12 /**
13 * The configuration key under validation.
14 *
15 * @var string
16 */
17 protected $key;
18
19 /**
20 * The configuration value under validation.
21 *
22 * @var mixed
23 */
24 protected $value;
25
26 /**
27 * Constructor.
28 *
29 * @param string $key
30 * @param mixed $value
31 */
32 public function __construct($key, $value)
33 {
34 $this->key = $key;
35 $this->value = $value;
36 }
37
38 /**
39 * Validates the configuration value.
40 *
41 * @throws \Adldap\Configuration\ConfigurationException When the value given fails validation.
42 *
43 * @return bool
44 */
45 abstract public function validate();
46}