Skip to content

Commit dc4780e

Browse files
committed
chore(release): 2.2.0
1 parent 4b2afe3 commit dc4780e

25 files changed

+2798
-314
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: Coding standards
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
44
lint:
55
name: Coding standards
66
runs-on: ubuntu-latest
77
strategy:
88
fail-fast: false
99
matrix:
10-
php: [ '8.0', '8.1', '8.2', '8.3' ]
10+
php: [ '8.4', '8.5' ]
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
@@ -23,7 +23,7 @@ jobs:
2323
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
2424

2525
- name: Cache dependencies installed with composer
26-
uses: actions/cache@v2
26+
uses: actions/cache@v4
2727
with:
2828
path: ${{ env.COMPOSER_CACHE_DIR }}
2929
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
@@ -37,4 +37,4 @@ jobs:
3737
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
3838

3939
- name: Run code quality analysis
40-
run: make lint
40+
run: make lint

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
on: [push]
3+
jobs:
4+
test:
5+
name: Tests
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
php: [ '8.4', '8.5' ]
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: ${{ matrix.php }}
20+
tools: composer:v2
21+
22+
- name: Setup cache
23+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
24+
25+
- name: Cache dependencies installed with composer
26+
uses: actions/cache@v4
27+
with:
28+
path: ${{ env.COMPOSER_CACHE_DIR }}
29+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
30+
restore-keys: |
31+
php${{ matrix.php }}-composer-latest-
32+
33+
- name: Update composer
34+
run: composer self-update
35+
36+
- name: Install dependencies with composer
37+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
38+
39+
- name: Run tests
40+
run: make test

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/vendor
2-
/.idea
3-
.phpcs-cache
1+
/vendor/
2+
.idea
3+
.phpunit.result.cache
4+
.phpunit.cache
5+
.vscode
46
index.php

Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
.DEFAULT_GOAL := help
2+
3+
# -----------------------------------
4+
# Recipes
5+
# -----------------------------------
16
.PHONY: help
27
help: ## affiche cet aide
38
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
49

510
.PHONY: lint
6-
lint: vendor/autoload.php ## affiche les erreurs de formatage de code
7-
php vendor/bin/phpcs -s
11+
lint: ## affiche les erreurs de formatage de code
12+
php vendor/bin/ecs
813
php vendor/bin/phpstan
14+
php vendor/bin/rector --dry-run
915

10-
.PHONY: lint-fix
11-
lint-fix: vendor/autoload.php ## corrige les erreurs de formatage de code
12-
php vendor/bin/phpcbf
13-
14-
vendor/autoload.php: composer.lock # installe les dépendances PHP
15-
composer update
16-
composer dump-autoload
16+
.PHONY: test
17+
test: ## lance les tests
18+
php vendor/bin/phpunit

composer.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"Devscast\\Tinify\\": "src/"
1717
}
1818
},
19+
"autoload-dev": {
20+
"psr-4": {
21+
"Devscast\\Tinify\\Tests\\": "tests/"
22+
}
23+
},
1924
"authors": [
2025
{
2126
"name": "bernard-ng",
@@ -24,13 +29,16 @@
2429
],
2530
"minimum-stability": "stable",
2631
"require-dev": {
27-
"squizlabs/php_codesniffer": "^3.6",
28-
"symfony/var-dumper": "^6.0|^7.0",
29-
"phpstan/phpstan": "^1.4"
32+
"symfony/var-dumper": "^7.0|^8.0",
33+
"rector/rector": "^2.3",
34+
"phpstan/phpstan": "^2.1",
35+
"phpstan/phpstan-phpunit": "^2.0",
36+
"phpunit/phpunit": "^13.0",
37+
"symplify/easy-coding-standard": "^13.0"
3038
},
3139
"require": {
32-
"php": ">=8.0",
33-
"symfony/http-client": "^6.0|^7.0"
40+
"php": ">=8.4",
41+
"symfony/http-client": "^7.0|^8.0"
3442
},
3543
"repositories": [
3644
{

0 commit comments

Comments
 (0)