Skip to content

Upgrade dependencies #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tag_meged_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: xdebug
tools: composer:v2

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
tools: composer:v2

- name: Checkout code
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3']
php: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Set up PHP
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: '20.x'

- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -88,10 +88,10 @@ jobs:
- name: Neon Lint
run: ./vendor/nette/neon/bin/neon-lint conf

- name: PHP MD
run: |
./vendor/bin/phpmd --version
./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml
#- name: PHP MD
# run: |
# ./vendor/bin/phpmd --version
# ./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml

- name: PHP Code Sniffer
run: |
Expand All @@ -115,7 +115,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1']
php: ['8.3']

steps:
- name: Set up PHP
Expand All @@ -128,7 +128,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: '20.x'

- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
composer.lock
.php-version
.tool-versions
1 change: 1 addition & 0 deletions PHP_VERSIONS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
8.4
8.3
8.2
8.1
173 changes: 89 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ You can also retrieve parsed data:

- PHP 8.1 or later
- Imagick PHP Extension

Check with commands:
```php
php -i | grep imagick
```
- Composer

## 4. Installation
Expand Down Expand Up @@ -544,90 +549,90 @@ Then, run the PHP code.

```bash
array(2) {
["John"]=>
array(6) {
["count"]=>
int(11)
["x"]=>
array(5) {
["Mean"]=>
int(6)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
int(10)
["StandardDeviation"]=>
float(3.1622776601683795)
}
["y"]=>
array(5) {
["Mean"]=>
int(5)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
float(10.181818181818182)
["StandardDeviation"]=>
float(3.1908961408698624)
}
["Covariance"]=>
float(5.181818181818182)
["CorrelationCoefficient"]=>
float(0.5135343537364686)
["RegressionLineFormula"]=>
array(2) {
["a"]=>
float(0.5181818181818182)
["b"]=>
float(1.8909090909090907)
}
["John"]=>
array(6) {
["count"]=>
int(11)
["x"]=>
array(5) {
["Mean"]=>
int(6)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
int(10)
["StandardDeviation"]=>
float(3.1622776601683795)
}
["y"]=>
array(5) {
["Mean"]=>
int(5)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
float(10.181818181818182)
["StandardDeviation"]=>
float(3.1908961408698624)
}
["Covariance"]=>
float(5.181818181818182)
["CorrelationCoefficient"]=>
float(0.5135343537364686)
["RegressionLineFormula"]=>
array(2) {
["a"]=>
float(0.5181818181818182)
["b"]=>
float(1.8909090909090907)
}
}
["Jake"]=>
array(6) {
["count"]=>
int(11)
["x"]=>
array(5) {
["Mean"]=>
int(6)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
int(10)
["StandardDeviation"]=>
float(3.1622776601683795)
}
["y"]=>
array(5) {
["Mean"]=>
int(6)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
int(10)
["StandardDeviation"]=>
float(3.1622776601683795)
}
["Jake"]=>
array(6) {
["count"]=>
int(11)
["x"]=>
array(5) {
["Mean"]=>
int(6)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
int(10)
["StandardDeviation"]=>
float(3.1622776601683795)
}
["y"]=>
array(5) {
["Mean"]=>
int(6)
["Max"]=>
int(11)
["Min"]=>
int(1)
["Variance"]=>
int(10)
["StandardDeviation"]=>
float(3.1622776601683795)
}
["Covariance"]=>
float(-9.454545454545455)
["CorrelationCoefficient"]=>
float(-0.9454545454545453)
["RegressionLineFormula"]=>
array(2) {
["a"]=>
float(-0.9454545454545455)
["b"]=>
float(11.672727272727274)
}
["Covariance"]=>
float(-9.454545454545455)
["CorrelationCoefficient"]=>
float(-0.9454545454545453)
["RegressionLineFormula"]=>
array(2) {
["a"]=>
float(-0.9454545454545455)
["b"]=>
float(11.672727272727274)
}
}
}
```

Expand Down Expand Up @@ -659,6 +664,6 @@ Then, run the PHP code.

