Skip to content

Commit

Permalink
Update CI, fix Psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed May 8, 2024
1 parent c3e794e commit e2f9f17
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

continue-on-error: ${{ matrix.php-versions == '8.3' }}
continue-on-error: ${{ matrix.php-versions == '8.4' }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -27,11 +27,11 @@ jobs:

- name: Install Composer dependencies (PHP < 8.1)
if: ${{ matrix.php-versions != '8.3' }}
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v3"

- name: Install Composer dependencies - ignore-platform-reqs (PHP 8.1)
if: ${{ matrix.php-versions == '8.3' }}
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v3"
with:
composer-options: --ignore-platform-reqs

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -22,7 +22,7 @@ jobs:
coverage: none

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v3"
with:
composer-options: --no-dev

Expand Down
7 changes: 5 additions & 2 deletions src/CSPBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ public function addSource(string $directive, string $path): self
if (!isset($this->policies[$directive]['allow'])) {
$this->policies[$directive]['allow'] = [];
}
if (!in_array($path, $this->policies[$directive]['allow'], true)) {
$this->policies[$directive]['allow'][] = $path;
if (is_array($this->policies[$directive]['allow'])) {
if (!in_array($path, $this->policies[$directive]['allow'], true)) {
$this->policies[$directive]['allow'][] = $path;
}
}
return $this;
}
Expand Down Expand Up @@ -1268,6 +1270,7 @@ protected function enc(string $piece, string $type = 'default'): string
* Is this user currently connected over HTTPS?
*
* @return bool
* @psalm-suppress RiskyTruthyFalsyComparison
*/
protected function isHTTPSConnection(): bool
{
Expand Down

0 comments on commit e2f9f17

Please sign in to comment.