Skip to content

Commit ee74c1c

Browse files
Fix missing "$hitRation" variable when OPCache is disabled (#11)
1 parent 1b9366b commit ee74c1c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Fixed
1414

1515
- [#10] Add PHP v8 support
16+
- [#11] Fix missing "$hitRation" variable when OPCache is disabled
1617

1718
## [v0.2.0] - 2020-02-01
1819

@@ -47,3 +48,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4748
[#7]: https://github.com/PabloKowalczyk/CacheStatsBundle/pull/7
4849
[#9]: https://github.com/PabloKowalczyk/CacheStatsBundle/pull/9
4950
[#10]: https://github.com/PabloKowalczyk/CacheStatsBundle/pull/10
51+
[#11]: https://github.com/PabloKowalczyk/CacheStatsBundle/pull/11

src/Application/StatsProvider/OpcacheProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function provide(): OpcacheStats
2929
$internedStringNumber = $opcacheStatus['interned_strings_usage']['number_of_strings'] ?? 0;
3030
$scriptSlotsSize = $opcacheStatus['opcache_statistics']['max_cached_keys'] ?? 0;
3131
$scriptSlotsUsage = $opcacheStatus['opcache_statistics']['num_cached_keys'] ?? 0;
32-
$hitRation = $opcacheStatus['opcache_statistics']['opcache_hit_rate'] ?? 0.0;
32+
$hitRatio = $opcacheStatus['opcache_statistics']['opcache_hit_rate'] ?? 0.0;
3333
}
3434

3535
return new OpcacheStats(
@@ -41,7 +41,7 @@ public function provide(): OpcacheStats
4141
$internedStringNumber,
4242
$scriptSlotsSize,
4343
$scriptSlotsUsage,
44-
$hitRation
44+
$hitRatio
4545
);
4646
}
4747
}

0 commit comments

Comments
 (0)