Skip to content

Commit b4e4114

Browse files
authored
Merge pull request #37 from macocci7/upgrade_dependencies
Upgrade dependencies
2 parents 238f8d4 + 5b4fd3a commit b4e4114

19 files changed

Lines changed: 61 additions & 99 deletions

.github/workflows/tag_meged_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: 8.2
21+
php-version: 8.3
2222
coverage: xdebug
2323
tools: composer:v2
2424

.github/workflows/test_pull_request.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Set up PHP
1212
uses: shivammathur/setup-php@v2
1313
with:
14-
php-version: 8.2
14+
php-version: 8.3
1515
tools: composer:v2
1616

1717
- name: Checkout code
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
strategy:
5454
matrix:
55-
php: ['8.1', '8.2', '8.3']
55+
php: ['8.1', '8.2', '8.3', '8.4']
5656

5757
steps:
5858
- name: Set up PHP
@@ -65,7 +65,7 @@ jobs:
6565
- name: Set up Node
6666
uses: actions/setup-node@v4
6767
with:
68-
node-version: '14.x'
68+
node-version: '20.x'
6969

7070
- name: Checkout code
7171
uses: actions/checkout@v4
@@ -88,10 +88,10 @@ jobs:
8888
#- name: Neon Lint
8989
# run: ./vendor/nette/neon/bin/neon-lint conf
9090

91-
- name: PHP MD
92-
run: |
93-
./vendor/bin/phpmd --version
94-
./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml
91+
#- name: PHP MD
92+
# run: |
93+
# ./vendor/bin/phpmd --version
94+
# ./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml
9595

9696
- name: PHP Code Sniffer
9797
run: |
@@ -115,7 +115,7 @@ jobs:
115115
runs-on: ubuntu-latest
116116
strategy:
117117
matrix:
118-
php: ['8.1']
118+
php: ['8.3']
119119

120120
steps:
121121
- name: Set up PHP
@@ -128,7 +128,7 @@ jobs:
128128
- name: Set up Node
129129
uses: actions/setup-node@v4
130130
with:
131-
node-version: '14.x'
131+
node-version: '20.x'
132132

133133
- name: Checkout code
134134
uses: actions/checkout@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor/
22
composer.lock
33
.php-version
4+
.tool-versions

PHP_VERSIONS

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

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,4 @@ This class treats basic matters of Bezout's Identity.
605605

606606
***
607607

608-
*Document Created: 2023/10/19*
609-
610-
*Document Updated: 2024/04/18*
611-
612-
Copyright 2023 - 2024 macocci7
608+
Copyright 2023 - 2025 macocci7.

bin/TestAndLint.sh

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/usr/bin/bash
22

33
# Script to Test and Lint
4-
# - for the repository: macocci7/php-math-integer
54
# requirement:
6-
# - phpenv/phpenv
5+
# - https://github.com/jdx/mise installed
76
# - PHP versions defined in ../PHP_VERSIONS installed
87

9-
CMD=phpenv
8+
CMD=mise
109
$CMD -v &> /dev/null
1110
if [ $? -ne 0 ]; then
1211
echo "command [${CMD}] not found!"
@@ -20,46 +19,13 @@ if [ $? -ne 0 ]; then
2019
exit 1
2120
fi
2221

