Skip to content

Commit 52eb980

Browse files
ci: add php8.x to GitHub workflow (#22)
* ci: add php8.x to GitHub workflow * ci: fix GitHub action versions * ci: drop code analysis flow and php 7.1, 7.2 and 7.3 * fix: failing tests on php8.5
1 parent b9d1f53 commit 52eb980

File tree

5 files changed

+14
-48
lines changed

5 files changed

+14
-48
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,13 @@ on:
77
pull_request:
88

99
jobs:
10-
code-analysis:
11-
runs-on: ubuntu-latest
12-
name: Code Analysis (PHP ${{ matrix.php-versions }})
13-
strategy:
14-
fail-fast: false
15-
matrix:
16-
php-versions: [ '7.4' ]
17-
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v2
20-
21-
- name: Setup PHP, with composer and extensions
22-
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
23-
with:
24-
php-version: ${{ matrix.php-versions }}
25-
tools: composer
26-
27-
- name: Get composer cache directory
28-
id: composer-cache
29-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
30-
31-
- name: Cache composer dependencies
32-
uses: actions/cache@v2
33-
with:
34-
path: ${{ steps.composer-cache.outputs.dir }}
35-
# Use composer.json for key, if composer.lock is not committed.
36-
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
37-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38-
restore-keys: ${{ runner.os }}-composer-
39-
40-
- name: Install Composer dependencies
41-
run: composer install --no-progress --prefer-dist --optimize-autoloader
42-
43-
# - name: PHP CS-Fixer
44-
# run: php vendor/bin/php-cs-fixer fix --dry-run --diff
45-
46-
# - name: PHPStan
47-
# run: composer phpstan
48-
4910
unit-testing:
5011
name: PHPUnit (PHP ${{ matrix.php-versions }})
5112
runs-on: ubuntu-latest
5213
strategy:
5314
fail-fast: false
5415
matrix:
55-
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
16+
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
5617
coverage: [ 'xdebug' ] # ZipStreamerTest depends on xdebug_get_headers => if coverage none/pcov then xdebug is disabled.
5718
steps:
5819
- name: Checkout
@@ -71,7 +32,7 @@ jobs:
7132
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
7233

7334
- name: Cache composer dependencies
74-
uses: actions/cache@v2
35+
uses: actions/cache@v4
7536
with:
7637
path: ${{ steps.composer-cache.outputs.dir }}
7738
# Use composer.json for key, if composer.lock is not committed.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
}
3737
],
3838
"require": {
39-
"php": ">=7.1",
39+
"php": ">=7.4",
40+
"ext-http": ">=0.10",
4041
"ext-mbstring": "*"
4142
},
4243
"require-dev": {

src/Count64.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@
2626
use ZipStreamer\Lib\Count64_64;
2727
use ZipStreamer\Lib\Count64Base;
2828

29-
const INT64_HIGH_MAP = 0xffffffff00000000;
30-
const INT64_LOW_MAP = 0x00000000ffffffff;
29+
// Use bit shift operations instead of hex literals to avoid float representation in PHP 8.5+
30+
/** @var int */
31+
const INT64_HIGH_MAP = (0xffffffff << 32);
32+
/** @var int */
33+
const INT64_LOW_MAP = 0xffffffff;
34+
/** @var int */
3135
const INT_MAX_32 = 0xffffffff;
3236

3337
/**

0 commit comments

Comments
 (0)