1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
namespace Skautis\Wsdl; |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
use ReflectionClass; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Dostupné webové služby SkautISu |
13
|
|
|
*/ |
14
|
|
|
abstract class WebServiceName |
15
|
|
|
{ |
16
|
|
|
|
17
|
|
|
public const APPLICATION_MANAGEMENT = 'ApplicationManagement'; |
18
|
|
|
|
19
|
|
|
public const CONTENT_MANAGEMENT = 'ContentManagement'; |
20
|
|
|
|
21
|
|
|
public const DOCUMENT_STORAGE = 'DocumentStorage'; |
22
|
|
|
|
23
|
|
|
public const EVALUATION = 'Evaluation'; |
24
|
|
|
|
25
|
|
|
public const EVENTS = 'Events'; |
26
|
|
|
|
27
|
|
|
public const EXPORTS = 'Exports'; |
28
|
|
|
|
29
|
|
|
public const GOOGLE_APPS = 'GoogleApps'; |
30
|
|
|
|
31
|
|
|
public const GRANTS = 'Grants'; |
32
|
|
|
|
33
|
|
|
public const INSURANCE = 'Insurance'; |
34
|
|
|
|
35
|
|
|
public const JOURNAL = 'Journal'; |
36
|
|
|
|
37
|
|
|
public const MATERIAL = 'Material'; |
38
|
|
|
|
39
|
|
|
public const MESSAGE = 'Message'; |
40
|
|
|
|
41
|
|
|
public const ORGANIZATION_UNIT = 'OrganizationUnit'; |
42
|
|
|
|
43
|
|
|
public const POWER = 'Power'; |
44
|
|
|
|
45
|
|
|
public const REPORTS = 'Reports'; |
46
|
|
|
|
47
|
|
|
public const SUMMARY = 'Summary'; |
48
|
|
|
|
49
|
|
|
public const TASK = 'Task'; |
50
|
|
|
|
51
|
|
|
public const TELEPHONY = 'Telephony'; |
52
|
|
|
|
53
|
|
|
public const USER_MANAGEMENT = 'UserManagement'; |
54
|
|
|
|
55
|
|
|
public const VIVANT = 'Vivant'; |
56
|
|
|
|
57
|
|
|
public const WELCOME = 'Welcome'; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var string[] |
61
|
|
|
*/ |
62
|
|
|
private static $cachedConstants = []; |
63
|
|
|
|
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return string[] |
67
|
|
|
*/ |
68
|
5 |
|
private static function getConstants(): array |
69
|
|
|
{ |
70
|
5 |
|
if (!self::$cachedConstants) { |
|
|
|
|
71
|
1 |
|
$reflect = new ReflectionClass(static::class); |
72
|
1 |
|
self::$cachedConstants = $reflect->getConstants(); |
|
|
|
|
73
|
|
|
} |
74
|
|
|
|
75
|
5 |
|
return self::$cachedConstants; |
76
|
|
|
} |
77
|
|
|
|
78
|
5 |
|
public static function isValidServiceName( |
79
|
|
|
string $name |
80
|
|
|
): bool { |
81
|
5 |
|
return in_array($name, self::getConstants(), true); |
82
|
|
|
} |
83
|
|
|
} |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.