Skip to content

Commit

Permalink
Merge pull request #26 from macocci7/upgrade_dependencies
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
macocci7 authored Jan 4, 2025
2 parents 116e3c5 + 49d268f commit e1823e8
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 61 deletions.
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
composer.lock
.php-version
.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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,6 @@ with patterns of `size`, `color` and `amount`.

*Document Created: 2023/11/11*

*Document Updated: 2024/05/15*
*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-combination
# 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 "-----------------------------------------------------------"
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "macocci7/php-combination",
"version": "1.1.0",
"description": "a simple PHP library to make combinations",
"version": "1.1.1",
"description": "A simple PHP library to make combinations from array elements.",
"type": "library",
"license": "MIT",
"autoload": {
Expand All @@ -17,12 +17,11 @@
],
"minimum-stability": "stable",
"require-dev": {
"squizlabs/php_codesniffer": "^3.7",
"squizlabs/php_codesniffer": "^3.11",
"phpunit/phpunit": "^10.5",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^1.10",
"php-parallel-lint/php-parallel-lint": "^1.3",
"monolog/monolog": "^3.5"
"phpstan/phpstan": "^2.1",
"php-parallel-lint/php-parallel-lint": "^1.4",
"monolog/monolog": "^3.8"
},
"require": {
"php": ">=8.1"
Expand Down

0 comments on commit e1823e8

Please sign in to comment.