-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathConfigurationKeys.php
79 lines (67 loc) · 2.71 KB
/
ConfigurationKeys.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
/*
* This file is part of the humbug/php-scoper package.
*
* Copyright (c) 2017 Théo FIDRY <theo.fidry@gmail.com>,
* Pádraic Brady <padraic.brady@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Humbug\PhpScoper\Configuration;
use Humbug\PhpScoper\Configuration\Throwable\UnknownConfigurationKey;
use Humbug\PhpScoper\NotInstantiable;
final class ConfigurationKeys
{
use NotInstantiable;
public const PREFIX_KEYWORD = 'prefix';
public const PHP_VERSION_KEYWORD = 'php-version';
public const OUTPUT_DIR_KEYWORD = 'output-dir';
public const EXCLUDED_FILES_KEYWORD = 'exclude-files';
public const FINDER_KEYWORD = 'finders';
public const PATCHERS_KEYWORD = 'patchers';
public const EXPOSE_GLOBAL_CONSTANTS_KEYWORD = 'expose-global-constants';
public const EXPOSE_GLOBAL_CLASSES_KEYWORD = 'expose-global-classes';
public const EXPOSE_GLOBAL_FUNCTIONS_KEYWORD = 'expose-global-functions';
public const EXPOSE_NAMESPACES_KEYWORD = 'expose-namespaces';
public const EXPOSE_CLASSES_SYMBOLS_KEYWORD = 'expose-classes';
public const EXPOSE_FUNCTIONS_SYMBOLS_KEYWORD = 'expose-functions';
public const EXPOSE_CONSTANTS_SYMBOLS_KEYWORD = 'expose-constants';
public const EXCLUDE_NAMESPACES_KEYWORD = 'exclude-namespaces';
public const CLASSES_INTERNAL_SYMBOLS_KEYWORD = 'exclude-classes';
public const FUNCTIONS_INTERNAL_SYMBOLS_KEYWORD = 'exclude-functions';
public const CONSTANTS_INTERNAL_SYMBOLS_KEYWORD = 'exclude-constants';
public const KEYWORDS = [
self::PREFIX_KEYWORD,
self::PHP_VERSION_KEYWORD,
self::OUTPUT_DIR_KEYWORD,
self::EXCLUDED_FILES_KEYWORD,
self::FINDER_KEYWORD,
self::PATCHERS_KEYWORD,
self::EXPOSE_GLOBAL_CONSTANTS_KEYWORD,
self::EXPOSE_GLOBAL_CLASSES_KEYWORD,
self::EXPOSE_GLOBAL_FUNCTIONS_KEYWORD,
self::EXPOSE_NAMESPACES_KEYWORD,
self::EXPOSE_CLASSES_SYMBOLS_KEYWORD,
self::EXPOSE_FUNCTIONS_SYMBOLS_KEYWORD,
self::EXPOSE_CONSTANTS_SYMBOLS_KEYWORD,
self::EXCLUDE_NAMESPACES_KEYWORD,
self::CLASSES_INTERNAL_SYMBOLS_KEYWORD,
self::FUNCTIONS_INTERNAL_SYMBOLS_KEYWORD,
self::CONSTANTS_INTERNAL_SYMBOLS_KEYWORD,
];
/**
* @throws UnknownConfigurationKey
*/
public static function assertIsValidKey(string $key): void
{
if (!self::isValidateKey($key)) {
throw UnknownConfigurationKey::forKey($key);
}
}
public static function isValidateKey(string $key): bool
{
return in_array($key, self::KEYWORDS, true);
}
}