Skip to content

Commit f342e4b

Browse files
committed
Bump PHP minimum version to 8.1
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
1 parent ad36438 commit f342e4b

File tree

7 files changed

+40
-42
lines changed

7 files changed

+40
-42
lines changed

Diff for: .github/workflows/lint-and-analyse-php.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ jobs:
1111
- name: Checkout code
1212
uses: actions/checkout@v4
1313

14-
- name: Set up PHP 7.1
14+
- name: Set up PHP 8.1
1515
uses: shivammathur/setup-php@v2
1616
with:
17-
php-version: 7.1
18-
tools: composer:v2
17+
php-version: 8.1
1918

2019
- name: Validate composer.json and composer.lock
2120
run: composer validate --strict
@@ -34,11 +33,10 @@ jobs:
3433
- name: Checkout code
3534
uses: actions/checkout@v4
3635

37-
- name: Set up PHP 7.1
36+
- name: Set up PHP 8.1
3837
uses: shivammathur/setup-php@v2
3938
with:
40-
php-version: 7.1
41-
tools: composer:v2
39+
php-version: 8.1
4240
extensions: dbase
4341

4442
- name: Install Composer dependencies

Diff for: .github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
continue-on-error: ${{ matrix.experimental }}
1212
strategy:
1313
matrix:
14-
php-version: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
14+
php-version: ['8.1', '8.2', '8.3']
1515
php-extensions: ['dbase', ':dbase']
1616
os: [ubuntu-latest]
1717
experimental: [false]

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
7+
### Removed
8+
- Drop support for PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4 and PHP 8.0
79

810
## [3.0.2] - 2023-09-11
911
### Added

Diff for: composer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
]
3131
},
3232
"require": {
33-
"php": "^7.1 || ^8.0"
33+
"php": "^8.1"
3434
},
3535
"suggest": {
3636
"ext-dbase": "For dbf files parsing"
@@ -39,7 +39,7 @@
3939
"phpmyadmin/coding-standard": "^3.0.0",
4040
"phpstan/phpstan": "^1.4.10",
4141
"phpstan/phpstan-phpunit": "^1.0",
42-
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.3"
42+
"phpunit/phpunit": "^10.3"
4343
},
4444
"autoload": {
4545
"psr-4": {
@@ -56,5 +56,10 @@
5656
"allow-plugins": {
5757
"dealerdirect/phpcodesniffer-composer-installer": true
5858
}
59+
},
60+
"extra": {
61+
"branch-alias": {
62+
"dev-master": "4.0-dev"
63+
}
5964
}
6065
}

Diff for: phpstan-baseline.neon

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ parameters:
66
path: src/ShapeFile.php
77

88
-
9-
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
9+
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
1010
count: 1
1111
path: src/ShapeFile.php
1212

1313
-
14-
message: "#^Parameter \\#1 \\$fp of function feof expects resource, resource\\|false given\\.$#"
14+
message: "#^Parameter \\#1 \\$stream of function feof expects resource, resource\\|false given\\.$#"
1515
count: 1
1616
path: src/ShapeFile.php
1717

1818
-
19-
message: "#^Parameter \\#1 \\$fp of function feof expects resource, resource\\|null given\\.$#"
19+
message: "#^Parameter \\#1 \\$stream of function feof expects resource, resource\\|null given\\.$#"
2020
count: 1
2121
path: src/ShapeFile.php
2222

2323
-
24-
message: "#^Parameter \\#1 \\$fp of function fread expects resource, resource\\|false given\\.$#"
24+
message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|false given\\.$#"
2525
count: 1
2626
path: src/ShapeFile.php
2727

2828
-
29-
message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|null given\\.$#"
29+
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|null given\\.$#"
3030
count: 10
3131
path: src/ShapeFile.php
3232

3333
-
34-
message: "#^Parameter \\#1 \\$str of function strtoupper expects string, mixed given\\.$#"
34+
message: "#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#"
3535
count: 1
3636
path: src/ShapeFile.php
3737

Diff for: phpunit.xml.dist

+19-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false">
11-
<logging>
12-
<log type="coverage-clover" target="build/logs/clover.xml" />
13-
</logging>
14-
<testsuites>
15-
<testsuite name="Main">
16-
<directory suffix=".php">./tests</directory>
17-
</testsuite>
18-
</testsuites>
19-
<filter>
20-
<whitelist processUncoveredFilesFromWhitelist="true">
21-
<directory suffix=".php">src/</directory>
22-
</whitelist>
23-
</filter>
5+
cacheDirectory="build/.phpunit.cache"
6+
colors="true">
7+
<source>
8+
<include>
9+
<directory suffix=".php">src</directory>
10+
</include>
11+
</source>
12+
<coverage>
13+
<report>
14+
<clover outputFile="build/logs/clover.xml"/>
15+
</report>
16+
</coverage>
17+
<testsuites>
18+
<testsuite name="Main">
19+
<directory suffix=".php">tests</directory>
20+
</testsuite>
21+
</testsuites>
2422
</phpunit>

Diff for: tests/ShapeFileTest.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use PHPUnit\Framework\TestCase;
3131

3232
use function count;
33-
use function method_exists;
3433

3534
class ShapeFileTest extends TestCase
3635
{
@@ -291,11 +290,7 @@ public function testSaveNoDBF(): void
291290
$shp = new ShapeFile(1);
292291
$shp->saveToFile('./data/test_nodbf.*');
293292

294-
if (method_exists($this, 'assertFileDoesNotExist')) {
295-
$this->assertFileDoesNotExist('./data/test_nodbf.dbf');
296-
} else {
297-
$this->assertFileNotExists('./data/test_nodbf.dbf');
298-
}
293+
$this->assertFileDoesNotExist('./data/test_nodbf.dbf');
299294
}
300295

301296
/**

0 commit comments

Comments
 (0)