23-
test_and_lint() {
22+
switch_version() {
2423
echo "==========================================================="
25-
echo "[PHP $1][phpenv local $1]"
26-
phpenv local $1
27-
if [ $? -ne 0 ]; then
28-
echo "Failed to switch version to $i. skipped."
29-
return 1
30-
fi
31-
echo "-----------------------------------------------------------"
32-
echo "[PHP $1][php -v]"
33-
php -v
34-
echo "-----------------------------------------------------------"
35-
echo "[PHP $1][parallel-lint]"
36-
./vendor/bin/parallel-lint src tests examples
37-
#echo "-----------------------------------------------------------"
38-
#echo "[PHP $1][neon-lint]"
39-
#./vendor/nette/neon/bin/neon-lint conf
40-
echo "-----------------------------------------------------------"
41-
echo "[PHP $1][phpcs]"
42-
./vendor/bin/phpcs --ignore=vendor \
43-
--standard=phpcs.xml \
44-
-p \
45-
-s \
46-
.
47-
echo "-----------------------------------------------------------"
48-
echo "[PHP $1][phpmd]"
49-
./vendor/bin/phpmd \
50-
./src/ ./examples/ ./tests/ text \
51-
phpmd.xml
52-
echo "-----------------------------------------------------------"
53-
echo "[PHP $1][phpstan]"
54-
./vendor/bin/phpstan analyze -c phpstan.neon
55-
echo "-----------------------------------------------------------"
56-
echo "[PHP $1][phpunit]"
57-
./vendor/bin/phpunit ./tests/ \
58-
--color=auto
59-
echo "-----------------------------------------------------------"
24+
echo "[PHP $1][Switching PHP version to $1]"
25+
mise x php@$1 -- bash bin/TestAndLintSub.sh $1;
6026
}
6127

62-
echo "[[TesAndLint.sh]]"
28+
echo "[[TestAndLint.sh]]"
6329

6430
SUPPORTED_PHP_VERSIONS=PHP_VERSIONS
6531
if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then
@@ -74,6 +40,6 @@ if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then
7440
fi
7541
STR_CMD=''
7642
while read version ; do
77-
STR_CMD="$STR_CMD test_and_lint $version;"
43+
STR_CMD="$STR_CMD switch_version $version;"
7844
done < $SUPPORTED_PHP_VERSIONS
7945
eval $STR_CMD

bin/TestAndLintSub.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/bash
2+
3+
# Script to Test and Lint
4+
# requirement:
5+
# - PHP versions defined in ../PHP_VERSIONS installed
6+
7+
echo "-----------------------------------------------------------"
8+
echo "[PHP $1][php -v]"
9+
php -v
10+
echo "-----------------------------------------------------------"
11+
echo "[PHP $1][parallel-lint]"
12+
./vendor/bin/parallel-lint src tests examples
13+
#echo "-----------------------------------------------------------"
14+
#echo "[PHP $1][neon-lint]"
15+
#./vendor/nette/neon/bin/neon-lint conf
16+
echo "-----------------------------------------------------------"
17+
echo "[PHP $1][phpcs]"
18+
./vendor/bin/phpcs --ignore=vendor \
19+
--standard=phpcs.xml \
20+
-p \
21+
-s \
22+
.
23+
#echo "-----------------------------------------------------------"
24+
#echo "[PHP $1][phpmd]"
25+
#./vendor/bin/phpmd \
26+
# ./src/ ./examples/ ./tests/ text \
27+
# phpmd.xml
28+
echo "-----------------------------------------------------------"
29+
echo "[PHP $1][phpstan]"
30+
./vendor/bin/phpstan analyze -c phpstan.neon
31+
echo "-----------------------------------------------------------"
32+
echo "[PHP $1][phpunit]"
33+
./vendor/bin/phpunit ./tests/
34+
echo "-----------------------------------------------------------"

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "macocci7/php-math-integer",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "PHP Math Library of the subjects of number theory(only natural number).",
55
"type": "library",
66
"license": "MIT",
@@ -20,10 +20,9 @@
2020
"php": ">=8.1"
2121
},
2222
"require-dev": {
23-
"squizlabs/php_codesniffer": "^3.7",
23+
"squizlabs/php_codesniffer": "^3.11",
2424
"phpunit/phpunit": "^10.5",
25-
"phpmd/phpmd": "^2.15",
26-
"phpstan/phpstan": "^1.10",
27-
"php-parallel-lint/php-parallel-lint": "^1.3"
25+
"phpstan/phpstan": "^2.1",
26+
"php-parallel-lint/php-parallel-lint": "^1.4"
2827
}
2928
}

src/Divisor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* class for treating matters of divisors
99
* @author macocci7 <macocci7@yahoo.co.jp>
1010
* @license MIT
11-
* @SuppressWarnings(PHPMD.ElseExpression)
1211
*/
1312
class Divisor extends Prime
1413
{

src/Fraction.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
* class for treating matters of fraction
1212
* @author macocci7 <macocci7@yahoo.co.jp>
1313
* @license MIT
14-
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
15-
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
16-
* @SuppressWarnings(PHPMD.ElseExpression)
1714
*/
1815
class Fraction
1916
{
@@ -58,8 +55,9 @@ class Fraction
5855

5956
/**
6057
* constructor
58+
* @param string|null $s = null
6159
*/
62-
public function __construct(string $s = null)
60+
public function __construct(string|null $s = null)
6361
{
6462
$this->n = new Number();
6563
$this->d = new Divisor();

0 commit comments

Comments
 (0)