forked from bmitch/churn-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCachePath.php
More file actions
40 lines (32 loc) · 787 Bytes
/
CachePath.php
File metadata and controls
40 lines (32 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace Churn\Configuration\Validator;
use Churn\Configuration\EditableConfig;
use Webmozart\Assert\Assert;
/**
* @internal
*/
final class CachePath extends BaseValidator
{
/**
* Class constructor.
*/
public function __construct()
{
parent::__construct('cachePath');
}
/**
* @param EditableConfig $config The configuration object.
* @param mixed $value The value to validate.
*/
#[\Override]
protected function validateValue(EditableConfig $config, $value): void
{
if (null === $value) {
$config->setCachePath(null);
return;
}
Assert::string($value, 'Cache path should be a string');
$config->setCachePath($value);
}
}