Skip to content

Commit 6821d74

Browse files
committed
cs
1 parent c169fcc commit 6821d74

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/Caching/Cache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ final public function getStorage(): Storage
9595
*/
9696
final public function getNamespace(): string
9797
{
98-
return (string) substr($this->namespace, 0, -1);
98+
return substr($this->namespace, 0, -1);
9999
}
100100

101101

tests/Storages/FileStorage.deadlock.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ try {
2424
} catch (Throwable $e) {
2525
}
2626

27-
Assert::noError(function () use ($cache) {
28-
$cache->load('key', function () {});
29-
});
27+
Assert::noError(
28+
fn() => $cache->load('key', function () {}),
29+
);

tests/Storages/FileStorage.exceptions.phpt

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ use Tester\Assert;
1414
require __DIR__ . '/../bootstrap.php';
1515

1616

17-
Assert::exception(function () {
18-
new FileStorage(getTempDir() . '/missing');
19-
}, Nette\DirectoryNotFoundException::class, "Directory '%a%' not found.");
17+
Assert::exception(
18+
fn() => new FileStorage(getTempDir() . '/missing'),
19+
Nette\DirectoryNotFoundException::class,
20+
"Directory '%a%' not found.",
21+
);
2022

2123

2224
Assert::exception(function () {

tests/Storages/FileStorage.stress.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ set_time_limit(0);
2020
function randomStr()
2121
{
2222
$s = str_repeat('LaTrine', rand(10, 2000));
23-
return sha1($s, true) . $s;
23+
return sha1($s, binary: true) . $s;
2424
}
2525

2626

2727
function checkStr($s)
2828
{
29-
return substr($s, 0, 20) === sha1(substr($s, 20), true);
29+
return substr($s, 0, 20) === sha1(substr($s, 20), binary: true);
3030
}
3131

3232

0 commit comments

Comments
 (0)