Skip to content
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
14 changes: 7 additions & 7 deletions .github/workflows/test_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
php: ['8.1', '8.2', '8.3', '8.4', '8.5']

steps:
- name: Set up PHP
Expand All @@ -19,12 +19,12 @@ jobs:
tools: composer:v2

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

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down Expand Up @@ -74,12 +74,12 @@ jobs:
tools: composer:v2

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

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
1 change: 1 addition & 0 deletions PHP_VERSIONS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
8.5
8.4
8.3
8.2
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@

## 1. Features

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

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

```php
use Macocci7\BashColorizer\Colorizer;

Colorizer::attributes(['italic'])
->foreground('#ffff00')
->background('#0000ff')
->echo('Hi, there!', PHP_EOL);
```

## 2. Contents

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

- PHP 8.1 or later installed
- Composer v2 installed
- Bash v5 installed
- Bash v5 installed (or Zsh)

## 5. Installation

Expand Down
39 changes: 33 additions & 6 deletions bin/TestAndLint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - https://github.com/jdx/mise installed
# - PHP versions defined in ../PHP_VERSIONS installed

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

switch_version() {
test_and_lint() {
echo "==========================================================="
echo "[PHP $1][Switching PHP version to $1]"
mise x php@$1 -- bash bin/TestAndLintSub.sh $1;
echo "[PHP $1][phpenv local $1]"
phpenv local $1
if [ $? -ne 0 ]; then
echo "Failed to switch version to $1. skipped."
return 1
fi
echo "-----------------------------------------------------------"
echo "[PHP $1][php -v]"
php -v
echo "-----------------------------------------------------------"
echo "[PHP $1][parallel-lint]"
./vendor/bin/parallel-lint src tests
#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][phpstan]"
./vendor/bin/phpstan analyze -c phpstan.neon
echo "-----------------------------------------------------------"
echo "[PHP $1][phpunit]"
./vendor/bin/phpunit ./tests/
echo "-----------------------------------------------------------"
}

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

SUPPORTED_PHP_VERSIONS=PHP_VERSIONS
if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then
Expand All @@ -40,6 +67,6 @@ if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then
fi
STR_CMD=''
while read version ; do
STR_CMD="$STR_CMD switch_version $version;"
STR_CMD="$STR_CMD test_and_lint $version;"
done < $SUPPORTED_PHP_VERSIONS
eval $STR_CMD
26 changes: 0 additions & 26 deletions bin/TestAndLintSub.sh

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require-dev": {
"phpunit/phpunit": "^10.5",
"php-parallel-lint/php-parallel-lint": "^1.4",
"squizlabs/php_codesniffer": "^3.12",
"squizlabs/php_codesniffer": "^4",
"phpstan/phpstan": "^2.1"
}
}