Skip to content

Commit 1f2a942

Browse files
committed
Fixed typo and type hint
1 parent bcd068f commit 1f2a942

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cache:
2222
- $HOME/pecl_cache
2323
php:
2424
- 8.0
25-
# - 8.1 # Uncomment this when 8.1 will be released
25+
- 8.1
2626
# - nightly # nightly is currently too much unstable many bundled extension are not available...
2727
jobs:
2828
fast_finish: true

lib/Phpfastcache/CacheContract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function get(string $cacheKey, callable $callback, DateInterval|int $expi
3939
{
4040
$cacheItem = $this->cacheInstance->getItem($cacheKey);
4141

42-
if (! $cacheItem->isHit()) {
42+
if (!$cacheItem->isHit()) {
4343
/*
4444
* Parameter $cacheItem will be available as of 8.0.6
4545
*/

lib/Phpfastcache/Config/ConfigurationOption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function setSuperGlobalAccessor(?object $superGlobalAccessor): static
332332
*/
333333
protected function getDefaultSuperGlobalAccessor(): \Closure
334334
{
335-
return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null) {
335+
return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null): string|int|float|array|bool|null {
336336
return match ($superGlobalName) {
337337
'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER,
338338
'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST,

lib/Phpfastcache/Core/Item/CacheItemTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function expiresAfter(int|\DateInterval|null $time): static
119119
if (\is_numeric($time)) {
120120
if ($time <= 0) {
121121
/**
122-
* 5 years, however memcached or memory cached will gone when u restart it
122+
* 5 years, however memcached or memory cached will be gone when u restart it
123123
* just recommended for sqlite. files
124124
*/
125125
$time = 30 * 24 * 3600 * 5;

lib/Phpfastcache/Util/Directory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function getFileCount(string $path): int
6666
}
6767

6868
/**
69-
* Recursively delete a directory and all of it's contents - e.g.the equivalent of `rm -r` on the command-line.
69+
* Recursively delete a directory and all of its contents - e.g.the equivalent of `rm -r` on the command-line.
7070
* Consistent with `rmdir()` and `unlink()`, an E_WARNING level error will be generated on failure.
7171
*
7272
* @param string $source absolute path to directory or file to delete.
@@ -138,7 +138,7 @@ public static function getAbsolutePath(string $path): string
138138
}
139139

140140
/**
141-
* Allows to dereference char
141+
* Allows dereferencing char
142142
*/
143143
$file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
144144
$prefix = $file[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';

tests/CacheContract.test.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/**
3131
* Missing cache item test
3232
*/
33-
$cacheValue = (new CacheContract($cacheInstance))->get($cacheKey, static function () use ($cacheKey, $testHelper, $RandomCacheValue) {
33+
$cacheValue = (new CacheContract($cacheInstance))->get($cacheKey, static function () use ($testHelper, $RandomCacheValue) {
3434
if (func_get_arg(0) instanceof ExtendedCacheItemInterface) {
3535
$testHelper->assertPass('The callback has been received the cache item as a parameter (introduced in 8.0.6).');
3636
} else {
@@ -127,6 +127,7 @@
127127
* Test callable cache contract syntax via __invoke()
128128
* @since 8.0.6
129129
*/
130+
$cacheInstance->clear();
130131
try {
131132
$value = (new CacheContract($cacheInstance))($cacheKey, static function () use ($testHelper) {
132133
$testHelper->assertPass('The CacheContract class is callable via __invoke()');

0 commit comments

Comments
 (0)