Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit b55af46

Browse files
authored
Add support for PHP 8.1 (#18)
1 parent 7047e0e commit b55af46

File tree

7 files changed

+31
-27
lines changed

7 files changed

+31
-27
lines changed

.github/workflows/integrate.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
matrix:
6464
php-version:
6565
- "8.0"
66+
- "8.1"
6667

6768
steps:
6869
- name: "Checkout"
@@ -87,13 +88,8 @@ jobs:
8788
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
8889

8990
- name: "Install dependencies"
90-
if: ${{ matrix.php-version != '8.0' }}
9191
run: "composer update --no-interaction --no-progress"
9292

93-
- name: "Install dependencies PHP 8.0"
94-
if: ${{ matrix.php-version == '8.0' }}
95-
run: "composer update --no-interaction --no-progress --ignore-platform-reqs"
96-
9793
- name: "Run tests"
9894
timeout-minutes: 3
9995
run: "vendor/bin/phpunit --no-coverage --no-logging"

composer.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,14 @@
1616
},
1717
"require-dev": {
1818
"malukenho/mcbumpface": "^1.1.5",
19-
"mikey179/vfsstream": "^1.6.9",
20-
"phpoffice/phpspreadsheet": "^1.18.0",
21-
"phpstan/phpstan": "^0.12.94",
22-
"phpstan/phpstan-phpunit": "^0.12.21",
23-
"phpunit/phpunit": "^9.5.8",
24-
"slam/php-cs-fixer-extensions": "^3.0.1",
19+
"mikey179/vfsstream": "^1.6.10",
20+
"phpoffice/phpspreadsheet": "^1.20.0",
21+
"phpstan/phpstan": "^1.2.0",
22+
"phpstan/phpstan-phpunit": "^1.0.0",
23+
"phpunit/phpunit": "^9.5.10",
24+
"slam/php-cs-fixer-extensions": "^3.1.0",
2525
"slam/php-debug-r": "^1.7.0",
26-
"slam/phpstan-extensions": "^5.1.0"
27-
},
28-
"extra": {
29-
"mc-bumpface": {
30-
"stripVersionPrefixes": true
31-
}
26+
"slam/phpstan-extensions": "^6.0.0"
3227
},
3328
"autoload": {
3429
"psr-4": {
@@ -39,5 +34,10 @@
3934
"psr-4": {
4035
"Slam\\Excel\\Tests\\": "tests/"
4136
}
37+
},
38+
"extra": {
39+
"mc-bumpface": {
40+
"stripVersionPrefixes": true
41+
}
4242
}
4343
}

lib/Helper/Table.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,7 @@ public function setCount(int $count): void
189189
$this->count = $count;
190190
}
191191

192-
/**
193-
* @return null|int
194-
*/
195-
public function count()
192+
public function count(): int
196193
{
197194
if (null === $this->count) {
198195
throw new Exception\RuntimeException('Workbook must set count on table');

lib/Pear/OLE.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ public static function LocalDate2Excel_OLE($date = null)
9494
$res = '';
9595

9696
for ($i = 0; $i < 4; ++$i) {
97-
$hex = $low_part % 0x100;
97+
$hex = \floor($low_part) % 0x100;
9898
$res .= \pack('c', $hex);
9999
$low_part /= 0x100;
100100
}
101101
for ($i = 0; $i < 4; ++$i) {
102-
$hex = $high_part % 0x100;
102+
$hex = \floor($high_part) % 0x100;
103103
$res .= \pack('c', $hex);
104104
$high_part /= 0x100;
105105
}

lib/Pear/Writer/Workbook.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ public function setCountry($code)
253253
*
254254
* @param string $name the optional name of the worksheet
255255
*
256-
* @return mixed reference to a worksheet object on success, Excel_PEAR_Error
257-
* on failure
256+
* @return Worksheet reference to a worksheet object on success, Excel_PEAR_Error
257+
* on failure
258258
*/
259259
public function addWorksheet($name = '')
260260
{

phpstan-baseline.neon

+10
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@ parameters:
55
count: 1
66
path: tests/Helper/ColumnCollectionTest.php
77

8+
-
9+
message: "#^Property Slam\\\\Excel\\\\Tests\\\\Helper\\\\MainTest\\:\\:\\$vfs is never read, only written\\.$#"
10+
count: 1
11+
path: tests/Helper/MainTest.php
12+
13+
-
14+
message: "#^Property Slam\\\\Excel\\\\Tests\\\\Helper\\\\TableWorkbookTest\\:\\:\\$vfs is never read, only written\\.$#"
15+
count: 1
16+
path: tests/Helper/TableWorkbookTest.php
17+

phpstan.neon

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ includes:
44
- phpstan-baseline.neon
55

66
parameters:
7-
level: max
7+
level: 8
88
checkMissingIterableValueType: false
99
paths:
1010
- lib/
1111
- tests/
12-
excludes_analyse:
12+
excludePaths:
13+
analyseAndScan:
1314
- %currentWorkingDirectory%/lib/Pear/*

0 commit comments

Comments
 (0)