Update dependencies

This commit is contained in:
Alejandro Celaya
2023-08-19 11:48:04 +02:00
parent aa4b9fc27e
commit b747b8448e
16 changed files with 50 additions and 50 deletions

View File

@@ -139,7 +139,7 @@ class ImportedLinksProcessor implements ImportedLinksProcessorInterface
$importedVisits = 0;
foreach ($iterable as $importedOrphanVisit) {
// Skip visits which are older than the most recent already imported visit's date
if ($mostRecentOrphanVisit?->getDate()->gte(normalizeDate($importedOrphanVisit->date))) {
if ($mostRecentOrphanVisit?->getDate()->greaterThanOrEquals(normalizeDate($importedOrphanVisit->date))) {
continue;
}

View File

@@ -38,7 +38,7 @@ final class ShortUrlImporting
$importedVisits = 0;
foreach ($visits as $importedVisit) {
// Skip visits which are older than the most recent already imported visit's date
if ($mostRecentImportedDate?->gte(normalizeDate($importedVisit->date))) {
if ($mostRecentImportedDate?->greaterThanOrEquals(normalizeDate($importedVisit->date))) {
continue;
}

View File

@@ -319,12 +319,12 @@ class ShortUrl extends AbstractEntity
}
$now = Chronos::now();
$beforeValidSince = $this->validSince !== null && $this->validSince->gt($now);
$beforeValidSince = $this->validSince !== null && $this->validSince->greaterThan($now);
if ($beforeValidSince) {
return false;
}
$afterValidUntil = $this->validUntil !== null && $this->validUntil->lt($now);
$afterValidUntil = $this->validUntil !== null && $this->validUntil->lessThan($now);
if ($afterValidUntil) {
return false;
}

View File

@@ -307,9 +307,9 @@ class ImportedLinksProcessorTest extends TestCase
yield 'existing orphan visit' => [true, [
new ImportedShlinkOrphanVisit('', '', Chronos::now()->subDays(3), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->subDays(2), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->addDay(), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->addDay(), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->addDay(), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->addDays(1), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->addDays(1), '', '', null),
new ImportedShlinkOrphanVisit('', '', Chronos::now()->addDays(1), '', '', null),
], Visit::forBasePath(Visitor::botInstance()), 3];
}

View File

@@ -121,15 +121,15 @@ class ShortUrlResolverTest extends TestCase
return $shortUrl;
})()];
yield 'future validSince' => [ShortUrl::create(ShortUrlCreation::fromRawData(
['validSince' => $now->addMonth()->toAtomString(), 'longUrl' => 'https://longUrl'],
['validSince' => $now->addMonths(1)->toAtomString(), 'longUrl' => 'https://longUrl'],
))];
yield 'past validUntil' => [ShortUrl::create(ShortUrlCreation::fromRawData(
['validUntil' => $now->subMonth()->toAtomString(), 'longUrl' => 'https://longUrl'],
['validUntil' => $now->subMonths(1)->toAtomString(), 'longUrl' => 'https://longUrl'],
))];
yield 'mixed' => [(function () use ($now) {
$shortUrl = ShortUrl::create(ShortUrlCreation::fromRawData([
'maxVisits' => 3,
'validUntil' => $now->subMonth()->toAtomString(),
'validUntil' => $now->subMonths(1)->toAtomString(),
'longUrl' => 'https://longUrl',
]));
$shortUrl->setVisits(new ArrayCollection(map(