Skip to content

Commit f445d69

Browse files
authored
Keep CI up-to-date (#278)
1 parent 4989685 commit f445d69

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

.github/workflows/phpunit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ jobs:
6161
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
6262
tools: composer
6363

64+
- name: Install svn
65+
run: |
66+
sudo apt update -y --allow-releaseinfo-change
67+
sudo apt install -y subversion
68+
6469
- name: Install PHP dependencies
6570
uses: ramsey/composer-install@v3
6671

inc/Plugin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ static function ( $events ) {
239239
'action' => 'traduttore.updated',
240240
'description' => __( 'When new translations are updated for a project', 'traduttore' ),
241241
'message' => function ( Project $project, array $stats ) {
242+
/**
243+
* @var array<int> $stats
244+
*/
242245
[
243246
$originals_added,
244247
$originals_existing, // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable

inc/WebhookHandler/Bitbucket.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ public function permission_callback(): bool {
3434
return false;
3535
}
3636

37-
$token = $this->request->get_header( 'x-hub-signature-256' );
37+
$token = $this->request->get_header( 'x-hub-signature-256' );
38+
39+
/**
40+
* Request params.
41+
*
42+
* @var array{repository: array{links: array{html: array{href?: string}}}} $params
43+
*/
3844
$params = $this->request->get_params();
3945
$repository = $params['repository']['links']['html']['href'] ?? null;
4046

@@ -67,6 +73,11 @@ public function permission_callback(): bool {
6773
* @return \WP_Error|\WP_REST_Response REST response on success, error object on failure.
6874
*/
6975
public function callback(): \WP_Error|\WP_REST_Response {
76+
/**
77+
* Request params.
78+
*
79+
* @var array{repository: array{scm: string, full_name: string, links: array{html: array{href: string}}, is_private: bool}} $params
80+
*/
7081
$params = $this->request->get_params();
7182

7283
$locator = new ProjectLocator( $params['repository']['links']['html']['href'] );

inc/WebhookHandler/GitHub.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public function permission_callback(): bool {
4747
$params = $this->request->get_params();
4848
$content_type = $this->request->get_content_type();
4949

50+
/**
51+
* Request params.
52+
*
53+
* @var array{payload: string} $params
54+
*/
5055
// See https://developer.github.com/webhooks/creating/#content-type.
5156
if ( ! empty( $content_type ) && 'application/x-www-form-urlencoded' === $content_type['value'] ) {
5257
$params = json_decode( $params['payload'], true );
@@ -95,6 +100,12 @@ public function callback(): \WP_Error|\WP_REST_Response {
95100
$params = $this->request->get_params();
96101
$content_type = $this->request->get_content_type();
97102

103+
/**
104+
* Request params.
105+
*
106+
* @var array{payload: string} $params
107+
*/
108+
98109
// See https://developer.github.com/webhooks/creating/#content-type.
99110
if ( ! empty( $content_type ) && 'application/x-www-form-urlencoded' === $content_type['value'] ) {
100111
$params = json_decode( $params['payload'], true );

inc/WebhookHandler/GitLab.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public function permission_callback(): bool {
4040
return false;
4141
}
4242

43+
/**
44+
* Request params.
45+
*
46+
* @var array{project: array{homepage?: string}} $params
47+
*/
4348
$params = $this->request->get_params();
4449
$repository = $params['project']['homepage'] ?? null;
4550

@@ -67,6 +72,11 @@ public function permission_callback(): bool {
6772
* @return \WP_Error|\WP_REST_Response REST response on success, error object on failure.
6873
*/
6974
public function callback(): \WP_Error|\WP_REST_Response {
75+
/**
76+
* Request params.
77+
*
78+
* @var array{project: array{default_branch: string, homepage: string, path_with_namespace: string, ssh_url: string, http_url: string, visibility_level: int}, ref: string} $params
79+
*/
7080
$params = $this->request->get_params();
7181

7282
// We only care about the default branch but don't want to send an error still.

0 commit comments

Comments
 (0)