diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7623ea1..12e2284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,32 +3,12 @@ name: CI on: pull_request jobs: - cs: - name: PHP CS Fixer - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - coverage: none - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: Run PHP CS Fixer - run: composer cs - tests: name: PestPHP Tests runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout repository @@ -45,33 +25,11 @@ jobs: - name: Run tests run: composer test - integration-tests: - name: PestPHP Integration Tests - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['8.1', '8.2', '8.3'] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: Install chrome - uses: browser-actions/setup-chrome@latest - - name: Run integration tests run: composer test-integration - stan: - name: PHPStan + stanAndCs: + name: Static Analysis (phpstan) and Code Style (PHP CS Fixer) runs-on: ubuntu-latest steps: @@ -89,3 +47,6 @@ jobs: - name: Run PHPStan run: composer stan + + - name: Run PHP CS Fixer + run: composer cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f7b6a..2c283ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.1.3] - 2024-11-05 +### Fixed +* Improvements for deprecations in PHP 8.4. + ## [2.1.2] - 2024-10-22 ### Fixed * Issue when converting cookie objects received from the chrome-php library. diff --git a/src/Loader/Http/Cookies/CookieJar.php b/src/Loader/Http/Cookies/CookieJar.php index 7a55f04..6fedd28 100644 --- a/src/Loader/Http/Cookies/CookieJar.php +++ b/src/Loader/Http/Cookies/CookieJar.php @@ -137,6 +137,7 @@ protected function buildSetCookieHeaderFromBrowserCookie(BrowserCookie $cookie): foreach ($attributes as $name => $setCookieName) { $setCookieValue = $cookie->offsetGet($name); + if (empty($setCookieValue)) { continue; } @@ -146,12 +147,14 @@ protected function buildSetCookieHeaderFromBrowserCookie(BrowserCookie $cookie): if ($setCookieValue !== -1) { $parts[] = sprintf('%s=%s', $setCookieName, $this->formatExpiresValue($setCookieValue)); } + continue; } // Flag attributes if ($setCookieValue === true) { $parts[] = $setCookieName; + continue; } diff --git a/src/Steps/Loading/HttpBase.php b/src/Steps/Loading/HttpBase.php index cd9355a..1750e1c 100644 --- a/src/Steps/Loading/HttpBase.php +++ b/src/Steps/Loading/HttpBase.php @@ -106,7 +106,7 @@ public function useInputKeyAsBody(string $key): static * * If input is an array with string keys, you can choose a key from that array and map it to an HTTP request header. */ - public function useInputKeyAsHeader(string $key, string $asHeader = null): static + public function useInputKeyAsHeader(string $key, ?string $asHeader = null): static { $asHeader = $asHeader ?? $key; diff --git a/src/Stores/SimpleCsvFileStore.php b/src/Stores/SimpleCsvFileStore.php index fae1116..48ee5be 100644 --- a/src/Stores/SimpleCsvFileStore.php +++ b/src/Stores/SimpleCsvFileStore.php @@ -30,7 +30,7 @@ public function store(Result $result): void } if ($this->isFirstResult) { - fputcsv($fileHandle, array_keys($result->toArray())); + fputcsv($fileHandle, array_keys($result->toArray()), escape: ''); $this->isFirstResult = false; } @@ -41,7 +41,7 @@ public function store(Result $result): void $resultArray = $this->flattenResultArray($resultArray); } - fputcsv($fileHandle, array_values($resultArray)); + fputcsv($fileHandle, array_values($resultArray), escape: ''); fclose($fileHandle); }