Skip to content

Commit eb25785

Browse files
authored
Merge pull request #19 from macocci7/support_php_8.5
Support PHP 8.5
2 parents c76f571 + 3f95f25 commit eb25785

File tree

9 files changed

+39
-203
lines changed

9 files changed

+39
-203
lines changed

.github/workflows/tag_meged_pull_request.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/test_pull_request.yml

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,12 @@ name: Test and Static Analysis (Pull Request)
33
on: pull_request
44

55
jobs:
6-
check-version-in-composer-json:
7-
name: Check Version
8-
runs-on: ubuntu-latest
9-
10-
steps:
11-
- name: Set up PHP
12-
uses: shivammathur/setup-php@v2
13-
with:
14-
php-version: 8.3
15-
tools: composer:v2
16-
17-
- name: Checkout code
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
22-
- name: PHP Version Check
23-
run: php -v
24-
25-
- name: Validate Composer JSON
26-
run: composer validate
27-
28-
- name: Get Version From Comopser JSON
29-
id: new-version
30-
run: |
31-
echo version=$(cat composer.json | grep version | head -1 | grep -Po '\d+\.\d+\.\d+') >> $GITHUB_OUTPUT
32-
33-
- name: Show New Version
34-
run: echo "version=${{ steps.new-version.outputs.version }}"
35-
36-
- name: Show Tags
37-
run: git tag
38-
39-
- name: Check If The Version Is Not In The Tag List
40-
run: |
41-
for tag in `git tag`
42-
do
43-
if [ $tag = ${{ steps.new-version.outputs.version }} ]; then
44-
echo "version ${{ steps.new-version.outputs.version }} already exists."
45-
exit 1
46-
fi
47-
done
48-
echo "OK."
49-
506
test-and-static-analysis:
517
name: Test and Lint
528
runs-on: ubuntu-latest
539
strategy:
5410
matrix:
55-
php: ['8.1', '8.2', '8.3', '8.4']
11+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
5612

5713
steps:
5814
- name: Set up PHP
@@ -63,12 +19,12 @@ jobs:
6319
tools: composer:v2
6420

6521
- name: Set up Node
66-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v6
6723
with:
68-
node-version: '20.x'
24+
node-version: '24.x'
6925

7026
- name: Checkout code
71-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
7228
with:
7329
fetch-depth: 0
7430

@@ -88,11 +44,6 @@ jobs:
8844
- name: Neon Lint
8945
run: ./vendor/nette/neon/bin/neon-lint conf
9046

91-
#- name: PHP MD
92-
# run: |
93-
# ./vendor/bin/phpmd --version
94-
# ./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml
95-
9647
- name: PHP Code Sniffer
9748
run: |
9849
./vendor/bin/phpcs --version
@@ -115,7 +66,7 @@ jobs:
11566
runs-on: ubuntu-latest
11667
strategy:
11768
matrix:
118-
php: ['8.3']
69+
php: ['8.4']
11970

12071
steps:
12172
- name: Set up PHP
@@ -126,12 +77,12 @@ jobs:
12677
tools: composer:v2
12778

12879
- name: Set up Node
129-
uses: actions/setup-node@v4
80+
uses: actions/setup-node@v6
13081
with:
131-
node-version: '20.x'
82+
node-version: '24.x'
13283

13384
- name: Checkout code
134-
uses: actions/checkout@v4
85+
uses: actions/checkout@v5
13586
with:
13687
fetch-depth: 0
13788

PHP_VERSIONS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
8.5
12
8.4
23
8.3
34
8.2

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,4 @@ Then, run the PHP code.
662662

663663
***
664664

665-
*Document written: 2023/06/06*
666-
667-
*Document updated: 2025/01/04*
668-
669665
Copyright 2023 - 2025 macocci7.

bin/CheckVersion.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

bin/TestAndLint.sh

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# Script to Test and Lint
44
# requirement:
5-
# - https://github.com/jdx/mise installed
5+
# - https://github.com/phpenv/phpenv installed
66
# - PHP versions defined in ../PHP_VERSIONS installed
77

8-
CMD=mise
8+
CMD=phpenv
99
$CMD -v &> /dev/null
1010
if [ $? -ne 0 ]; then
1111
echo "command [${CMD}] not found!"
@@ -19,13 +19,33 @@ if [ $? -ne 0 ]; then
1919
exit 1
2020
fi
2121

22-
switch_version() {
23-
echo "==========================================================="
24-
echo "[PHP $1][Switching PHP version to $1]"
25-
mise x php@$1 -- bash bin/TestAndLintSub.sh $1;
22+
test_and_lint() {
23+
echo "-----------------------------------------------------------"
24+
echo "[PHP $1][php -v]"
25+
php -v
26+
echo "-----------------------------------------------------------"
27+
echo "[PHP $1][parallel-lint]"
28+
./vendor/bin/parallel-lint src tests examples
29+
echo "-----------------------------------------------------------"
30+
echo "[PHP $1][neon-lint]"
31+
./vendor/nette/neon/bin/neon-lint conf
32+
echo "-----------------------------------------------------------"
33+
echo "[PHP $1][phpcs]"
34+
./vendor/bin/phpcs --ignore=vendor \
35+
--standard=phpcs.xml \
36+
-p \
37+
-s \
38+
.
39+
echo "-----------------------------------------------------------"
40+
echo "[PHP $1][phpstan]"
41+
./vendor/bin/phpstan analyze -c phpstan.neon
42+
echo "-----------------------------------------------------------"
43+
echo "[PHP $1][phpunit]"
44+
./vendor/bin/phpunit ./tests/
45+
echo "-----------------------------------------------------------"
2646
}
2747

28-
echo "[[TestAndLint.sh]]"
48+
echo "[[TesAndLint.sh]]"
2949

3050
SUPPORTED_PHP_VERSIONS=PHP_VERSIONS
3151
if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then
@@ -40,6 +60,6 @@ if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then
4060
fi
4161
STR_CMD=''
4262
while read version ; do
43-
STR_CMD="$STR_CMD switch_version $version;"
63+
STR_CMD="$STR_CMD test_and_lint $version;"
4464
done < $SUPPORTED_PHP_VERSIONS
4565
eval $STR_CMD

bin/TestAndLintSub.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "macocci7/php-scatterplot",
33
"description": "PHP-Scatterplot is a simple PHP library to create scatter plot easily.",
4-
"version": "1.2.3",
54
"type": "library",
65
"license": "MIT",
76
"autoload": {
@@ -18,14 +17,14 @@
1817
"minimum-stability": "stable",
1918
"require": {
2019
"php": ">=8.1",
21-
"intervention/image": "^3.10",
20+
"intervention/image": "^3.11",
2221
"macocci7/php-frequency-table": "^1.4",
2322
"macocci7/php-csv": "^1.1",
2423
"macocci7/php-combination": "^1.1",
2524
"nette/neon": "^3.4"
2625
},
2726
"require-dev": {
28-
"squizlabs/php_codesniffer": "^3.11",
27+
"squizlabs/php_codesniffer": "^4.0",
2928
"phpunit/phpunit": "^10.5",
3029
"phpstan/phpstan": "^2.1",
3130
"php-parallel-lint/php-parallel-lint": "^1.4"

tests/Helpers/ConfigTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function test_load_can_load_config_file_correctly(): void
3232
Config::load();
3333
$r = new \ReflectionClass(Config::class);
3434
$p = $r->getProperty('conf');
35-
$p->setAccessible(true);
3635
$this->assertSame(
3736
Neon::decodeFile($this->testConf),
3837
$p->getValue()[$this::class]

0 commit comments

Comments
 (0)