original_string: protected function getMemory(): ?Obj
  	{
  		$memory = null;
  		$meminfo = $this->readFile('/proc/meminfo');
  		if ($meminfo) {
  			$bufer = preg_split("/\n/", $meminfo, -1, PREG_SPLIT_NO_EMPTY);
  			$memory = new Obj;
  
  			foreach ($bufer as $buf) {
  				if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->total = ((float) $ar_buf[1]) * 1024;
  				} elseif (preg_match('/^MemFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->free = ((float) $ar_buf[1]) * 1024;
  				} elseif (preg_match('/^Cached:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->cache = ((float) $ar_buf[1]) * 1024;
  				} elseif (preg_match('/^Buffers:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->buffer = ((float) $ar_buf[1]) * 1024;
  				}
  			}
  			$memory->used = $memory->total - $memory->free;
  
  			if ($memory->cache !== null && $memory->buffer !== null) {
  				$memory->application = $memory->used - $memory->cache - $memory->buffer;
  			}
  
  			$memory->swap = [];
  			$swaps = preg_split("/\n/", $this->readFile('/proc/swaps'), -1, PREG_SPLIT_NO_EMPTY);
  			unset($swaps[0]);
  			foreach ($swaps as $swap) {
  				$ar_buf = preg_split('/\s+/', $swap, PREG_BAD_UTF8_OFFSET_ERROR);
  				$swap = new Obj;
  				$swap->mount = $ar_buf[0];
  				$swap->name = 'SWAP';
  				$swap->total = $ar_buf[2] * 1024;
  				$swap->used = $ar_buf[3] * 1024;
  				$swap->free = $swap->total - $swap->used;
  				$memory->swap[] = $swap;
  			}
  		}
  		return $memory;
  	}
code: protected function getMemory(): ?Obj
  	{
  		$memory = null;
  		$meminfo = $this->readFile('/proc/meminfo');
  		if ($meminfo) {
  			$bufer = preg_split("/\n/", $meminfo, -1, PREG_SPLIT_NO_EMPTY);
  			$memory = new Obj;
  
  			foreach ($bufer as $buf) {
  				if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->total = ((float) $ar_buf[1]) * 1024;
  				} elseif (preg_match('/^MemFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->free = ((float) $ar_buf[1]) * 1024;
  				} elseif (preg_match('/^Cached:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->cache = ((float) $ar_buf[1]) * 1024;
  				} elseif (preg_match('/^Buffers:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
  					$memory->buffer = ((float) $ar_buf[1]) * 1024;
  				}
  			}
  			$memory->used = $memory->total - $memory->free;
  
  			if ($memory->cache !== null && $memory->buffer !== null) {
  				$memory->application = $memory->used - $memory->cache - $memory->buffer;
  			}
  
  			$memory->swap = [];
  			$swaps = preg_split("/\n/", $this->readFile('/proc/swaps'), -1, PREG_SPLIT_NO_EMPTY);
  			unset($swaps[0]);
  			foreach ($swaps as $swap) {
  				$ar_buf = preg_split('/\s+/', $swap, PREG_BAD_UTF8_OFFSET_ERROR);
  				$swap = new Obj;
  				$swap->mount = $ar_buf[0];
  				$swap->name = 'SWAP';
  				$swap->total = $ar_buf[2] * 1024;
  				$swap->used = $ar_buf[3] * 1024;
  				$swap->free = $swap->total - $swap->used;
  				$memory->swap[] = $swap;
  			}
  		}
  		return $memory;
  	}
code_tokens: protected function getMemory ( ) : ? Obj { $ memory = null ; $ meminfo = $ this -> readFile ( '/proc/meminfo' ) ; if ( $ meminfo ) { $ bufer = preg_split ( "/\n/" , $ meminfo , - 1 , PREG_SPLIT_NO_EMPTY ) ; $ memory = new Obj ; foreach ( $ bufer as $ buf ) { if ( preg_match ( '/^MemTotal:\s+(.*)\s*kB/i' , $ buf , $ ar_buf ) ) { $ memory -> total = ( ( float ) $ ar_buf [ 1 ] ) * 1024 ; } elseif ( preg_match ( '/^MemFree:\s+(.*)\s*kB/i' , $ buf , $ ar_buf ) ) { $ memory -> free = ( ( float ) $ ar_buf [ 1 ] ) * 1024 ; } elseif ( preg_match ( '/^Cached:\s+(.*)\s*kB/i' , $ buf , $ ar_buf ) ) { $ memory -> cache = ( ( float ) $ ar_buf [ 1 ] ) * 1024 ; } elseif ( preg_match ( '/^Buffers:\s+(.*)\s*kB/i' , $ buf , $ ar_buf ) ) { $ memory -> buffer = ( ( float ) $ ar_buf [ 1 ] ) * 1024 ; } } $ memory -> used = $ memory -> total - $ memory -> free ; if ( $ memory -> cache !== null && $ memory -> buffer !== null ) { $ memory -> application = $ memory -> used - $ memory -> cache - $ memory -> buffer ; } $ memory -> swap = [ ] ; $ swaps = preg_split ( "/\n/" , $ this -> readFile ( '/proc/swaps' ) , - 1 , PREG_SPLIT_NO_EMPTY ) ; unset ( $ swaps [ 0 ] ) ; foreach ( $ swaps as $ swap ) { $ ar_buf = preg_split ( '/\s+/' , $ swap , PREG_BAD_UTF8_OFFSET_ERROR ) ; $ swap = new Obj ; $ swap -> mount = $ ar_buf [ 0 ] ; $ swap -> name = 'SWAP' ; $ swap -> total = $ ar_buf [ 2 ] * 1024 ; $ swap -> used = $ ar_buf [ 3 ] * 1024 ; $ swap -> free = $ swap -> total - $ swap -> used ; $ memory -> swap [ ] = $ swap ; } } return $ memory ; }
docstring: Vrati informace o pameti
  @return Obj|null
docstring_tokens: Vrati informace o pameti