Standardized how the ShortUrlMeta object is created by exposing a single named constructor

This commit is contained in:
Alejandro Celaya
2020-01-26 08:42:51 +01:00
parent 8ca45eb388
commit 45151cdde6
13 changed files with 74 additions and 105 deletions

View File

@@ -27,15 +27,7 @@ class CreateShortUrlAction extends AbstractCreateShortUrlAction
]);
}
$meta = ShortUrlMeta::createFromParams(
$postData['validSince'] ?? null,
$postData['validUntil'] ?? null,
$postData['customSlug'] ?? null,
$postData['maxVisits'] ?? null,
$postData['findIfExists'] ?? null,
$postData['domain'] ?? null,
);
$meta = ShortUrlMeta::fromRawData($postData);
return new CreateShortUrlData(new Uri($postData['longUrl']), (array) ($postData['tags'] ?? []), $meta);
}
}