mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Allow custom API keys to be created
This commit is contained in:
@@ -43,7 +43,7 @@ class ApiKeyFixture extends AbstractFixture implements DependentFixtureInterface
|
||||
|
||||
private function buildApiKey(string $key, bool $enabled, ?Chronos $expiresAt = null): ApiKey
|
||||
{
|
||||
$apiKey = $expiresAt !== null ? ApiKey::fromMeta(ApiKeyMeta::withExpirationDate($expiresAt)) : ApiKey::create();
|
||||
$apiKey = ApiKey::fromMeta(ApiKeyMeta::fromParams(expirationDate: $expiresAt));
|
||||
$ref = new ReflectionObject($apiKey);
|
||||
$keyProp = $ref->getProperty('key');
|
||||
$keyProp->setAccessible(true);
|
||||
|
||||
Reference in New Issue
Block a user