@@ -59,15 +59,10 @@ public function createApproval(int $projectId, array $data): ?StringTranslationA
59
59
* Approval Info
60
60
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.get API Documentation
61
61
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.approvals.get API Documentation Enterprise
62
- *
63
- * @param int $projectId
64
- * @param int $approvalId
65
- * @return StringTranslationApproval|null
66
62
*/
67
63
public function getApproval (int $ projectId , int $ approvalId ): ?StringTranslationApproval
68
64
{
69
65
$ path = sprintf ('projects/%d/approvals/%d ' , $ projectId , $ approvalId );
70
-
71
66
return $ this ->_get ($ path , StringTranslationApproval::class);
72
67
}
73
68
@@ -86,10 +81,21 @@ public function deleteApproval(int $projectId, int $approvalId)
86
81
return $ this ->_delete ($ path );
87
82
}
88
83
84
+ /**
85
+ * Remove String Approvals
86
+ * @link https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.deleteMany API Documentation
87
+ * @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.approvals.deleteMany API Documentation Enterprise
88
+ */
89
+ public function deleteStringApprovals (int $ projectId , int $ stringId ): void
90
+ {
91
+ $ this ->_delete (sprintf ('projects/%d/approvals ' , $ projectId ), ['stringId ' => $ stringId ]);
92
+ }
93
+
89
94
/**
90
95
* List Language Translations
91
96
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.languages.translations.getMany API Documentation
92
97
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.languages.translations.getMany API Documentation Enterprise
98
+ *
93
99
* @param int $projectId
94
100
* @param string $languageId
95
101
* @param array $params
@@ -162,28 +168,26 @@ public function create(int $projectId, array $data): ?StringTranslation
162
168
*
163
169
* @param int $projectId
164
170
* @param int $stringId
165
- * @param string $languageId
171
+ * @param null| string $languageId
166
172
* @return mixed
167
173
*/
168
- public function deleteStringTranslations (int $ projectId , int $ stringId , string $ languageId )
174
+ public function deleteStringTranslations (int $ projectId , int $ stringId , ? string $ languageId = null )
169
175
{
170
- $ path = sprintf ('projects/%d/translations ' , $ projectId );
171
176
$ params = [
172
177
'stringId ' => $ stringId ,
173
- 'languageId ' => $ languageId ,
174
178
];
175
179
176
- return $ this ->_delete ($ path , $ params );
180
+ if ($ languageId !== null ) {
181
+ $ params ['languageId ' ] = $ languageId ;
182
+ }
183
+
184
+ return $ this ->_delete (sprintf ('projects/%d/translations ' , $ projectId ), $ params );
177
185
}
178
186
179
187
/**
180
188
* Get Translation
181
189
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.translations.get API Documentation
182
190
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.translations.get API Documentation Enterprise
183
- *
184
- * @param int $projectId
185
- * @param int $translationId
186
- * @return StringTranslation|null
187
191
*/
188
192
public function get (int $ projectId , int $ translationId ): ?StringTranslation
189
193
{
@@ -195,15 +199,10 @@ public function get(int $projectId, int $translationId): ?StringTranslation
195
199
* Restore Translation
196
200
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.translations.put API Documentation Enterprise
197
201
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.translations.put API Documentation Enterprise
198
- *
199
- * @param int $projectId
200
- * @param int $translationId
201
- * @return StringTranslation|null
202
202
*/
203
203
public function restore (int $ projectId , int $ translationId ): ?StringTranslation
204
204
{
205
205
$ path = sprintf ('projects/%d/translations/%d ' , $ projectId , $ translationId );
206
-
207
206
return $ this ->_put ($ path , StringTranslation::class, []);
208
207
}
209
208
@@ -248,16 +247,11 @@ public function listVotes(int $projectId, array $params = []): ModelCollection
248
247
* Get Vote
249
248
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.votes.get API Documentation
250
249
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.votes.get API Documentation Enterprise
251
- *
252
- * @param int $projectId
253
- * @param int $voteId
254
- * @return Vote|null
255
250
*/
256
251
public function getVote (int $ projectId , int $ voteId ): ?Vote
257
252
{
258
253
$ path = sprintf ('projects/%d/votes/%d ' , $ projectId , $ voteId );
259
-
260
- return $ this ->_get ($ path , Vote::class);
254
+ return $ this ->_get ($ path , Vote::class);
261
255
}
262
256
263
257
/**
0 commit comments