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