Skip to content

Commit bec3710

Browse files
authored
Merge pull request #18 from macocci7/support_php85
Support php85
2 parents e21b3dc + ab42910 commit bec3710

6 files changed

Lines changed: 53 additions & 42 deletions

File tree

.github/workflows/test_pull_request.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
php: ['8.1', '8.2', '8.3', '8.4']
11+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
1212

1313
steps:
1414
- name: Set up PHP
@@ -19,12 +19,12 @@ jobs:
1919
tools: composer:v2
2020

2121
- name: Set up Node
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v6
2323
with:
24-
node-version: '22.x'
24+
node-version: '24.x'
2525

2626
- name: Checkout code
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
with:
2929
fetch-depth: 0
3030

@@ -74,12 +74,12 @@ jobs:
7474
tools: composer:v2
7575

7676
- name: Set up Node
77-
uses: actions/setup-node@v4
77+
uses: actions/setup-node@v6
7878
with:
79-
node-version: '22.x'
79+
node-version: '24.x'
8080

8181
- name: Checkout code
82-
uses: actions/checkout@v4
82+
uses: actions/checkout@v5
8383
with:
8484
fetch-depth: 0
8585

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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
44

55
## 1. Features
66

7-
`Bash Colorizer` outputs strings in specified colors and attributes.
7+
`Bash Colorizer` outputs strings to the bash terminal with specified colors and attributes.
88

99
Let's make your `bash` terminal full of colors!
1010

11+
```php
12+
use Macocci7\BashColorizer\Colorizer;
13+
14+
Colorizer::attributes(['italic'])
15+
->foreground('#ffff00')
16+
->background('#0000ff')
17+
->echo('Hi, there!', PHP_EOL);
18+
```
19+
1120
## 2. Contents
1221

1322
- [1. Features](#1-features)
@@ -31,7 +40,7 @@ Let's make your `bash` terminal full of colors!
3140

3241
- PHP 8.1 or later installed
3342
- Composer v2 installed
34-
- Bash v5 installed
43+
- Bash v5 installed (or Zsh)
3544

3645
## 5. Installation
3746

bin/TestAndLint.sh

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# - https://github.com/jdx/mise 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,40 @@ if [ $? -ne 0 ]; then
1919
exit 1
2020
fi
2121

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

28-
echo "[[TestAndLint.sh]]"
55+
echo "[[TesAndLint.sh]]"
2956

3057
SUPPORTED_PHP_VERSIONS=PHP_VERSIONS
3158
if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then
@@ -40,6 +67,6 @@ if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then
4067
fi
4168
STR_CMD=''
4269
while read version ; do
43-
STR_CMD="$STR_CMD switch_version $version;"
70+
STR_CMD="$STR_CMD test_and_lint $version;"
4471
done < $SUPPORTED_PHP_VERSIONS
4572
eval $STR_CMD

bin/TestAndLintSub.sh

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require-dev": {
1919
"phpunit/phpunit": "^10.5",
2020
"php-parallel-lint/php-parallel-lint": "^1.4",
21-
"squizlabs/php_codesniffer": "^3.12",
21+
"squizlabs/php_codesniffer": "^4",
2222
"phpstan/phpstan": "^2.1"
2323
}
2424
}

0 commit comments

Comments
 (0)