Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 26, 2023
1 parent c169fcc commit 6821d74
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Caching/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final public function getStorage(): Storage
*/
final public function getNamespace(): string
{
return (string) substr($this->namespace, 0, -1);
return substr($this->namespace, 0, -1);
}


Expand Down
6 changes: 3 additions & 3 deletions tests/Storages/FileStorage.deadlock.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ try {
} catch (Throwable $e) {
}

Assert::noError(function () use ($cache) {
$cache->load('key', function () {});
});
Assert::noError(
fn() => $cache->load('key', function () {}),
);
8 changes: 5 additions & 3 deletions tests/Storages/FileStorage.exceptions.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ use Tester\Assert;
require __DIR__ . '/../bootstrap.php';


Assert::exception(function () {
new FileStorage(getTempDir() . '/missing');
}, Nette\DirectoryNotFoundException::class, "Directory '%a%' not found.");
Assert::exception(
fn() => new FileStorage(getTempDir() . '/missing'),
Nette\DirectoryNotFoundException::class,
"Directory '%a%' not found.",
);


Assert::exception(function () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Storages/FileStorage.stress.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ set_time_limit(0);
function randomStr()
{
$s = str_repeat('LaTrine', rand(10, 2000));
return sha1($s, true) . $s;
return sha1($s, binary: true) . $s;
}


function checkStr($s)
{
return substr($s, 0, 20) === sha1(substr($s, 20), true);
return substr($s, 0, 20) === sha1(substr($s, 20), binary: true);
}


Expand Down

0 comments on commit 6821d74

Please sign in to comment.