From 41bb532fa84842ace81175336ecb93f1b6593f5e Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Tue, 22 Oct 2024 10:06:48 +0200 Subject: [PATCH] Update GH Actions script to include organization prefix (#109) * Update GH Actions script to include organization prefix * linter fixes --- .github/workflows/commands-handler.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/run-tests.yml | 4 ++-- .github/workflows/run-validations.yml | 6 +++--- phpstan-baseline.neon | 5 ----- src/PubNub/CryptoModule.php | 2 +- .../Consumer/FileSharing/PNGetFileDownloadURLResult.php | 2 +- 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index 48f71d24..51f8668f 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -12,7 +12,7 @@ jobs: name: Process command if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true runs-on: - group: Default + group: organization/Default steps: - name: Check referred user id: user-check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f6123dc..4250dbe2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: name: Check release required if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true runs-on: - group: Default + group: organization/Default outputs: release: ${{ steps.check.outputs.ready }} steps: @@ -31,7 +31,7 @@ jobs: needs: check-release if: needs.check-release.outputs.release == 'true' runs-on: - group: Default + group: organization/Default steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e5f5cae7..ef51f81c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: tests: name: Integration and Unit tests runs-on: - group: Default + group: organization/Default strategy: max-parallel: 1 fail-fast: true @@ -69,7 +69,7 @@ jobs: name: Tests needs: [tests] runs-on: - group: Default + group: organization/Default steps: - name: Tests summary run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 42aae75f..e9ad0e54 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -14,7 +14,7 @@ jobs: lint-project: name: "Lint project" runs-on: - group: Default + group: organization/Default strategy: max-parallel: 1 fail-fast: true @@ -64,7 +64,7 @@ jobs: pubnub-yml: name: "Validate .pubnub.yml" runs-on: - group: Default + group: organization/Default steps: - name: Checkout project uses: actions/checkout@v4 @@ -86,7 +86,7 @@ jobs: name: Validations needs: [pubnub-yml, lint-project] runs-on: - group: Default + group: organization/Default steps: - name: Validations summary run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f9ac3628..93d2cefa 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -3145,11 +3145,6 @@ parameters: count: 1 path: src/PubNub/Models/Consumer/FileSharing/PNGetFileDownloadURLResult.php - - - message: "#^Method PubNub\\\\Models\\\\Consumer\\\\FileSharing\\\\PNGetFileDownloadURLResult\\:\\:__toString\\(\\) should return string but returns int\\.$#" - count: 1 - path: src/PubNub/Models/Consumer/FileSharing/PNGetFileDownloadURLResult.php - - message: "#^Method PubNub\\\\Models\\\\Consumer\\\\FileSharing\\\\PNGetFileDownloadURLResult\\:\\:getFileUrl\\(\\) has no return type specified\\.$#" count: 1 diff --git a/src/PubNub/CryptoModule.php b/src/PubNub/CryptoModule.php index 47c71f96..b3b1c2e3 100644 --- a/src/PubNub/CryptoModule.php +++ b/src/PubNub/CryptoModule.php @@ -178,7 +178,7 @@ public function parseInput(string | object $input): string throw new PubNubResponseParsingException("Decryption error: message is not a string or object"); } - if (strlen($input) == '') { + if (trim($input) == '') { throw new PubNubResponseParsingException("Decryption error: message is empty"); } return $input; diff --git a/src/PubNub/Models/Consumer/FileSharing/PNGetFileDownloadURLResult.php b/src/PubNub/Models/Consumer/FileSharing/PNGetFileDownloadURLResult.php index e13fa413..54b0fe63 100644 --- a/src/PubNub/Models/Consumer/FileSharing/PNGetFileDownloadURLResult.php +++ b/src/PubNub/Models/Consumer/FileSharing/PNGetFileDownloadURLResult.php @@ -13,7 +13,7 @@ public function __construct($result) public function __toString() { - return "Get file URL success with URL: %s" % $this->fileUrl; + return "Get file URL success with URL: {$this->fileUrl}"; } public function getFileUrl()