Skip to content

Commit 99a345a

Browse files
authored
Merge pull request #760 from Geolim4/master
Fixed #758, #759
2 parents 480fa38 + 8239d81 commit 99a345a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Unit tests
2-
on: [push]
2+
on: [push, pull_request_target]
33
jobs:
44
build:
55
runs-on: ubuntu-latest

lib/Phpfastcache/Drivers/Memcached/Driver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public function driverCheck(): bool
6868
public function getStats(): DriverStatistic
6969
{
7070
$stats = current($this->instance->getStats());
71-
$stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0);
72-
$stats['version'] = (isset($stats['version']) ? $stats['version'] : $this->instance->getVersion());
73-
$stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0);
71+
$stats['uptime'] = $stats['uptime'] ?? 0;
72+
$stats['bytes'] = $stats['bytes'] ?? 0;
73+
$stats['version'] = $stats['version'] ?? $this->instance->getVersion();
7474

7575
$date = (new DateTime())->setTimestamp(time() - $stats['uptime']);
7676

0 commit comments

Comments
 (0)