-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathForge.php
More file actions
65 lines (54 loc) · 1.6 KB
/
Forge.php
File metadata and controls
65 lines (54 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
declare(strict_types=1);
/**
* Anchor Framework
*
* Forge Facade provides a static interface for license operations.
*
* @author BenIyke <beniyke34@gmail.com> | Twitter: @BigBeniyke
*/
namespace Forge;
use Forge\Models\Licence;
use Forge\Services\AnalyticsManagerService;
use Forge\Services\Builders\LicenceBuilder;
use Forge\Services\LicenceManagerService;
class Forge
{
/**
* Start a fluent license generation builder.
*/
public static function make(): LicenceBuilder
{
return resolve(LicenceManagerService::class)->make();
}
/**
* Activate a license for a client.
*/
public static function activate(Licence|int|string $licence, mixed $client): bool
{
return resolve(LicenceManagerService::class)->activate($licence, $client);
}
public static function analytics(): AnalyticsManagerService
{
return resolve(AnalyticsManagerService::class);
}
public static function verify(string $key): ?Licence
{
return resolve(LicenceManagerService::class)->verify($key);
}
public static function findByRefid(string $refid): ?Licence
{
return resolve(LicenceManagerService::class)->findByRefid($refid);
}
public static function revoke(Licence|int|string $licence): bool
{
return resolve(LicenceManagerService::class)->revoke($licence);
}
/**
* Forward static calls to LicenceManagerService.
*/
public static function __callStatic(string $method, array $arguments): mixed
{
return resolve(LicenceManagerService::class)->$method(...$arguments);
}
}