PluginProbe
User Access Manager / 2.1.11
User Access Manager v2.1.11
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Wrapper/Php.php +104 -30 2.3.13 → 2.1.11 View file →
@@ -1,19 +1,35 @@
1 1 <?php
2 -
3 -declare(strict_types=1);
4 -
2 +/**
3 + * Php.php
4 + *
5 + * The Php class file.
6 + *
7 + * PHP versions 5
8 + *
9 + * @author Alexander Schneider <[email protected]>
10 + * @copyright 2008-2017 Alexander Schneider
11 + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
12 + * @version SVN: $id$
13 + * @link http://wordpress.org/extend/plugins/user-access-manager/
14 + */
5 15 namespace UserAccessManager\Wrapper;
6 16
7 -use Exception;
8 -use JetBrains\PhpStorm\NoReturn;
9 -
17 +/**
18 + * Class Php
19 + *
20 + * @package UserAccessManager\Wrapper
21 + */
10 22 class Php
11 23 {
12 24 /**
13 25 * @see function_exists()
26 + *
27 + * @param string $functionName
28 + *
29 + * @return bool
14 30 */
15 - public function functionExists(string $functionName): bool
31 + public function functionExists($functionName)
16 32 {
17 33 return function_exists($functionName);
18 34 }
19 35
@@ -18,10 +34,16 @@
18 34 }
19 35
20 36 /**
21 37 * @see array_fill()
38 + *
39 + * @param int $startIndex
40 + * @param int $numberOfElements
41 + * @param mixed $value
42 + *
43 + * @return array
22 44 */
23 - public function arrayFill(int $startIndex, int $numberOfElements, mixed $value): array
45 + public function arrayFill($startIndex, $numberOfElements, $value)
24 46 {
25 47 return array_fill($startIndex, $numberOfElements, $value);
26 48 }
27 49
@@ -26,21 +48,28 @@
26 48 }
27 49
28 50 /**
29 51 * @see openssl_random_pseudo_bytes()
52 + *
53 + * @param int $length
54 + * @param bool $strong
55 + *
56 + * @return string
30 57 */
31 - public function opensslRandomPseudoBytes(int $length, ?bool &$strong = false): bool|string
58 + public function opensslRandomPseudoBytes($length, &$strong)
32 59 {
33 60 return openssl_random_pseudo_bytes($length, $strong);
34 61 }
35 62
36 63 /**
37 - * @param string $filename
38 - * @param null $context
64 + * @see unlink()
65 + *
66 + * @param string $filename
67 + * @param resource $context
68 + *
39 69 * @return bool
40 - * @see unlink()
41 70 */
42 - public function unlink(string $filename, $context = null): bool
71 + public function unlink($filename, $context = null)
43 72 {
44 73 return ($context !== null) ? unlink($filename, $context) : unlink($filename);
45 74 }
46 75
@@ -45,10 +74,14 @@
45 74 }
46 75
47 76 /**
48 77 * @see ini_get()
78 + *
79 + * @param string $variableName
80 + *
81 + * @return string
49 82 */
50 - public function iniGet(string $variableName): int|string|false
83 + public function iniGet($variableName)
51 84 {
52 85 return ini_get($variableName);
53 86 }
54 87
@@ -53,10 +86,14 @@
53 86 }
54 87
55 88 /**
56 89 * @see set_time_limit()
90 + *
91 + * @param int $seconds
92 + *
93 + * @return bool
57 94 */
58 - public function setTimeLimit(int $seconds): bool
95 + public function setTimeLimit($seconds)
59 96 {
60 97 return @set_time_limit($seconds);
61 98 }
62 99
@@ -61,23 +98,32 @@
61 98 }
62 99
63 100 /**
64 101 * @see fread()
102 + *
103 + * @param resource $handle
104 + * @param int $length
105 + *
106 + * @return bool|string
65 107 */
66 - public function fread($handle, int $length): false|string
108 + public function fread($handle, $length)
67 109 {
68 110 return fread($handle, $length);
69 111 }
70 112
71 113 /**
72 - * @throws Exception
114 + * @param mixed $controller
115 + * @param string $file
116 + *
117 + * @throws \Exception
73 118 */
74 - public function includeFile($controller, string $file): void
119 + public function includeFile(&$controller, $file)
75 120 {
76 121 if ($controller === null) {
77 - throw new Exception('Controller is required');
122 + throw new \Exception('Controller is required');
78 123 }
79 124
125 + /** @noinspection PhpIncludeInspection */
80 126 include $file;
81 127 }
82 128
83 129 /**
@@ -82,10 +128,9 @@
82 128
83 129 /**
84 130 * @see exit()
85 131 */
86 - #[NoReturn]
87 - public function callExit(): void
132 + public function callExit()
88 133 {
89 134 exit;
90 135 }
91 136
@@ -90,10 +135,17 @@
90 135 }
91 136
92 137 /**
93 138 * @see file_put_contents()
139 + *
140 + * @param string $filename
141 + * @param mixed $data
142 + * @param int $flags
143 + * @param null $context
144 + *
145 + * @return bool|int
94 146 */
95 - public function filePutContents(string $filename, mixed $data, int $flags = 0, $context = null): false|int
147 + public function filePutContents($filename, $data, $flags = 0, $context = null)
96 148 {
97 149 return file_put_contents($filename, $data, $flags, $context);
98 150 }
99 151
@@ -98,36 +150,54 @@
98 150 }
99 151
100 152 /**
101 153 * @see igbinary_serialize()
154 + *
155 + * @param mixed $value
156 + *
157 + * @return string
102 158 */
103 - public function igbinarySerialize(mixed $value): ?string
159 + public function igbinarySerialize($value)
104 160 {
161 + /** @noinspection PhpUndefinedFunctionInspection */
105 162 return igbinary_serialize($value);
106 163 }
107 164
108 165 /**
109 166 * @see igbinary_unserialize()
167 + *
168 + * @param string $key
169 + *
170 + * @return mixed
110 171 */
111 - public function igbinaryUnserialize(string $key): mixed
172 + public function igbinaryUnserialize($key)
112 173 {
174 + /** @noinspection PhpUndefinedFunctionInspection */
113 175 return igbinary_unserialize($key);
114 176 }
115 177
116 178 /**
117 179 * @see mkdir()
180 + *
181 + * @param string $pathname
182 + * @param int $mode
183 + * @param bool $recursive
184 + * @param resource $context
185 + *
186 + * @return bool
118 187 */
119 - public function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): bool
188 + public function mkdir($pathname, $mode = 0777, $recursive = false, $context = null)
120 189 {
121 - return ($context !== null)
122 - ? mkdir($pathname, $mode, $recursive, $context)
123 - : mkdir($pathname, $mode, $recursive);
190 + return ($context !== null) ?
191 + mkdir($pathname, $mode, $recursive, $context) : mkdir($pathname, $mode, $recursive);
124 192 }
125 193
126 194 /**
127 195 * @see connection_status()
196 + *
197 + * @return int
128 198 */
129 - public function connectionStatus(): int
199 + public function connectionStatus()
130 200 {
131 201 return connection_status();
132 202 }
133 203
@@ -132,10 +202,14 @@
132 202 }
133 203
134 204 /**
135 205 * @see fclose()
206 + *
207 + * @param resource $handle
208 + *
209 + * @return bool
136 210 */
137 - public function fClose($handle): bool
211 + public function fClose($handle)
138 212 {
139 213 return fclose($handle);
140 214 }
141 215 }