*Document written: 2023/06/06*

*Document updated: 2024/04/18*
*Document updated: 2025/01/04*

Copyright 2023 - 2024 macocci7.
Copyright 2023 - 2025 macocci7.
48 changes: 7 additions & 41 deletions bin/TestAndLint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/bash

# Script to Test and Lint
# - for the repository: macocci7/php-scatterplot
# requirement:
# - phpenv/phpenv
# - https://github.com/jdx/mise installed
# - PHP versions defined in ../PHP_VERSIONS installed

CMD=phpenv
CMD=mise
$CMD -v &> /dev/null
if [ $? -ne 0 ]; then
echo "command [${CMD}] not found!"
Expand All @@ -20,46 +19,13 @@ if [ $? -ne 0 ]; then
exit 1
fi

test_and_lint() {
switch_version() {
echo "==========================================================="
echo "[PHP $1][phpenv local $1]"
phpenv local $1
if [ $? -ne 0 ]; then
echo "Failed to switch version to $i. skipped."
return 1
fi
echo "-----------------------------------------------------------"
echo "[PHP $1][php -v]"
php -v
echo "-----------------------------------------------------------"
echo "[PHP $1][parallel-lint]"
./vendor/bin/parallel-lint src tests examples
echo "-----------------------------------------------------------"
echo "[PHP $1][neon-lint]"
./vendor/nette/neon/bin/neon-lint conf
echo "-----------------------------------------------------------"
echo "[PHP $1][phpcs]"
./vendor/bin/phpcs --ignore=vendor \
--standard=phpcs.xml \
-p \
-s \
.
echo "-----------------------------------------------------------"
echo "[PHP $1][phpmd]"
./vendor/bin/phpmd \
./src/ ./examples/ ./tests/ text \
phpmd.xml
echo "-----------------------------------------------------------"
echo "[PHP $1][phpstan]"
./vendor/bin/phpstan analyze -c phpstan.neon
echo "-----------------------------------------------------------"
echo "[PHP $1][phpunit]"
./vendor/bin/phpunit ./tests/ \
--color=auto
echo "-----------------------------------------------------------"
echo "[PHP $1][Switching PHP version to $1]"
mise x php@$1 -- bash bin/TestAndLintSub.sh $1;
}

echo "[[TesAndLint.sh]]"
echo "[[TestAndLint.sh]]"

SUPPORTED_PHP_VERSIONS=PHP_VERSIONS
if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then
Expand All @@ -74,6 +40,6 @@ if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then
fi
STR_CMD=''
while read version ; do
STR_CMD="$STR_CMD test_and_lint $version;"
STR_CMD="$STR_CMD switch_version $version;"
done < $SUPPORTED_PHP_VERSIONS
eval $STR_CMD
34 changes: 34 additions & 0 deletions bin/TestAndLintSub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/bash

# Script to Test and Lint
# requirement:
# - PHP versions defined in ../PHP_VERSIONS installed

echo "-----------------------------------------------------------"
echo "[PHP $1][php -v]"
php -v
echo "-----------------------------------------------------------"
echo "[PHP $1][parallel-lint]"
./vendor/bin/parallel-lint src tests examples
echo "-----------------------------------------------------------"
echo "[PHP $1][neon-lint]"
./vendor/nette/neon/bin/neon-lint conf
echo "-----------------------------------------------------------"
echo "[PHP $1][phpcs]"
./vendor/bin/phpcs --ignore=vendor \
--standard=phpcs.xml \
-p \
-s \
.
#echo "-----------------------------------------------------------"
#echo "[PHP $1][phpmd]"
#./vendor/bin/phpmd \
# ./src/ ./examples/ ./tests/ text \
# phpmd.xml
echo "-----------------------------------------------------------"
echo "[PHP $1][phpstan]"
./vendor/bin/phpstan analyze -c phpstan.neon
echo "-----------------------------------------------------------"
echo "[PHP $1][phpunit]"
./vendor/bin/phpunit ./tests/
echo "-----------------------------------------------------------"
Loading
Loading