Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 61.11% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class CreateRecords implements ShouldQueue |
||
12 | { |
||
13 | use Dispatchable, Queueable; |
||
14 | |||
15 | private array $data; |
||
16 | private string $apiKey; |
||
17 | private string $baseId; |
||
18 | private string $tableName; |
||
19 | |||
20 | 5 | public function __construct(array $data, string $apiKey, string $baseId, string $tableName) |
|
21 | { |
||
22 | 5 | $this->data = $data; |
|
23 | 5 | $this->apiKey = $apiKey; |
|
24 | 5 | $this->baseId = $baseId; |
|
25 | 5 | $this->tableName = $tableName; |
|
26 | 5 | } |
|
27 | |||
28 | public function middleware() |
||
29 | { |
||
30 | $rateLimitedMiddleware = (new RateLimited()) |
||
31 | ->key('airtable') |
||
32 | ->allow(1) |
||
33 | ->everySeconds(1) |
||
34 | ->releaseAfterSeconds(3); |
||
35 | |||
36 | return [$rateLimitedMiddleware]; |
||
37 | } |
||
38 | |||
39 | 1 | public function handle(AirTable $airTable) |
|
45 | 1 | } |
|
46 | |||
47 | } |