Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Sep 13, 2021
1 parent 5cdd709 commit f47c301
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Wayback.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class Wayback

public function __construct(?string $cachePath = null)
{
$cachePath = $cachePath ?? sys_get_temp_dir() . '/wayback';
$cachePath ??= sys_get_temp_dir() . '/wayback';
FileSystem::createDir($cachePath);
$this->cache = new Cache(new FileStorage($cachePath), 'wayback');
}
Expand Down Expand Up @@ -93,7 +93,7 @@ public function getSubdomains(string $host): array

$return = [];
foreach ($cache as $hostDomain => $firstSeen) {
$return[$hostDomain] = new \DateTimeImmutable($firstSeen);
$return[(string) $hostDomain] = new \DateTimeImmutable($firstSeen);
}

return $return;
Expand Down Expand Up @@ -128,10 +128,7 @@ private function getResults(string $url): array

usort(
$cache,
static function (array $a, array $b): int
{
return $a[1] < $b[1] ? 1 : -1;
}
static fn(array $a, array $b): int => $a[1] < $b[1] ? 1 : -1
);

$this->cache->save(
Expand Down

0 comments on commit f47c301

Please sign in to comment.