| 1 | <?php |
||
| 18 | abstract class Package |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * The Crowdin project id. |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $projectId; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The Crowdin API key. |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $apiKey; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * The HTTP client object. |
||
| 34 | * @var HttpClient |
||
| 35 | */ |
||
| 36 | private $httpClient; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Constructor. |
||
| 40 | * |
||
| 41 | * @param string $projectId The project ID. |
||
| 42 | * @param string $apiKey The API key |
||
| 43 | * @param HttpClient $httpClient The HTTP client object. |
||
| 44 | */ |
||
| 45 | public function __construct($projectId, $apiKey, HttpClient $httpClient) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the project ID. |
||
| 54 | * |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | 1 | protected function getProjectId() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Get the API key. |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | 1 | protected function getApiKey() |
|
| 71 | |||
| 72 | /** |
||
| 73 | * Get the HTTP client object. |
||
| 74 | * |
||
| 75 | * @return HttpClient |
||
| 76 | */ |
||
| 77 | 1 | protected function getHttpClient() |
|
| 81 | |||
| 82 | /** |
||
| 83 | * Get the base path for the command including an action. |
||
| 84 | * |
||
| 85 | * @param string $action The action to perform. |
||
| 86 | * |
||
| 87 | * @return string |
||
| 88 | */ |
||
| 89 | 1 | protected function getBasePath($action) |
|
| 98 | } |
||
| 99 |