mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 05:18:40 +00:00
Typhints and global defs
This commit is contained in:
parent
6d09524436
commit
5473f38805
|
|
@ -192,11 +192,9 @@ class PriorityQueue implements \Countable, \Serializable
|
||||||
*
|
*
|
||||||
* @param string $data Data to unserialze
|
* @param string $data Data to unserialze
|
||||||
*
|
*
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function unserialize($data) : array
|
public function unserialize($data)
|
||||||
{
|
{
|
||||||
$this->queue = json_decode($data);
|
$this->queue = json_decode($data);
|
||||||
$this->count = count($this->queue);
|
$this->count = count($this->queue);
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ class SystemUtils
|
||||||
$mem = 0;
|
$mem = 0;
|
||||||
|
|
||||||
if (stristr(PHP_OS, 'WIN')) {
|
if (stristr(PHP_OS, 'WIN')) {
|
||||||
|
$mem = null;
|
||||||
exec('wmic memorychip get capacity', $mem);
|
exec('wmic memorychip get capacity', $mem);
|
||||||
|
|
||||||
/** @var array $mem */
|
/** @var array $mem */
|
||||||
|
|
@ -107,6 +108,7 @@ class SystemUtils
|
||||||
$cpuusage = 0;
|
$cpuusage = 0;
|
||||||
|
|
||||||
if (stristr(PHP_OS, 'WIN') !== false) {
|
if (stristr(PHP_OS, 'WIN') !== false) {
|
||||||
|
$cpuusage = null;
|
||||||
exec('wmic cpu get LoadPercentage', $cpuusage);
|
exec('wmic cpu get LoadPercentage', $cpuusage);
|
||||||
$cpuusage = $cpuusage[1];
|
$cpuusage = $cpuusage[1];
|
||||||
} elseif (stristr(PHP_OS, 'LINUX') !== false) {
|
} elseif (stristr(PHP_OS, 'LINUX') !== false) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user