@@ -233,7 +233,7 @@ public static function getOutsideIP(): string
233
233
{
234
234
list ($ code , $ output ) = self ::run ('ip addr | grep eth0 ' );
235
235
236
- if ($ code === 0 && $ output && preg_match ('#inet (.*)\/# ' , $ output , $ ms )) {
236
+ if ($ code === 0 && $ output && \ preg_match ('#inet (.*)\/# ' , $ output , $ ms )) {
237
237
return $ ms [1 ];
238
238
}
239
239
@@ -252,7 +252,7 @@ public static function getOutsideIP(): string
252
252
* not get up to date values on every terminal.
253
253
* @return array|boolean An array of ($width, $height) or false when it was not able to determine size.
254
254
*/
255
- public static function getScreenSize ($ refresh = false )
255
+ public static function getScreenSize (bool $ refresh = false )
256
256
{
257
257
static $ size ;
258
258
if ($ size !== null && !$ refresh ) {
@@ -264,8 +264,8 @@ public static function getScreenSize($refresh = false)
264
264
$ stty = [];
265
265
266
266
if (
267
- exec ('stty -a 2>&1 ' , $ stty ) &&
268
- preg_match ('/rows\s+(\d+);\s*columns\s+(\d+);/mi ' , implode (' ' , $ stty ), $ matches )
267
+ \ exec ('stty -a 2>&1 ' , $ stty ) &&
268
+ \ preg_match ('/rows\s+(\d+);\s*columns\s+(\d+);/mi ' , implode (' ' , $ stty ), $ matches )
269
269
) {
270
270
return ($ size = [$ matches [2 ], $ matches [1 ]]);
271
271
}
@@ -283,12 +283,12 @@ public static function getScreenSize($refresh = false)
283
283
284
284
if (self ::isWindows ()) {
285
285
$ output = [];
286
- exec ('mode con ' , $ output );
286
+ \ exec ('mode con ' , $ output );
287
287
288
288
if (isset ($ output [1 ]) && strpos ($ output [1 ], 'CON ' ) !== false ) {
289
289
return ($ size = [
290
- (int )preg_replace ('~\D~ ' , '' , $ output [3 ]),
291
- (int )preg_replace ('~\D~ ' , '' , $ output [4 ])
290
+ (int )\ preg_replace ('~\D~ ' , '' , $ output [3 ]),
291
+ (int )\ preg_replace ('~\D~ ' , '' , $ output [4 ])
292
292
]);
293
293
}
294
294
}
@@ -300,7 +300,7 @@ public static function getScreenSize($refresh = false)
300
300
* @param string $program
301
301
* @return int|string
302
302
*/
303
- public static function getCpuUsage ($ program )
303
+ public static function getCpuUsage (string $ program )
304
304
{
305
305
if (!$ program ) {
306
306
return -1 ;
@@ -312,10 +312,10 @@ public static function getCpuUsage($program)
312
312
}
313
313
314
314
/**
315
- * @param $program
315
+ * @param string $program
316
316
* @return int|string
317
317
*/
318
- public static function getMemUsage ($ program )
318
+ public static function getMemUsage (string $ program )
319
319
{
320
320
if (!$ program ) {
321
321
return -1 ;
0 commit comments