forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSplType.php
99 lines (89 loc) · 2.61 KB
/
SplType.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/**
* Abstract parent class for all SPL types.
*
* @link http://php.net/manual/en/class.spltype.php
*/
abstract class SplType {
/**
* @var null Default value
* @link http://php.net/manual/en/class.spltype.php#spltype.constants.default
*/
const __default = null;
/**
* Creates a new value of some type
*
* @param mixed $initial_value
* @param bool $strict If set to true then will throw UnexpectedValueException if value of other type will be assigned. True by default
* @link http://php.net/manual/en/spltype.construct.php
*/
public function __construct ($initial_value = self::__default, $strict = true ){ }
}
/**
* The SplInt class is used to enforce strong typing of the integer type.
*
* @link http://php.net/manual/en/class.splint.php
*/
class SplInt extends SplType {
/**
* @link http://php.net/manual/en/class.splint.php#splint.constants.default
*/
const __default = 0 ;
}
/**
* The SplFloat class is used to enforce strong typing of the float type.
*
* @link http://php.net/manual/en/class.splfloat.php
*/
class SplFloat extends SplType {
const __default = 0 ;
}
/**
* SplEnum gives the ability to emulate and create enumeration objects natively in PHP.
*
* @link http://php.net/manual/en/class.splenum.php
*/
class SplEnum extends SplType {
/**
* @link http://php.net/manual/en/class.splenum.php#splenum.constants.default
*/
const __default = null ;
/**
* Returns all consts (possible values) as an array.
*
* @param bool $include_default Whether to include __default constant (property). False by default.
* @return array
* @link http://php.net/manual/en/splenum.getconstlist.php
*/
public function getConstList ($include_default = false) {}
}
/**
* The SplBool class is used to enforce strong typing of the bool type.
*
* @link http://php.net/manual/en/class.splbool.php
*/
class SplBool extends SplEnum {
/**
* @link http://php.net/manual/en/class.splbool.php#splbool.constants.default
*/
const __default = false ;
/**
* @link http://php.net/manual/en/class.splbool.php#splbool.constants.false
*/
const false = false ;
/**
* @link http://php.net/manual/en/class.splbool.php#splbool.constants.true
*/
const true = true ;
}
/**
* The SplString class is used to enforce strong typing of the string type.
*
* @link http://php.net/manual/en/class.splstring.php
*/
class SplString extends SplType {
/**
* @link http://php.net/manual/en/class.splstring.php#splstring.constants.default
*/
const __default = 0 ;
}