forked from phpowermove/php-code-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstantsInterface.php
More file actions
76 lines (67 loc) · 1.5 KB
/
ConstantsInterface.php
File metadata and controls
76 lines (67 loc) · 1.5 KB
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
<?php
namespace gossi\codegen\model;
/**
* Interface to all php structs that can have constants
*
* Implementation is realized in the `ConstantsPart`
*
* @author Thomas Gossmann
*/
interface ConstantsInterface {
/**
* Sets a collection of constants
*
* @param array|PhpConstant[] $constants
* @return $this
*/
public function setConstants(array $constants);
/**
* Adds a constant
*
* @param string|PhpConstant $nameOrConstant constant or name
* @param string $value
* @return $this
*/
public function setConstant($nameOrConstant, $value = null);
/**
* Removes a constant
*
* @param string|PhpConstant $nameOrConstant $nameOrConstant constant or name
* @throws \InvalidArgumentException If the constant cannot be found
* @return $this
*/
public function removeConstant($nameOrConstant);
/**
* Checks whether a constant exists
*
* @param string|PhpConstant $nameOrConstant
* @return bool
*/
public function hasConstant($nameOrConstant);
/**
* Returns a constant
*
* @param string|PhpConstant $nameOrConstant constant or name
* @throws \InvalidArgumentException If the constant cannot be found
* @return PhpConstant
*/
public function getConstant($nameOrConstant);
/**
* Returns constants
*
* @return PhpConstant[]
*/
public function getConstants();
/**
* Returns all constant names
*
* @return string[]
*/
public function getConstantNames();
/**
* Clears all constants
*
* @return $this
*/
public function clearConstants();
}