forked from bmitch/churn-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileExtensions.php
More file actions
35 lines (29 loc) · 799 Bytes
/
FileExtensions.php
File metadata and controls
35 lines (29 loc) · 799 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
<?php
declare(strict_types=1);
namespace Churn\Configuration\Validator;
use Churn\Configuration\EditableConfig;
use Webmozart\Assert\Assert;
/**
* @internal
*/
final class FileExtensions extends BaseValidator
{
/**
* Class constructor.
*/
public function __construct()
{
parent::__construct('fileExtensions');
}
/**
* @param EditableConfig $config The configuration object.
* @param mixed $value The value to validate.
*/
#[\Override]
protected function validateValue(EditableConfig $config, $value): void
{
Assert::isArray($value, 'File extensions should be an array of strings');
Assert::allString($value, 'File extensions should be an array of strings');
$config->setFileExtensions($value);
}
}