| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function pullLangs() |
||
| 44 | { |
||
| 45 | $client = new Client(['verify' => false]); |
||
| 46 | $response = $client->post('https://api.lokalise.co/api/project/export', [ |
||
| 47 | 'multipart' => [ |
||
| 48 | [ |
||
| 49 | 'name' => 'api_token', |
||
| 50 | 'contents' => $this->apiKey |
||
| 51 | ], |
||
| 52 | [ |
||
| 53 | 'name' => 'id', |
||
| 54 | 'contents' => $this->projectId |
||
| 55 | ], |
||
| 56 | [ |
||
| 57 | 'name' => 'type', |
||
| 58 | 'contents' => 'php' |
||
| 59 | ], |
||
| 60 | [ |
||
| 61 | 'name' => 'use_original', |
||
| 62 | 'contents' => '1' |
||
| 63 | ], |
||
| 64 | [ |
||
| 65 | 'name' => 'export_empty', |
||
| 66 | 'contents' => 'skip' |
||
| 67 | ], |
||
| 68 | ], |
||
| 69 | ]); |
||
| 70 | |||
| 71 | $body = $response->getBody(); |
||
| 72 | $details = json_decode($body); |
||
| 73 | return $details->bundle->file; |
||
| 74 | } |
||
| 75 | } |