mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Update dependencies
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user